@@ -37,8 +37,6 @@ declare_lint! {
37
37
/// type Assoc: Duh;
38
38
/// }
39
39
///
40
- /// struct Struct;
41
- ///
42
40
/// impl<F: Duh> Trait for F {
43
41
/// type Assoc = F;
44
42
/// }
@@ -53,12 +51,12 @@ declare_lint! {
53
51
/// {{produces}}
54
52
///
55
53
/// 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`
57
55
/// on the associated type.
58
56
///
59
57
/// Although the hidden type, `i32` does satisfy this bound, we do not
60
58
/// 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 `.
62
60
pub OPAQUE_HIDDEN_INFERRED_BOUND ,
63
61
Warn ,
64
62
"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 {
79
77
for ( pred, pred_span) in
80
78
cx. tcx . explicit_item_bounds ( def_id) . instantiate_identity_iter_copied ( )
81
79
{
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
+ ) ;
85
83
let ty:: ClauseKind :: Projection ( proj) = predicate else {
86
84
continue ;
87
85
} ;
0 commit comments