Skip to content

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

Description

@PatchMixolydic

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.F-unsafe-block-in-unsafe-fnRFC #2585T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions