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

in nightly, std::thread_local! uses unreachable! where it needs to say $crate::unreachable! #95533

Closed
elidupree opened this issue Mar 31, 2022 · 1 comment
Labels
C-bug Category: This is a bug. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@elidupree
Copy link

Commit 36c9045 introduced two lines that say unreachable!(), which breaks this code (playground):

#![no_implicit_prelude]
::std::thread_local! {static Q: () = (); }

I believe they need to say $crate::unreachable! instead.

Also, if there isn't one already, we should create a regression test for this - #![no_implicit_prelude] seems easy to break by accident.

@elidupree elidupree added the C-bug Category: This is a bug. label Mar 31, 2022
niluxv added a commit to niluxv/rust that referenced this issue Apr 1, 2022
@dtolnay dtolnay added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Apr 1, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 1, 2022
Fix `thread_local!` macro to be compatible with `no_implicit_prelude`

Fixes issue  rust-lang#95533.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 1, 2022
Fix `thread_local!` macro to be compatible with `no_implicit_prelude`

Fixes issue  rust-lang#95533.
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Apr 2, 2022
Fix `thread_local!` macro to be compatible with `no_implicit_prelude`

Fixes issue  rust-lang#95533.
@niluxv
Copy link
Contributor

niluxv commented Apr 2, 2022

Fixed by #95557, now merged into master so this can be closed I think.

@dtolnay dtolnay closed this as completed Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants