Skip to content

Commit 7db68fb

Browse files
committed
w
1 parent 6730e71 commit 7db68fb

File tree

1 file changed

+12
-3
lines changed
  • compiler/rustc_middle/src/ty

1 file changed

+12
-3
lines changed

compiler/rustc_middle/src/ty/mod.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,15 +1185,24 @@ impl<'tcx> TypingEnv<'tcx> {
11851185
}
11861186
}
11871187

1188-
/// TODO: this method is sus
1188+
/// Modify the `typing_mode` to `PostAnalysis` and eagerly reveal all
1189+
/// opaque types in the `param_env`.
11891190
pub fn with_reveal_all_normalized(self, tcx: TyCtxt<'tcx>) -> TypingEnv<'tcx> {
11901191
let TypingEnv { typing_mode: _, param_env } = self;
11911192
let param_env = param_env.with_reveal_all_normalized(tcx);
11921193
TypingEnv { typing_mode: TypingMode::PostAnalysis, param_env }
11931194
}
11941195

1195-
// TODO
1196-
pub fn as_query_input<T>(self, value: T) -> PseudoCanonicalInput<'tcx, T> {
1196+
/// Combine this typing environment with the given `value` to be used by
1197+
/// not (yet) canonicalized queries. This only works if the value does not
1198+
/// contain anything local to some `InferCtxt`, i.e. inference variables or
1199+
/// placeholders.
1200+
pub fn as_query_input<T>(self, value: T) -> PseudoCanonicalInput<'tcx, T>
1201+
where
1202+
T: TypeVisitable<TyCtxt<'tcx>>,
1203+
{
1204+
debug_assert!(!value.has_infer());
1205+
debug_assert!(!value.has_placeholders());
11971206
PseudoCanonicalInput { typing_env: self, value }
11981207
}
11991208
}

0 commit comments

Comments
 (0)