Skip to content

Commit f9eb0b3

Browse files
beepster4096compiler-errors
authored andcommitted
ignore constness when checking dtor predicates
1 parent ee5d8d3 commit f9eb0b3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

compiler/rustc_typeck/src/check/dropck.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,15 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'tcx>(
228228
let predicate = predicate.kind();
229229
let p = p.kind();
230230
match (predicate.skip_binder(), p.skip_binder()) {
231-
(ty::PredicateKind::Trait(a), ty::PredicateKind::Trait(b)) => {
232-
relator.relate(predicate.rebind(a), p.rebind(b)).is_ok()
233-
}
231+
(ty::PredicateKind::Trait(a), ty::PredicateKind::Trait(b)) => relator
232+
.relate(
233+
predicate.rebind(ty::TraitPredicate {
234+
constness: ty::BoundConstness::NotConst,
235+
..a
236+
}),
237+
p.rebind(b),
238+
)
239+
.is_ok(),
234240
(ty::PredicateKind::Projection(a), ty::PredicateKind::Projection(b)) => {
235241
relator.relate(predicate.rebind(a), p.rebind(b)).is_ok()
236242
}

0 commit comments

Comments
 (0)