@@ -37,8 +37,6 @@ declare_lint! {
3737 /// type Assoc: Duh;
3838 /// }
3939 ///
40- /// struct Struct;
41- ///
4240 /// impl<F: Duh> Trait for F {
4341 /// type Assoc = F;
4442 /// }
@@ -53,12 +51,12 @@ declare_lint! {
5351 /// {{produces}}
5452 ///
5553 /// In this example, `test` declares that the associated type `Assoc` for
56- /// `impl Trait` is `impl Sized`, which does not satisfy the `Send` bound
54+ /// `impl Trait` is `impl Sized`, which does not satisfy the bound `Duh`
5755 /// on the associated type.
5856 ///
5957 /// Although the hidden type, `i32` does satisfy this bound, we do not
6058 /// consider the return type to be well-formed with this lint. It can be
61- /// fixed by changing `Tait = impl Sized` into `Tait = impl Sized + Send `.
59+ /// fixed by changing `Tait = impl Sized` into `Tait = impl Sized + Duh `.
6260 pub OPAQUE_HIDDEN_INFERRED_BOUND ,
6361 Warn ,
6462 "detects the use of nested `impl Trait` types in associated type bounds that are not general enough"
@@ -79,9 +77,9 @@ impl<'tcx> LateLintPass<'tcx> for OpaqueHiddenInferredBound {
7977 for ( pred, pred_span) in
8078 cx. tcx . explicit_item_bounds ( def_id) . instantiate_identity_iter_copied ( )
8179 {
82- // Liberate bound regions in the predicate since we
83- // don't actually care about lifetimes in this check.
84- let predicate = cx . tcx . liberate_late_bound_regions ( def_id , pred . kind ( ) ) ;
80+ let predicate = infcx . instantiate_binder_with_placeholders (
81+ pred . kind ( ) ,
82+ ) ;
8583 let ty:: ClauseKind :: Projection ( proj) = predicate else {
8684 continue ;
8785 } ;
0 commit comments