about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/traits/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_middle/src/traits/mod.rs')
-rw-r--r--compiler/rustc_middle/src/traits/mod.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/compiler/rustc_middle/src/traits/mod.rs b/compiler/rustc_middle/src/traits/mod.rs
index ee816791919..58aff27266d 100644
--- a/compiler/rustc_middle/src/traits/mod.rs
+++ b/compiler/rustc_middle/src/traits/mod.rs
@@ -1004,6 +1004,7 @@ pub enum CodegenObligationError {
 /// opaques are replaced with inference vars eagerly in the old solver (e.g.
 /// in projection, and in the signature during function type-checking).
 #[derive(Debug, PartialEq, Eq, Clone, Copy, Hash, HashStable, TypeFoldable, TypeVisitable)]
+#[derive(TyEncodable, TyDecodable)]
 pub enum DefiningAnchor<'tcx> {
     /// Define opaques which are in-scope of the current item being analyzed.
     /// Also, eagerly replace these opaque types in `replace_opaque_types_with_inference_vars`.
@@ -1012,14 +1013,12 @@ pub enum DefiningAnchor<'tcx> {
     /// errors when handling opaque types, and also should be used when we would
     /// otherwise reveal opaques (such as [`Reveal::All`] reveal mode).
     Bind(&'tcx ty::List<LocalDefId>),
-    /// In contexts where we don't currently know what opaques are allowed to be
-    /// defined, such as (old solver) canonical queries, we will simply allow
-    /// opaques to be defined, but "bubble" them up in the canonical response or
-    /// otherwise treat them to be handled later.
-    ///
-    /// We do not eagerly replace opaque types in `replace_opaque_types_with_inference_vars`,
-    /// which may affect what predicates pass and fail in the old trait solver.
-    Bubble,
+}
+
+impl Default for DefiningAnchor<'_> {
+    fn default() -> Self {
+        Self::Bind(ty::List::empty())
+    }
 }
 
 impl<'tcx> DefiningAnchor<'tcx> {