-
Notifications
You must be signed in to change notification settings - Fork 13.3k
cfg!(unsafe(foo))
and --check-cfg=unsafe(cfg(foo))
are erroneously accepted on beta
#131055
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Labels
C-bug
Category: This is a bug.
regression-from-stable-to-beta
Performance or correctness regression from stable to beta.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone
Comments
|
@Noratrieb except that neither
|
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Sep 30, 2024
Reject leading unsafe in `cfg!(...)` and `--check-cfg` This PR reject leading unsafe in `cfg!(...)` and `--check-cfg`. Fixes (after-backport) rust-lang#131055 r? `@jieyouxu`
makes sense |
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Sep 30, 2024
Rollup merge of rust-lang#131057 - Urgau:cfg-erronous-unsafe, r=jieyouxu Reject leading unsafe in `cfg!(...)` and `--check-cfg` This PR reject leading unsafe in `cfg!(...)` and `--check-cfg`. Fixes (after-backport) rust-lang#131055 r? `@jieyouxu`
Merged
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Oct 11, 2024
[beta] backports - Only add an automatic SONAME for Rust dylibs rust-lang#130960 - Reject leading unsafe in `cfg!(...)` and `--check-cfg` rust-lang#131057, resolving rust-lang#131055 - Disable jump threading `UnOp::Not` for non-bool rust-lang#131201 - Update LLVM submodule rust-lang#131448 r? ghost
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Oct 11, 2024
[beta] backports - Only add an automatic SONAME for Rust dylibs rust-lang#130960 - Reject leading unsafe in `cfg!(...)` and `--check-cfg` rust-lang#131057, resolving rust-lang#131055 - Disable jump threading `UnOp::Not` for non-bool rust-lang#131201 - Update LLVM submodule rust-lang#131448 r? ghost
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Oct 12, 2024
[beta] backports - Only add an automatic SONAME for Rust dylibs rust-lang#130960 - Reject leading unsafe in `cfg!(...)` and `--check-cfg` rust-lang#131057, resolving rust-lang#131055 - Disable jump threading `UnOp::Not` for non-bool rust-lang#131201 - Update LLVM submodule rust-lang#131448 r? ghost
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Oct 12, 2024
[beta] backports - Only add an automatic SONAME for Rust dylibs rust-lang#130960 - Reject leading unsafe in `cfg!(...)` and `--check-cfg` rust-lang#131057, resolving rust-lang#131055 - Disable jump threading `UnOp::Not` for non-bool rust-lang#131201 - Update LLVM submodule rust-lang#131448 - Split x86_64-msvc-ext into two jobs rust-lang#130072 - Use a small runner for msvc-ext2 job rust-lang#130151 r? ghost
Backported in #131423, closing. |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
C-bug
Category: This is a bug.
regression-from-stable-to-beta
Performance or correctness regression from stable to beta.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
cfg!(unsafe(foo))
and--check-cfg=unsafe(cfg(foo))
both are erroneously accepted on beta.They should not be accepted, neither of them is in any way "unsafe".
Code
I tried this code:
I expected to see this happen: an error saying that
unsafe
cannot be put here like for#[cfg]
&#[cfg_attr]
.Instead, this happened: the
unsafe
is silently accepted.Version it worked on
It most recently worked on: 1.81
Version with regression
rustc --version --verbose
:@rustbot modify labels: +regression-from-stable-to-beta -regression-untriaged
The text was updated successfully, but these errors were encountered: