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

Rename tcx to cx in rustc_type_ir #127810

Merged
merged 3 commits into from
Jul 18, 2024
Merged

Conversation

compiler-errors
Copy link
Member

Self-explanatory. Forgot that we had to do this in type_ir too, and not just the new solver crate lol.

r? lcnr

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative labels Jul 16, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jul 16, 2024

changes to the core type system

cc @compiler-errors, @lcnr

changes to the core type system

cc @compiler-errors, @lcnr

@lcnr
Copy link
Contributor

lcnr commented Jul 16, 2024

@bors r+ rollup=iffy

@bors
Copy link
Contributor

bors commented Jul 16, 2024

📌 Commit b9487d3 has been approved by lcnr

It is now in the queue for this repository.

@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 Jul 16, 2024
tgross35 added a commit to tgross35/rust that referenced this pull request Jul 16, 2024
Rename `tcx` to `cx` in `rustc_type_ir`

Self-explanatory. Forgot that we had to do this in type_ir too, and not just the new solver crate lol.

r? lcnr
tgross35 added a commit to tgross35/rust that referenced this pull request Jul 16, 2024
Rename `tcx` to `cx` in `rustc_type_ir`

Self-explanatory. Forgot that we had to do this in type_ir too, and not just the new solver crate lol.

r? lcnr
tgross35 added a commit to tgross35/rust that referenced this pull request Jul 16, 2024
Rename `tcx` to `cx` in `rustc_type_ir`

Self-explanatory. Forgot that we had to do this in type_ir too, and not just the new solver crate lol.

r? lcnr
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 17, 2024
Rollup of 11 pull requests

Successful merges:

 - rust-lang#125206 (Simplify environment variable examples)
 - rust-lang#126208 (Migrate `compiler-lookup-paths`, `dump-mono-stats` and `prune-link-args` `run-make` tests to `rmake` or `ui` format)
 - rust-lang#126271 (Skip fast path for dec2flt when optimize_for_size)
 - rust-lang#126776 (Clean up more comments near use declarations)
 - rust-lang#127444 (`impl Send + Sync` and override `count` for the `CStr::bytes` iterator)
 - rust-lang#127792 (std: Use `read_unaligned` for reads from DWARF)
 - rust-lang#127807 (Use futex.rs for Windows thread parking)
 - rust-lang#127810 (Rename `tcx` to `cx` in `rustc_type_ir`)
 - rust-lang#127816 (Update method name to reflect changes to its internals)
 - rust-lang#127833 (zkvm: add `#[forbid(unsafe_op_in_unsafe_fn)]` in `stdlib`)
 - rust-lang#127836 (std: Forbid unwrapped unsafe ops in xous and uefi modules)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Jul 17, 2024

☔ The latest upstream changes (presumably #127831) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 17, 2024
@compiler-errors
Copy link
Member Author

rebased

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Jul 17, 2024

📌 Commit 0b5ce54 has been approved by lcnr

It is now in the queue for this repository.

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 17, 2024
@@ -137,7 +137,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for MatchAgainstHigherRankedOutlives<'tcx>
"MatchAgainstHigherRankedOutlives"
}

fn tcx(&self) -> TyCtxt<'tcx> {
fn cx(&self) -> TyCtxt<'tcx> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh... is there broader context for these changes I'm unaware of? As written it seems to that having a tcx getter named cx (and all the similar changes) makes the code less clear.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tcx and TyCtxt mean nothing in rustc_type_ir, and the name interner is quite long.

@lcnr and I decided it's idiomatic enough just to call it cx in the abstracted-out new solver crate.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense for the changes rustc_type_ir, but this change is in rustc_infer where TyCtxt does mean something. It's the return type of this method! And there are also changes in rustc_borrowck, rustc_middle, etc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, And the trait definition is in rustc_type_ir. Is this affecting your ability to understand the code? I feel like this can be fixed with documentation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like, OK, we have more than a handful of other random strings that people are going to be confused about once, learn, and then never think about forever. This particular one is in TypeRelation, which approximately nobody should ever touch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also like, TyCtxt really is the Cx of all Cxes. If anything deserves that name, at least in a somewhat limited context of things that touch the middle::ty layer, then it's definitely this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trait is in rustc_type_ir, hmm, ok. You are right that interner would definitely be a better name, though I understand the desire for a short name. Thanks for the explanation.

tgross35 added a commit to tgross35/rust that referenced this pull request Jul 18, 2024
Rename `tcx` to `cx` in `rustc_type_ir`

Self-explanatory. Forgot that we had to do this in type_ir too, and not just the new solver crate lol.

r? lcnr
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 18, 2024
Rollup of 9 pull requests

Successful merges:

 - rust-lang#127077 (Make language around `ToOwned` for `BorrowedFd` more precise)
 - rust-lang#127523 (Migrate `dump-ice-to-disk` and `panic-abort-eh_frame` `run-make` tests to rmake)
 - rust-lang#127787 (Migrate `atomic-lock-free` to `rmake`)
 - rust-lang#127806 (Some parser improvements)
 - rust-lang#127810 (Rename `tcx` to `cx` in `rustc_type_ir`)
 - rust-lang#127878 (Fix associated item removal suggestion)
 - rust-lang#127886 (Accurate `use` rename suggestion span)
 - rust-lang#127888 (More accurate span for type parameter suggestion)
 - rust-lang#127889 (More accurate span for anonymous argument suggestion)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 18, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#127077 (Make language around `ToOwned` for `BorrowedFd` more precise)
 - rust-lang#127783 (Put the dots back in RTN pretty printing)
 - rust-lang#127787 (Migrate `atomic-lock-free` to `rmake`)
 - rust-lang#127810 (Rename `tcx` to `cx` in `rustc_type_ir`)
 - rust-lang#127878 (Fix associated item removal suggestion)
 - rust-lang#127886 (Accurate `use` rename suggestion span)
 - rust-lang#127888 (More accurate span for type parameter suggestion)
 - rust-lang#127889 (More accurate span for anonymous argument suggestion)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b2b14de into rust-lang:master Jul 18, 2024
6 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jul 18, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jul 18, 2024
Rollup merge of rust-lang#127810 - compiler-errors:less-tcx, r=lcnr

Rename `tcx` to `cx` in `rustc_type_ir`

Self-explanatory. Forgot that we had to do this in type_ir too, and not just the new solver crate lol.

r? lcnr
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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants