diff options
| author | DrMeepster <19316085+DrMeepster@users.noreply.github.com> | 2022-01-14 21:01:20 -0800 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-01-17 21:37:38 -0800 |
| commit | f9eb0b3b7ba13ea80733f418ac28e8988d60588d (patch) | |
| tree | 8fb91dd7686c7f65d5236a1afcdf36c8f9424d0c | |
| parent | ee5d8d37baaf5b5a81a98396952839c73ae41c68 (diff) | |
| download | rust-f9eb0b3b7ba13ea80733f418ac28e8988d60588d.tar.gz rust-f9eb0b3b7ba13ea80733f418ac28e8988d60588d.zip | |
ignore constness when checking dtor predicates
| -rw-r--r-- | compiler/rustc_typeck/src/check/dropck.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/compiler/rustc_typeck/src/check/dropck.rs b/compiler/rustc_typeck/src/check/dropck.rs index c8986aa7f53..46610a0e08d 100644 --- a/compiler/rustc_typeck/src/check/dropck.rs +++ b/compiler/rustc_typeck/src/check/dropck.rs @@ -228,9 +228,15 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'tcx>( let predicate = predicate.kind(); let p = p.kind(); match (predicate.skip_binder(), p.skip_binder()) { - (ty::PredicateKind::Trait(a), ty::PredicateKind::Trait(b)) => { - relator.relate(predicate.rebind(a), p.rebind(b)).is_ok() - } + (ty::PredicateKind::Trait(a), ty::PredicateKind::Trait(b)) => relator + .relate( + predicate.rebind(ty::TraitPredicate { + constness: ty::BoundConstness::NotConst, + ..a + }), + p.rebind(b), + ) + .is_ok(), (ty::PredicateKind::Projection(a), ty::PredicateKind::Projection(b)) => { relator.relate(predicate.rebind(a), p.rebind(b)).is_ok() } |
