-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
rustc_trans: reorganize CrateContext and rename context types. #47209
Conversation
Some notes:
Type checking has commonly used and very similarly named
|
So the divergence is intentional but I'm not sure yet about |
I'm not entirely sure how I feel about cc @rust-lang/compiler -- anybody else care to leave their 2 cents? |
My line of reasoning is that using one letter with a Hence, |
@eddyb I think I agree with that reasoning. |
☔ The latest upstream changes (presumably #47225) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #47235) made this pull request unmergeable. Please resolve the merge conflicts. |
I think that |
It does seem like |
Having let this sit for a bit, I feel like I'm leaning mildly against the renaming of |
@eddyb and I were chatting on IRC and discussing the full set of names. I feel like this change wants to take all of them into account. One thought we had was that the name "tcx", while it has a lot of history in it, isn't especially meaningful -- and as we move to more and more querification, it will become increasingly inappropriate (because it's the context for more than types). We were thinking that "query context" would be a better name, and that then one might write just |
@michaelwoerister @pnkfelix @petrochenkov thoughts on previous comment? |
@nikomatsakis |
I like |
OK. I think I'm tired of debating about this. @eddyb do what you feel is best =) |
☔ The latest upstream changes (presumably #47223) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors r=nikomatsakis |
📌 Commit 4e40a0d has been approved by |
rustc_trans: reorganize CrateContext and rename context types. Firstly, the `{Shared,Local}CrateContext` hasn't been meaningful for a while now, and this PR resolves it by moving all their fields to `CrateContext` and removing redundant accessor methods. Secondly, this PR contains the following mass-renames: * `ccx: CrateContext` -> `cx: CodegenCx` * `mircx: MirContext` -> `fx: FunctionCx` * `bcx: Builder` -> `bx: Builder` r? @nikomatsakis
☀️ Test successful - status-appveyor, status-travis |
Just for reference, I prefer using the same lifetime name for the global interner lifetime instead of it sometimes being |
I also think I would prefer that, though I've not tried it. Or at least I think it would be clearer. |
Firstly, the
{Shared,Local}CrateContext
hasn't been meaningful for a while now, and this PR resolves it by moving all their fields toCrateContext
and removing redundant accessor methods.Secondly, this PR contains the following mass-renames:
ccx: CrateContext
->cx: CodegenCx
mircx: MirContext
->fx: FunctionCx
bcx: Builder
->bx: Builder
r? @nikomatsakis