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

Nightly 2021-03-24 claims that the feature unsafe_block_in_unsafe_fn was stabilized in 1.51, but stable 1.51 claims that the lint unsafe_op_in_unsafe_fn is still unstable #83735

Closed
PatchMixolydic opened this issue Apr 1, 2021 · 2 comments · Fixed by #83736
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. F-unsafe-block-in-unsafe-fn RFC #2585 T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@PatchMixolydic
Copy link
Contributor

PatchMixolydic commented Apr 1, 2021

I tried this code on nightly Rust:

#![feature(unsafe_block_in_unsafe_fn)]
#![deny(unsafe_op_in_unsafe_fn)]

fn main() {}

This produced a warning claiming that unsafe_block_in_unsafe_fn was stabilized in 1.51:

patchmixolydic@blue-pearl /tmp/rust-issue → cargo +nightly run
   Compiling rust-issue v0.1.0 (/tmp/rust-issue)
warning: the feature `unsafe_block_in_unsafe_fn` has been stable since 1.51.0 and no longer requires an attribute to enable
 --> src/main.rs:1:12
  |
1 | #![feature(unsafe_block_in_unsafe_fn)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(stable_features)]` on by default

warning: 1 warning emitted

I removed the feature gate and tried compiling the code on Rust 1.51.0:

#![deny(unsafe_op_in_unsafe_fn)]

fn main() {}

However, this led to an error claiming that unsafe_op_in_unsafe_fn is unstable:

patchmixolydic@blue-pearl /tmp/rust-issue → cargo run
   Compiling rust-issue v0.1.0 (/tmp/rust-issue)
error[E0658]: the `unsafe_op_in_unsafe_fn` lint is unstable
 --> src/main.rs:1:1
  |
1 | #![deny(unsafe_op_in_unsafe_fn)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #71668 <https://github.com/rust-lang/rust/issues/71668> for more information

error: aborting due to previous error

Meta

rustc --version --verbose:

rustc 1.51.0 (2fd73fabe 2021-03-23)
binary: rustc
commit-hash: 2fd73fabe469357a12c2c974c140f67e7cdd76d0
commit-date: 2021-03-23
host: x86_64-unknown-linux-gnu
release: 1.51.0
LLVM version: 11.0.1

rustc +nightly --version --verbose:

rustc 1.53.0-nightly (07e0e2ec2 2021-03-24)
binary: rustc
commit-hash: 07e0e2ec268c140e607e1ac7f49f145612d0f597
commit-date: 2021-03-24
host: x86_64-unknown-linux-gnu
release: 1.53.0-nightly
LLVM version: 12.0.0

@rustbot modify labels: +A-diagnostics +D-incorrect +F-unsafe-block-in-unsafe-fn

@PatchMixolydic PatchMixolydic added the C-bug Category: This is a bug. label Apr 1, 2021
@rustbot rustbot added A-diagnostics Area: Messages for errors, warnings, and lints D-incorrect Diagnostics: A diagnostic that is giving misleading or incorrect information. F-unsafe-block-in-unsafe-fn RFC #2585 labels Apr 1, 2021
@PatchMixolydic
Copy link
Contributor Author

According to the milestone on the stabilization PR (#79208), this feature will be stabilized in 1.52, but the PR wasn't updated to account for this.

@JohnTitor JohnTitor added A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed A-diagnostics Area: Messages for errors, warnings, and lints D-incorrect Diagnostics: A diagnostic that is giving misleading or incorrect information. labels Apr 1, 2021
@JohnTitor
Copy link
Member

Thanks for the report, yeah, the stabilized version should be wrong. Submitted #83736 as a fix.

@bors bors closed this as completed in 49e1ec0 Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. F-unsafe-block-in-unsafe-fn RFC #2585 T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants