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

Improve terminology around "after typeck" #90277

Merged
merged 1 commit into from
Jan 31, 2022

Conversation

pierwill
Copy link
Member

@pierwill pierwill commented Oct 25, 2021

Closes #70258.

@rust-highfive
Copy link
Collaborator

r? @oli-obk

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 25, 2021
@pierwill pierwill marked this pull request as draft October 25, 2021 17:48
@pierwill pierwill force-pushed the fix-70258-inference-terms branch 2 times, most recently from ff7dc39 to 6aa029c Compare October 25, 2021 18:09
@pierwill pierwill marked this pull request as ready for review October 25, 2021 18:10
@pierwill
Copy link
Member Author

Is this usage alright? Should we maybe just say "These rvalues can be optimized before lowering"?

/// that `Foo` has a destructor. These rvalues can be optimized
/// away after type-checking and before lowering.

@pierwill
Copy link
Member Author

Not sure about this one:

/// Explicit binding annotations given in the HIR for a binding. Note
/// that this is not the final binding *mode* that we infer after type
/// inference.
#[derive(Copy, Clone, PartialEq, Encodable, Debug, HashStable_Generic)]
pub enum BindingAnnotation {

@pierwill pierwill changed the title [WIP] Improve terminology around "after typeck" Improve terminology around "after typeck" Oct 25, 2021
@pierwill pierwill marked this pull request as draft October 25, 2021 18:12
@pierwill pierwill marked this pull request as ready for review October 25, 2021 18:13
@pierwill
Copy link
Member Author

Ah. I haven't looked at "during codegen" yet.

@pierwill pierwill marked this pull request as draft October 26, 2021 15:09
@pierwill pierwill marked this pull request as ready for review November 7, 2021 01:52
@pierwill
Copy link
Member Author

pierwill commented Nov 7, 2021

I'm not sure how to evaluate uses of the phrase "during codegen".

Here are the uses in compiler/:

search results
$ rg 'during code'
rustc_codegen_gcc/src/coverageinfo.rs
59:64:/// `function_coverage_map` (keyed by function `Instance`) during codegen.

rustc_codegen_llvm/src/context.rs
65:49:/// when we ptrcast, and we have to ptrcast during codegen

rustc_codegen_llvm/src/coverageinfo/mod.rs
85:64:/// `function_coverage_map` (keyed by function `Instance`) during codegen.

rustc_codegen_ssa/src/back/write.rs
333:48:// Handler to use for diagnostics produced during codegen.
1824:29:bug!("panic during codegen/LLVM phase");

rustc_codegen_ssa/src/base.rs
715:51:// Since the main thread is sometimes blocked during codegen, we keep track

rustc_codegen_ssa/src/coverageinfo/map.rs
102:62:/// from `u32::MAX`. Theses operands are translated only during code generation, after all

rustc_codegen_ssa/src/traits/mod.rs
8:81://! actual codegen, while the builder stores the information about the function during codegen and

rustc_middle/src/middle/codegen_fn_attrs.rs
90:13:/// during codegen.

rustc_middle/src/mir/coverage.rs
48:9:/// during codegen. LLVM expects zero-based indexes.

rustc_middle/src/mir/mod.rs
1210:9:/// during codegen where distinct kinds of basic blocks may be

rustc_middle/src/traits/mod.rs
666:43:/// is `Obligation`, as one might expect. During codegen, however, this

rustc_middle/src/ty/instance.rs
347:46:/// in a monomorphic context (i.e., like during codegen), then it is guaranteed to return

rustc_middle/src/ty/mod.rs
1215:54:/// Typically, this is `Reveal::UserFacing`, but during codegen we
1314:30:/// the desired behavior during codegen and certain other special

rustc_middle/src/ty/sty.rs
1409:60:/// Erased region, used by trait selection, in MIR and during codegen.

rustc_middle/src/ty/util.rs
191:9:/// during codegen.
267:9:/// during codegen.

rustc_mir_transform/src/coverage/mod.rs
47:85:/// counters, via intrinsic `llvm.instrprof.increment`, and/or inject metadata used during codegen

rustc_mir_transform/src/coverage/query.rs
74:70:// allocate arrays when generating the coverage map (during codegen), so choose

rustc_mir_transform/src/lower_intrinsics.rs
93:28:// during codegen. Issue #35310.

rustc_mir_transform/src/remove_storage_markers.rs
1:64://! This pass removes storage markers if they won't be emitted during codegen.

rustc_trait_selection/src/opaque_types.rs
229:20:// during codegen.

rustc_trait_selection/src/traits/codegen.rs
57:65:"encountered ambiguity selecting `{:?}` during codegen, presuming due to \
70:77:"Encountered error `Unimplemented` selecting `{:?}` during codegen",
77:65:bug!("Encountered error `{:?}` selecting `{:?}` during codegen", e, trait_ref)

So this PR might not fully close the issue, as is. But I think it might be valuable to merge, if others approve.

r? @eddyb

@rust-highfive rust-highfive assigned eddyb and unassigned oli-obk Nov 7, 2021
@apiraino apiraino added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Nov 11, 2021
@JohnCSimon
Copy link
Member

Ping from triage: assigning to author
@rustbot label: +S-waiting-on-author -S-waiting-on-review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 5, 2021
@pierwill
Copy link
Member Author

pierwill commented Dec 6, 2021

Hi @JohnCSimon! 👋 Just wondering, how come you added S-waiting-on-author? I think this is ready for review.

@pierwill
Copy link
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 28, 2021
@jackh726
Copy link
Member

r? @jackh726

@rust-highfive rust-highfive assigned jackh726 and unassigned eddyb Jan 13, 2022
@pnkfelix
Copy link
Member

@rustbot assign @jackh726

@jackh726
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jan 30, 2022

📌 Commit 521b1ee has been approved by jackh726

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 30, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 30, 2022
… r=jackh726

Improve terminology around "after typeck"

Closes rust-lang#70258.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 31, 2022
…askrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#90277 (Improve terminology around "after typeck")
 - rust-lang#92918 (Allow eliding GATs in expression position)
 - rust-lang#93039 (Don't suggest inaccessible fields)
 - rust-lang#93155 (Switch pretty printer to block-based indentation)
 - rust-lang#93214 (Respect doc(hidden) when suggesting available fields)
 - rust-lang#93347 (Make `char::DecodeUtf16::size_hist` more precise)
 - rust-lang#93392 (Clarify documentation on char::MAX)
 - rust-lang#93444 (Fix some CSS warnings and errors from VS Code)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 6749f32 into rust-lang:master Jan 31, 2022
@rustbot rustbot added this to the 1.60.0 milestone Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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