-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Conversation
changes to the core type system changes to the core type system |
@bors r+ rollup=iffy |
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
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
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
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
☔ The latest upstream changes (presumably #127831) made this pull request unmergeable. Please resolve the merge conflicts. |
b9487d3
to
0b5ce54
Compare
rebased @bors r=lcnr |
@@ -137,7 +137,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for MatchAgainstHigherRankedOutlives<'tcx> | |||
"MatchAgainstHigherRankedOutlives" | |||
} | |||
|
|||
fn tcx(&self) -> TyCtxt<'tcx> { | |||
fn cx(&self) -> TyCtxt<'tcx> { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 Cx
es. 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.
There was a problem hiding this comment.
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.
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
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
…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
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
Self-explanatory. Forgot that we had to do this in type_ir too, and not just the new solver crate lol.
r? lcnr