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

Disallow hidden references to mutable static #124895

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

obeis
Copy link
Contributor

@obeis obeis commented May 8, 2024

@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 May 8, 2024
@RalfJung
Copy link
Member

RalfJung commented May 8, 2024

Sorry, I can only review interpreter and Miri PRs.

r? compiler

@rustbot rustbot assigned fee1-dead and unassigned RalfJung May 8, 2024
@obeis
Copy link
Contributor Author

obeis commented May 8, 2024

r? @davidtwco

@rustbot rustbot assigned davidtwco and unassigned fee1-dead May 8, 2024
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels May 8, 2024
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@obeis obeis marked this pull request as draft May 8, 2024 19:05
@davidtwco davidtwco 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 May 10, 2024
@davidtwco
Copy link
Member

Marking as waiting on author since you've made this a draft.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@obeis obeis marked this pull request as ready for review May 11, 2024 16:36
@rustbot
Copy link
Collaborator

rustbot commented May 11, 2024

The Miri subtree was changed

cc @rust-lang/miri

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@obeis
Copy link
Contributor Author

obeis commented May 11, 2024

@rustbot ready

@michaelwoerister
Copy link
Member

r? @compiler-errors -- I'm not a good reviewer for this other than the basics.

@bors
Copy link
Contributor

bors commented Sep 13, 2024

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

@obeis
Copy link
Contributor Author

obeis commented Sep 13, 2024

@compiler-errors Done.

@compiler-errors
Copy link
Member

I'd personally rather we try to make this lint a bit less trigger-prone if possible. I'd be fine even if we implement it only for totally unconstrained late-bound receiver lifetimes where the lifetime does not show up in the return type or something like that.

I don't think this actually ever got fixed, but whatever.

@bors r+

@bors
Copy link
Contributor

bors commented Sep 20, 2024

📌 Commit 3b0ce1b has been approved by compiler-errors

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 Sep 20, 2024
@bors
Copy link
Contributor

bors commented Sep 20, 2024

⌛ Testing commit 3b0ce1b with merge 5ba6db1...

@bors
Copy link
Contributor

bors commented Sep 20, 2024

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing 5ba6db1 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 20, 2024
@bors bors merged commit 5ba6db1 into rust-lang:master Sep 20, 2024
7 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Sep 20, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5ba6db1): 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)
1.1% [1.1%, 1.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary -1.8%)

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)
-1.8% [-1.8%, -1.8%] 1
All ❌✅ (primary) - - 0

Cycles

Results (secondary 7.1%)

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)
7.1% [7.1%, 7.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 767.803s -> 768.593s (0.10%)
Artifact size: 341.28 MiB -> 341.36 MiB (0.02%)

@obeis obeis deleted the static-mut-hidden-ref branch September 21, 2024 07:42
ehuss added a commit to ehuss/edition-guide that referenced this pull request Sep 21, 2024
github-merge-queue bot pushed a commit to model-checking/kani that referenced this pull request Sep 24, 2024
Changes required due to:
- rust-lang/rust#130593 Sync from rustfmt
- rust-lang/rust#124895 Disallow hidden
references to mutable static

With the exception of changes to `rust-toolchain.toml`, `rustfmt.toml`,
and `library/kani/src/futures.rs` all changes were automatically created
by running `scripts/kani-fmt.sh`.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 24, 2024
…ler-errors

Disallow hidden references to mutable static

Closes rust-lang#123060

Tracking:
- rust-lang#123758
@jieyouxu jieyouxu added the CI-spurious-fail-msvc CI spurious failure: target env msvc label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-edition-2024 Area: The 2024 edition A-testsuite Area: The testsuite used to check the correctness of rustc CI-spurious-fail-msvc CI spurious failure: target env msvc merged-by-bors This PR was explicitly merged by bors. O-wasm Target: WASM (WebAssembly), http://webassembly.org/ 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

static_mut_refs: Should the lint cover hidden references?