Skip to content

Commit f9ee681

Browse files
BoxyUwUpnkfelix
authored andcommitted
variant of PR 90840 with limited scope for backport.
1 parent ef1a3b9 commit f9ee681

File tree

4 files changed

+30
-19
lines changed

4 files changed

+30
-19
lines changed

compiler/rustc_typeck/src/check/dropck.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,6 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'tcx>(
239239
ty::PredicateKind::ConstEvaluatable(a),
240240
ty::PredicateKind::ConstEvaluatable(b),
241241
) => tcx.try_unify_abstract_consts((a, b)),
242-
(ty::PredicateKind::TypeOutlives(a), ty::PredicateKind::TypeOutlives(b)) => {
243-
relator.relate(predicate.rebind(a.0), p.rebind(b.0)).is_ok()
244-
}
245242
_ => predicate == p,
246243
}
247244
};

src/test/ui/const-generics/generic_const_exprs/drop_impl.rs

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
struct Wrapper<'a, T>(&'a T)
2+
where
3+
T: 'a;
4+
5+
impl<'a, T> Drop for Wrapper<'a, T>
6+
where
7+
T: 'static,
8+
//~^ error: `Drop` impl requires `T: 'static` but the struct it is implemented for does not
9+
{
10+
fn drop(&mut self) {}
11+
}
12+
13+
fn main() {}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
error[E0367]: `Drop` impl requires `T: 'static` but the struct it is implemented for does not
2+
--> $DIR/relate_lt_in_type_outlives_bound.rs:7:8
3+
|
4+
LL | T: 'static,
5+
| ^^^^^^^
6+
|
7+
note: the implementor must specify the same requirement
8+
--> $DIR/relate_lt_in_type_outlives_bound.rs:1:1
9+
|
10+
LL | / struct Wrapper<'a, T>(&'a T)
11+
LL | | where
12+
LL | | T: 'a;
13+
| |__________^
14+
15+
error: aborting due to previous error
16+
17+
For more information about this error, try `rustc --explain E0367`.

0 commit comments

Comments
 (0)