-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Write to #[thread_local] is not respected #54901
Labels
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
fixed-by-NLL
Bugs fixed, but only when NLL is enabled.
Comments
Ah, apparently this is missing a #![feature(thread_local)]
#[thread_local]
static mut S: &str = "before";
fn set_s() {
unsafe { S = "after" };
}
fn main() {
println!("{}", unsafe { S });
set_s();
println!("{}", unsafe { S });
} $ cargo run --release
before
after |
6 tasks
cc @pnkfelix @nikomatsakis Did #55150 fix this by any chance? |
It looks like this is fixed on nightly; I'm guessing #55150 is the reason. We probably should add some regression tests for the cases listed here. |
pnkfelix
added
the
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
label
Nov 5, 2018
Centril
added a commit
to Centril/rust
that referenced
this issue
Jan 15, 2019
…tsakis Add a regression test for mutating a non-mut #[thread_local] This should close rust-lang#54901 since the regression has since been fixed.
Centril
added a commit
to Centril/rust
that referenced
this issue
Jan 17, 2019
…tsakis Add a regression test for mutating a non-mut #[thread_local] This should close rust-lang#54901 since the regression has since been fixed.
Centril
added a commit
to Centril/rust
that referenced
this issue
Jan 17, 2019
…tsakis Add a regression test for mutating a non-mut #[thread_local] This should close rust-lang#54901 since the regression has since been fixed.
Centril
added a commit
to Centril/rust
that referenced
this issue
Jan 17, 2019
…tsakis Add a regression test for mutating a non-mut #[thread_local] This should close rust-lang#54901 since the regression has since been fixed.
Centril
added a commit
to Centril/rust
that referenced
this issue
Jan 18, 2019
…tsakis Add a regression test for mutating a non-mut #[thread_local] This should close rust-lang#54901 since the regression has since been fixed.
Centril
added a commit
to Centril/rust
that referenced
this issue
Jan 18, 2019
…tsakis Add a regression test for mutating a non-mut #[thread_local] This should close rust-lang#54901 since the regression has since been fixed.
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Jan 18, 2019
…tsakis Add a regression test for mutating a non-mut #[thread_local] This should close rust-lang#54901 since the regression has since been fixed.
Centril
added a commit
to Centril/rust
that referenced
this issue
Jan 18, 2019
…tsakis Add a regression test for mutating a non-mut #[thread_local] This should close rust-lang#54901 since the regression has since been fixed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
fixed-by-NLL
Bugs fixed, but only when NLL is enabled.
On rustc 1.31.0-nightly (b2d6ea9 2018-10-07) and x86_64-unknown-linux-gnu, we see the following surprising behavior:
In release mode it seems the write has not happened in the place that it should.
Mentioning thread_local tracking issue: rust-lang/rust#29594.
The text was updated successfully, but these errors were encountered: