Skip to content

refactor(rustc_middle): Substs -> GenericArg #113591

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

Merged
merged 1 commit into from
Jul 14, 2023

Conversation

mdibaiee
Copy link
Contributor

@mdibaiee mdibaiee commented Jul 11, 2023

resolves #110793

  • rename SubstsRef and InternalSubsts to GenericArgsRef<'tcx> and GenericArgs<'tcx>.
  • rename variables and fields currently using substs to args.
  • 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.
  • rename EarlyBinder::subst(_identity) to EarlyBinder::instantiate(_identity).
  • types called [a-zA-Z]+Substs renamed to XArgs.
  • 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 #110254 to change the verb to replace_generics or something similar.

@rustbot
Copy link
Collaborator

rustbot commented Jul 11, 2023

r? @oli-obk

(rustbot has picked a reviewer for you, use r? to override)

@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. labels Jul 11, 2023
@rust-log-analyzer

This comment has been minimized.

@mdibaiee
Copy link
Contributor Author

@rustbot label -S-waiting-on-review +S-waiting-on-author

@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 Jul 11, 2023
@mdibaiee
Copy link
Contributor Author

r? ghost

@rustbot
Copy link
Collaborator

rustbot commented Jul 11, 2023

Failed to set assignee to ghost: invalid assignee

Note: Only org members, users with write permissions, or people who have commented on the PR may be assigned.

@mdibaiee mdibaiee force-pushed the genericargs-cleanup branch from f4449f8 to 054053f Compare July 11, 2023 22:02
@rust-log-analyzer

This comment has been minimized.

@mdibaiee mdibaiee force-pushed the genericargs-cleanup branch from 054053f to e471156 Compare July 11, 2023 22:26
@mdibaiee mdibaiee closed this Jul 11, 2023
@rust-log-analyzer

This comment has been minimized.

@mdibaiee mdibaiee reopened this Jul 12, 2023
@rustbot rustbot added the WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) label Jul 12, 2023
@mdibaiee mdibaiee force-pushed the genericargs-cleanup branch from 0e81e7e to 1bffadb Compare July 12, 2023 16:06
@rust-log-analyzer

This comment has been minimized.

@mdibaiee mdibaiee force-pushed the genericargs-cleanup branch from 1bffadb to c12b730 Compare July 12, 2023 16:11
@rustbot rustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-style Relevant to the style team, which will review and decide on the PR/issue. labels Jul 12, 2023
@mdibaiee mdibaiee force-pushed the genericargs-cleanup branch 2 times, most recently from 13eee97 to 0095115 Compare July 12, 2023 16:16
@rust-log-analyzer

This comment has been minimized.

@mdibaiee mdibaiee force-pushed the genericargs-cleanup branch 2 times, most recently from 3276d69 to 074f279 Compare July 12, 2023 16:42
@rust-log-analyzer

This comment has been minimized.

@mdibaiee mdibaiee force-pushed the genericargs-cleanup branch from 074f279 to 3665033 Compare July 12, 2023 16:57
@rust-log-analyzer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5767cad): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.3%, 0.4%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.3% [-4.2%, -2.3%] 3
All ❌✅ (primary) - - 0

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.5% [1.5%, 4.6%] 7
Regressions ❌
(secondary)
5.9% [5.9%, 5.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.5% [1.5%, 4.6%] 7

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 659.454s -> 657.557s (-0.29%)

mdibaiee added a commit to mdibaiee/rustc-dev-guide that referenced this pull request Jul 14, 2023
tshepang pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Jul 15, 2023
Nadrieril added a commit to Nadrieril/hax that referenced this pull request May 22, 2024
Kobzol pushed a commit to Kobzol/rust that referenced this pull request Dec 30, 2024
bors pushed a commit to rust-lang-ci/rust that referenced this pull request Jan 2, 2025
Kobzol pushed a commit to Kobzol/rustc-dev-guide that referenced this pull request Jan 3, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-style Relevant to the style team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update internal terminology: Substs -> GenericArgs
10 participants