Skip to content

Commit bec499e

Browse files
authored
Rollup merge of #92076 - Aaron1011:rustdoc-auto-trait-ignore, r=cjgillot
Ignore other `PredicateKind`s in rustdoc auto trait finder 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.
2 parents e91ad5f + d31f7f1 commit bec499e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

compiler/rustc_trait_selection/src/traits/auto_trait.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,17 @@ impl<'tcx> AutoTraitFinder<'tcx> {
839839
_ => return false,
840840
}
841841
}
842-
_ => panic!("Unexpected predicate {:?} {:?}", ty, predicate),
842+
// There's not really much we can do with these predicates -
843+
// we start out with a `ParamEnv` with no inference variables,
844+
// and these don't correspond to adding any new bounds to
845+
// the `ParamEnv`.
846+
ty::PredicateKind::WellFormed(..)
847+
| ty::PredicateKind::ObjectSafe(..)
848+
| ty::PredicateKind::ClosureKind(..)
849+
| ty::PredicateKind::Subtype(..)
850+
| ty::PredicateKind::ConstEvaluatable(..)
851+
| ty::PredicateKind::Coerce(..)
852+
| ty::PredicateKind::TypeWellFormedFromEnv(..) => {}
843853
};
844854
}
845855
true

0 commit comments

Comments
 (0)