File tree Expand file tree Collapse file tree
compiler/rustc_ast_lowering/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2069,7 +2069,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
20692069 {
20702070 RelaxedBoundPolicy :: Allowed
20712071 } else {
2072- RelaxedBoundPolicy :: Forbidden ( RelaxedBoundForbiddenReason :: LateBoundVarsInScope )
2072+ RelaxedBoundPolicy :: Forbidden ( RelaxedBoundForbiddenReason :: WhereBound )
20732073 } ;
20742074 hir:: WherePredicateKind :: BoundPredicate ( hir:: WhereBoundPredicate {
20752075 bound_generic_params : self . lower_generic_params (
Original file line number Diff line number Diff line change @@ -329,7 +329,9 @@ enum RelaxedBoundForbiddenReason {
329329 SuperTrait ,
330330 TraitAlias ,
331331 AssocTyBounds ,
332- LateBoundVarsInScope ,
332+ /// We do not allow where bounds doing relaxed bounds,
333+ /// except if it's for generic parameters of the current item.
334+ WhereBound ,
333335}
334336
335337/// Context of `impl Trait` in code, which determines whether it is allowed in an HIR subtree,
@@ -2268,7 +2270,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
22682270 return ;
22692271 }
22702272 RelaxedBoundForbiddenReason :: AssocTyBounds
2271- | RelaxedBoundForbiddenReason :: LateBoundVarsInScope => { }
2273+ | RelaxedBoundForbiddenReason :: WhereBound => { }
22722274 } ;
22732275 }
22742276 }
You can’t perform that action at this time.
0 commit comments