-   Notifications  You must be signed in to change notification settings 
- Fork 13.9k
Closed
Labels
E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.fixed-by-NLLBugs fixed, but only when NLL is enabled.Bugs fixed, but only when NLL is enabled.
Description
#![feature(thread_local)] #[thread_local] static S: &str = "before"; fn set_s() { S = "after"; } fn main() { println!("{}", S); set_s(); println!("{}", S); }On rustc 1.31.0-nightly (b2d6ea9 2018-10-07) and x86_64-unknown-linux-gnu, we see the following surprising behavior:
$ cargo run # as expected before after $ cargo run --release before beforeIn release mode it seems the write has not happened in the place that it should.
Mentioning thread_local tracking issue: rust-lang/rust#29594.
Metadata
Metadata
Assignees
Labels
E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.fixed-by-NLLBugs fixed, but only when NLL is enabled.Bugs fixed, but only when NLL is enabled.