File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
compiler/rustc_middle/src/ty Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -1185,15 +1185,24 @@ impl<'tcx> TypingEnv<'tcx> {
1185
1185
}
1186
1186
}
1187
1187
1188
- /// TODO: this method is sus
1188
+ /// Modify the `typing_mode` to `PostAnalysis` and eagerly reveal all
1189
+ /// opaque types in the `param_env`.
1189
1190
pub fn with_reveal_all_normalized ( self , tcx : TyCtxt < ' tcx > ) -> TypingEnv < ' tcx > {
1190
1191
let TypingEnv { typing_mode : _, param_env } = self ;
1191
1192
let param_env = param_env. with_reveal_all_normalized ( tcx) ;
1192
1193
TypingEnv { typing_mode : TypingMode :: PostAnalysis , param_env }
1193
1194
}
1194
1195
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( ) ) ;
1197
1206
PseudoCanonicalInput { typing_env : self , value }
1198
1207
}
1199
1208
}
You can’t perform that action at this time.
0 commit comments