Stability annotations on generic trait parameters
This commit is contained in:
parent
6d3acf5129
commit
a7a2086053
8 changed files with 226 additions and 26 deletions
|
@ -360,7 +360,16 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
|||
(GenericParamDefKind::Lifetime, GenericArg::Lifetime(lt)) => {
|
||||
self.ast_region_to_region(<, Some(param)).into()
|
||||
}
|
||||
(GenericParamDefKind::Type { .. }, GenericArg::Type(ty)) => {
|
||||
(GenericParamDefKind::Type { has_default, .. }, GenericArg::Type(ty)) => {
|
||||
if *has_default {
|
||||
tcx.check_stability_internal(
|
||||
param.def_id,
|
||||
Some(arg.id()),
|
||||
arg.span(),
|
||||
false,
|
||||
|_, _| (),
|
||||
)
|
||||
}
|
||||
if let (hir::TyKind::Infer, false) = (&ty.kind, self.allow_ty_infer()) {
|
||||
inferred_params.push(ty.span);
|
||||
tcx.ty_error().into()
|
||||
|
|
|
@ -1227,7 +1227,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
|
|||
if let Some(uc) = unstable_candidates {
|
||||
applicable_candidates.retain(|&(p, _)| {
|
||||
if let stability::EvalResult::Deny { feature, .. } =
|
||||
self.tcx.eval_stability(p.item.def_id, None, self.span)
|
||||
self.tcx.eval_stability(p.item.def_id, None, self.span, true)
|
||||
{
|
||||
uc.push((p, feature));
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue