]> git.lizzy.rs Git - rust.git/commitdiff
Ignore other `PredicateKind`s in rustdoc auto trait finder
authorAaron Hill <aa1ronham@gmail.com>
Sat, 18 Dec 2021 16:25:05 +0000 (11:25 -0500)
committerAaron Hill <aa1ronham@gmail.com>
Sat, 18 Dec 2021 16:26:15 +0000 (11:26 -0500)
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.

compiler/rustc_trait_selection/src/traits/auto_trait.rs

index 53ff911ea0cdacfc0e767ffe8db77999f394d198..05d2a373dc6390977b0659d2037b0d34b8450d6c 100644 (file)
@@ -839,7 +839,17 @@ fn evaluate_nested_obligations(
                         _ => 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