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

Avoid some interning in bootstrap #121567

Merged
merged 1 commit into from
Mar 10, 2024
Merged

Conversation

Noratrieb
Copy link
Member

This interning is pointless and only makes the code more complex.

The only remaining use of interning is TargetSelection, for which I left a comment.

@rustbot
Copy link
Collaborator

rustbot commented Feb 24, 2024

r? @albertlarsan68

rustbot has assigned @albertlarsan68.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot
Copy link
Collaborator

rustbot commented Feb 24, 2024

This PR modifies src/bootstrap/src/core/config.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Feb 24, 2024
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@@ -457,6 +457,8 @@ impl std::str::FromStr for RustcLto {
}

#[derive(Copy, Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
// N.B.: This type is used everywhere, and the entire codebase relies on it being Copy.
// Making !Copy is highly nontrivial!
pub struct TargetSelection {
pub triple: Interned<String>,
file: Option<Interned<String>>,
Copy link
Member

Choose a reason for hiding this comment

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

Maybe use &'static str here by leaking the strings using Box::leak? There should only be a handful of unique TargetSelections anyway.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Feb 25, 2024

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

@rust-log-analyzer

This comment has been minimized.

This interning is pointless and only makes the code more complex.

The only remaining use of interning is `TargetSelection`, for which I
left a comment.
@albertlarsan68
Copy link
Member

Thanks for the PR!
@bors r+

@bors
Copy link
Contributor

bors commented Mar 9, 2024

📌 Commit fbb97ed has been approved by albertlarsan68

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 Mar 9, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 9, 2024
…larsan68

Avoid some interning in bootstrap

This interning is pointless and only makes the code more complex.

The only remaining use of interning is `TargetSelection`, for which I left a comment.
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 9, 2024
…iaskrgr

Rollup of 11 pull requests

Successful merges:

 - rust-lang#121567 (Avoid some interning in bootstrap)
 - rust-lang#121813 (Misc improvements to non local defs lint implementation)
 - rust-lang#121860 (Add a tidy check that checks whether the fluent slugs only appear once)
 - rust-lang#121907 (skip sanity check for non-host targets in `check` builds)
 - rust-lang#122160 (Eagerly translate `HelpUseLatestEdition` in parser diagnostics)
 - rust-lang#122178 (ci: add a runner for vanilla LLVM 18)
 - rust-lang#122186 (Remove a workaround for a bug)
 - rust-lang#122187 (Move metadata header and version checks together)
 - rust-lang#122215 (Some tweaks to the parallel query cycle handler)
 - rust-lang#122223 (Fix typo in `VisitorResult`)
 - rust-lang#122232 (library/core: fix a comment, and a cfg(miri) warning)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 9, 2024
…larsan68

Avoid some interning in bootstrap

This interning is pointless and only makes the code more complex.

The only remaining use of interning is `TargetSelection`, for which I left a comment.
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 10, 2024
…iaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#121561 (Detect typos for compiletest test directives)
 - rust-lang#121567 (Avoid some interning in bootstrap)
 - rust-lang#121685 (Fixing shellcheck comments on lvi test script)
 - rust-lang#121833 (Suggest correct path in include_bytes!)
 - rust-lang#121860 (Add a tidy check that checks whether the fluent slugs only appear once)
 - rust-lang#121907 (skip sanity check for non-host targets in `check` builds)
 - rust-lang#122029 (When displaying multispans, ignore empty lines adjacent to `...`)
 - rust-lang#122221 (match lowering: define a convenient struct)
 - rust-lang#122244 (fix: LocalWaker memory leak and some stability attributes)
 - rust-lang#122251 (Add test to check unused_lifetimes don't duplicate "parameter is never used" error)

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

Rollup of 14 pull requests

Successful merges:

 - rust-lang#112136 (Add std::ffi::c_str module)
 - rust-lang#113525 (Dynamically size sigaltstk in std)
 - rust-lang#121567 (Avoid some interning in bootstrap)
 - rust-lang#121642 (Update a test to support Symbol Mangling V0)
 - rust-lang#121685 (Fixing shellcheck comments on lvi test script)
 - rust-lang#121860 (Add a tidy check that checks whether the fluent slugs only appear once)
 - rust-lang#121942 (std::rand: enable getrandom for dragonflybsd too.)
 - rust-lang#122125 (Revert back to Git-for-Windows for MinGW CI builds)
 - rust-lang#122221 (match lowering: define a convenient struct)
 - rust-lang#122244 (fix: LocalWaker memory leak and some stability attributes)
 - rust-lang#122251 (Add test to check unused_lifetimes don't duplicate "parameter is never used" error)
 - rust-lang#122264 (add myself to rotation)
 - rust-lang#122269 (doc/rustc: Move loongarch64-unknown-linux-musl to Tier 3)
 - rust-lang#122271 (Fix legacy numeric constant diag items)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0f89fae into rust-lang:master Mar 10, 2024
11 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Mar 10, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 10, 2024
Rollup merge of rust-lang#121567 - Nilstrieb:less-interning, r=albertlarsan68

Avoid some interning in bootstrap

This interning is pointless and only makes the code more complex.

The only remaining use of interning is `TargetSelection`, for which I left a comment.
@Noratrieb Noratrieb deleted the less-interning branch March 10, 2024 14:59
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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants