about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-12-28 13:59:22 +0100
committerGitHub <noreply@github.com>2021-12-28 13:59:22 +0100
commitbec499e08d91a61942e01ac2a747c285e48da2fd (patch)
tree9a475269a577e329850a73175199df001c0558fe
parente91ad5fc62bdee4a29c18baa5fad2ca42fc91bf4 (diff)
parentd31f7f1097539c41fea01a7f05400d05d31786c7 (diff)
downloadrust-bec499e08d91a61942e01ac2a747c285e48da2fd.tar.gz
rust-bec499e08d91a61942e01ac2a747c285e48da2fd.zip
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.
-rw-r--r--compiler/rustc_trait_selection/src/traits/auto_trait.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/auto_trait.rs b/compiler/rustc_trait_selection/src/traits/auto_trait.rs
index 53ff911ea0c..05d2a373dc6 100644
--- a/compiler/rustc_trait_selection/src/traits/auto_trait.rs
+++ b/compiler/rustc_trait_selection/src/traits/auto_trait.rs
@@ -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