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

Tracking issue for dejargonification #110254

Open
1 of 6 tasks
oli-obk opened this issue Apr 12, 2023 · 2 comments
Open
1 of 6 tasks

Tracking issue for dejargonification #110254

oli-obk opened this issue Apr 12, 2023 · 2 comments
Assignees
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself C-cleanup Category: PRs that clean code up or issues documenting cleanup. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Apr 12, 2023

There are some things in rustc that are named historically or just really oddly. This issue tracks renaming them to reflect what they are without having to understand Rust's history and/or programming language design/theory jargon.

  • Region -> Lifetime in general. While Region kinda makes more sense, we use Lifetime in the language
  • EarlyBoundRegion -> GenericLifetime (to reflect what they are in the language)
  • LateBoundRegion ->HigherRankedLifetime (")
  • *Folder and fold_* -> *Replacer and replace_*
  • update internal terminology: Substs -> GenericArgs #110793
  • subst -> replace_generics

These changes have an accepted MCP at rust-lang/compiler-team#451

Note: please do not pick up any of these work items without first checking in with me. These renamings aren't universally liked and we should make sure everyone stays on board.

I'm not gonna move on these things quickly, and I'm fine closing PRs even after putting in lotsa work. So if anyone has concerns, please raise them on a zulip thread or directly with me.

@oli-obk oli-obk added C-cleanup Category: PRs that clean code up or issues documenting cleanup. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. labels Apr 12, 2023
@oli-obk oli-obk self-assigned this Apr 12, 2023
@lqd
Copy link
Member

lqd commented Apr 12, 2023

Maybe we can also finally pick one of "free region" vs "universal region", or something else t-types would prefer. (IIRC sometimes there's even both names used in the same function :)

@Noratrieb
Copy link
Member

If you want to discuss the naming, use this zulip thread instead: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/naming.20bikeshedding

@jyn514 jyn514 added E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself T-types Relevant to the types team, which will review and decide on the PR/issue. labels Apr 13, 2023
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 14, 2023
refactor(rustc_middle): Substs -> GenericArg

resolves rust-lang#110793

- [x] rename `SubstsRef` and `InternalSubsts` to `GenericArgsRef<'tcx>` and `GenericArgs<'tcx>`.
- [x] rename variables and fields currently using `substs` to `args`.
- [x] update the module name of `ty::subst` to `ty::generic_args` or sth. Make that module private and publicly reexport its content in the ty module.
- [x] rename `EarlyBinder::subst(_identity)` to `EarlyBinder::instantiate(_identity)`.
- [x] types called `[a-zA-Z]+Substs` renamed to `XArgs`.
- [x] functions containing `substs` now use `args` or `generic_args` (mostly the former).

However, the verb of "substituting" is still being used here and there, mostly in comments. I think that can be a separate PR as part of rust-lang#110254 to change the verb to `replace_generics` or something similar.
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Jul 16, 2023
refactor(rustc_middle): Substs -> GenericArg

resolves #110793

- [x] rename `SubstsRef` and `InternalSubsts` to `GenericArgsRef<'tcx>` and `GenericArgs<'tcx>`.
- [x] rename variables and fields currently using `substs` to `args`.
- [x] update the module name of `ty::subst` to `ty::generic_args` or sth. Make that module private and publicly reexport its content in the ty module.
- [x] rename `EarlyBinder::subst(_identity)` to `EarlyBinder::instantiate(_identity)`.
- [x] types called `[a-zA-Z]+Substs` renamed to `XArgs`.
- [x] functions containing `substs` now use `args` or `generic_args` (mostly the former).

However, the verb of "substituting" is still being used here and there, mostly in comments. I think that can be a separate PR as part of rust-lang/rust#110254 to change the verb to `replace_generics` or something similar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself C-cleanup Category: PRs that clean code up or issues documenting cleanup. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants