Example offenders:
|
/// This is appropriate to use only after type-check: it assumes |
|
/// that normalization will succeed, for example. |
|
pub fn normalize_erasing_regions<T>(self, param_env: ty::ParamEnv<'tcx>, value: T) -> T |
|
/// Assumes that this is run after the entire crate has been successfully type-checked. |
|
pub fn codegen_fulfill_obligation<'tcx>( |
None of this is particularly true anymore (not that it was great when it used to be true), especially since we started using miri for constant evaluation, which uses all the same tools codegen does, and is interleaved/mutually recursive with type-checking.
The only real thing to keep in mind is that if you have inference variables, you're responsible for using InferCtxt correctly.
cc @rust-lang/compiler
Example offenders:
rust/src/librustc/ty/normalize_erasing_regions.rs
Lines 18 to 20 in a039217
rust/src/librustc_trait_selection/traits/codegen/mod.rs
Lines 18 to 19 in c6b172f
None of this is particularly true anymore (not that it was great when it used to be true), especially since we started using
mirifor constant evaluation, which uses all the same tools codegen does, and is interleaved/mutually recursive with type-checking.The only real thing to keep in mind is that if you have inference variables, you're responsible for using
InferCtxtcorrectly.cc @rust-lang/compiler