-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Example offenders:
rust/src/librustc/ty/normalize_erasing_regions.rs
Lines 18 to 20 in a039217
/// 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 |
rust/src/librustc_trait_selection/traits/codegen/mod.rs
Lines 18 to 19 in c6b172f
/// 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
Metadata
Metadata
Assignees
Labels
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.