Skip to content

Commit

Permalink
ignore constness when checking dtor predicates
Browse files Browse the repository at this point in the history
  • Loading branch information
beepster4096 authored and compiler-errors committed Jan 18, 2022
1 parent ee5d8d3 commit f9eb0b3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions compiler/rustc_typeck/src/check/dropck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit f9eb0b3

Please sign in to comment.