Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#120181 - dtolnay:tlconst, r=thomcc Allow any `const` expression blocks in `thread_local!` This PR contains a rebase of the macro change from rust-lang#116392, together with adding a test under library/std/tests. Testing this feature by making the documentation's example code needlessly more complicated was not appropriate as pointed out in rust-lang#116392 (review). Without the macro change, this new test would fail to build as follows: ```console error: no rules expected the token `let` --> library/std/tests/thread.rs:26:13 | 26 | let value = 1; | ^^^ no rules expected this token in macro call | note: while trying to match meta-variable `$init:expr` --> library/std/src/thread/local.rs:189:69 | 189 | ($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = const { $init:expr }; $($rest:tt)*) => ( | ^^^^^^^^^^ ``` Closes rust-lang#116392.
- Loading branch information