mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 02:00:00 +03:00
fix elaborate for predicates with unbound variables
This commit is contained in:
@@ -151,15 +151,11 @@ pub fn filter_to_traits(self) -> FilterToTraits<'tcx, Self> {
|
||||
|
||||
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());
|
||||
|
||||
@@ -763,7 +763,7 @@ fn evaluate_nested_obligations(
|
||||
}
|
||||
}
|
||||
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).
|
||||
|
||||
Reference in New Issue
Block a user