Skip to content

Commit 7106f8d

Browse files
committed
Don't transform predicates in Inherited
1 parent c6d0a20 commit 7106f8d

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

compiler/rustc_typeck/src/check/inherited.rs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -126,24 +126,8 @@ impl Inherited<'a, 'tcx> {
126126
}
127127
}
128128

129-
#[instrument(level = "debug", skip(self))]
130-
fn transform_predicate(&self, p: &mut ty::Predicate<'tcx>) {
131-
// Don't transform non-const bounds into const bounds,
132-
// but transform const bounds to non-const when we are
133-
// not in a const context.
134-
if let hir::Constness::NotConst = self.constness {
135-
let kind = p.kind();
136-
if let ty::PredicateKind::Trait(pred) = kind.as_ref().skip_binder() {
137-
let mut pred = *pred;
138-
pred.constness = hir::Constness::NotConst;
139-
*p = kind.rebind(ty::PredicateKind::Trait(pred)).to_predicate(self.tcx);
140-
}
141-
}
142-
}
143-
144-
pub(super) fn register_predicate(&self, mut obligation: traits::PredicateObligation<'tcx>) {
129+
pub(super) fn register_predicate(&self, obligation: traits::PredicateObligation<'tcx>) {
145130
debug!("register_predicate({:?})", obligation);
146-
self.transform_predicate(&mut obligation.predicate);
147131
if obligation.has_escaping_bound_vars() {
148132
span_bug!(obligation.cause.span, "escaping bound vars in predicate {:?}", obligation);
149133
}

0 commit comments

Comments
 (0)