Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

variant of PR 87770 with limited scope for backport. #91136

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions compiler/rustc_typeck/src/check/dropck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,6 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'tcx>(
ty::PredicateKind::ConstEvaluatable(a),
ty::PredicateKind::ConstEvaluatable(b),
) => tcx.try_unify_abstract_consts((a, b)),
(ty::PredicateKind::TypeOutlives(a), ty::PredicateKind::TypeOutlives(b)) => {
relator.relate(predicate.rebind(a.0), p.rebind(b.0)).is_ok()
}
_ => predicate == p,
}
};
Expand Down
16 changes: 0 additions & 16 deletions src/test/ui/const-generics/generic_const_exprs/drop_impl.rs

This file was deleted.

13 changes: 13 additions & 0 deletions src/test/ui/dropck/relate_lt_in_type_outlives_bound.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
struct Wrapper<'a, T>(&'a T)
where
T: 'a;

impl<'a, T> Drop for Wrapper<'a, T>
where
T: 'static,
//~^ error: `Drop` impl requires `T: 'static` but the struct it is implemented for does not
{
fn drop(&mut self) {}
}

fn main() {}
17 changes: 17 additions & 0 deletions src/test/ui/dropck/relate_lt_in_type_outlives_bound.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
error[E0367]: `Drop` impl requires `T: 'static` but the struct it is implemented for does not
--> $DIR/relate_lt_in_type_outlives_bound.rs:7:8
|
LL | T: 'static,
| ^^^^^^^
|
note: the implementor must specify the same requirement
--> $DIR/relate_lt_in_type_outlives_bound.rs:1:1
|
LL | / struct Wrapper<'a, T>(&'a T)
LL | | where
LL | | T: 'a;
| |__________^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0367`.