Skip to content

Commit

Permalink
Ignore other PredicateKinds in rustdoc auto trait finder
Browse files Browse the repository at this point in the history
Fixes #92073

There's not really anything we can do with them, and they're
causing ICEs. I'm not using a wildcard match, as we should check
that any new `PredicateKind`s are handled properly by rustdoc.
  • Loading branch information
Aaron1011 committed Dec 18, 2021
1 parent 7abab1e commit d31f7f1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion compiler/rustc_trait_selection/src/traits/auto_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,17 @@ impl<'tcx> AutoTraitFinder<'tcx> {
_ => return false,
}
}
_ => panic!("Unexpected predicate {:?} {:?}", ty, predicate),
// There's not really much we can do with these predicates -
// we start out with a `ParamEnv` with no inference variables,
// and these don't correspond to adding any new bounds to
// the `ParamEnv`.
ty::PredicateKind::WellFormed(..)
| ty::PredicateKind::ObjectSafe(..)
| ty::PredicateKind::ClosureKind(..)
| ty::PredicateKind::Subtype(..)
| ty::PredicateKind::ConstEvaluatable(..)
| ty::PredicateKind::Coerce(..)
| ty::PredicateKind::TypeWellFormedFromEnv(..) => {}
};
}
true
Expand Down

0 comments on commit d31f7f1

Please sign in to comment.