rustc_lint_defs::builtin

Static SOFT_UNSTABLE

Source
pub static SOFT_UNSTABLE: &Lint
Expand description

The soft_unstable lint detects unstable features that were unintentionally allowed on stable.

§Example

#[cfg(test)]
extern crate test;

#[bench]
fn name(b: &mut test::Bencher) {
    b.iter(|| 123)
}

{{produces}}

§Explanation

The bench attribute was accidentally allowed to be specified on the stable release channel. Turning this to a hard error would have broken some projects. This lint allows those projects to continue to build correctly when --cap-lints is used, but otherwise signal an error that #[bench] should not be used on the stable channel. This is a future-incompatible lint to transition this to a hard error in the future. See issue #64266 for more details.