fn elaborate(&mut self, obligation: &PredicateObligation<'tcx>) {
let tcx = self.visited.tcx;
- let pred = match obligation.predicate.kind() {
- // We have to be careful and rebind this when
- // dealing with a predicate further down.
- ty::PredicateKind::ForAll(binder) => binder.skip_binder().kind(),
- pred => pred,
- };
-
- match pred {
- ty::PredicateKind::ForAll(_) => bug!("unexpected predicate: {:?}", pred),
+
+ match obligation.predicate.ignore_qualifiers(tcx).skip_binder().kind() {
+ ty::PredicateKind::ForAll(_) => {
+ bug!("unexpected predicate: {:?}", obligation.predicate)
+ }
ty::PredicateKind::Trait(data, _) => {
// Get predicates declared on the trait.
let predicates = tcx.super_predicates_of(data.def_id());
}
}
Ok(None) => {
- // It's ok not to make progress when hvave no inference variables -
+ // It's ok not to make progress when have no inference variables -
// in that case, we were only performing unifcation to check if an
// error occurred (which would indicate that it's impossible for our
// type to implement the auto trait).