-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Unexpected behaviour of const atomics #146644
Copy link
Copy link
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=139b1c685d63e315c4e7140bcfc6694f
I expected to see this happen:
Either fail to compile, or compile with warning, or print
ATOMIC_BOOL == falseInstead, this happened:
Compiled without any warnings, output is
ATOMIC_BOOL == false, which is unexpected.Meta
rustc --version --verbose:P.S. There is a Clippy lint about this, but I believe that it should be a rustc warning instead.