Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminology: prefer "outside inference" to "after typeck" (or worse "during codegen"). #70258

Closed
eddyb opened this issue Mar 22, 2020 · 2 comments · Fixed by #90277
Closed

Terminology: prefer "outside inference" to "after typeck" (or worse "during codegen"). #70258

eddyb opened this issue Mar 22, 2020 · 2 comments · Fixed by #90277
Assignees
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@eddyb
Copy link
Member

eddyb commented Mar 22, 2020

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

@jonas-schievink jonas-schievink added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 22, 2020
@pierwill
Copy link
Member

@rustbot claim

@pierwill

This comment has been minimized.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 30, 2022
… r=jackh726

Improve terminology around "after typeck"

Closes rust-lang#70258.
@bors bors closed this as completed in 6749f32 Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants