File tree 2 files changed +4
-29
lines changed
compiler/rustc_lint_defs/src
2 files changed +4
-29
lines changed Original file line number Diff line number Diff line change @@ -2389,37 +2389,11 @@ declare_lint! {
2389
2389
}
2390
2390
2391
2391
declare_lint ! {
2392
- /// The `soft_unstable` lint detects unstable features that were
2393
- /// unintentionally allowed on stable.
2394
- ///
2395
- /// ### Example
2396
- ///
2397
- /// ```rust,compile_fail
2398
- /// #[cfg(test)]
2399
- /// extern crate test;
2400
- ///
2401
- /// #[bench]
2402
- /// fn name(b: &mut test::Bencher) {
2403
- /// b.iter(|| 123)
2404
- /// }
2405
- /// ```
2406
- ///
2407
- /// {{produces}}
2408
- ///
2409
- /// ### Explanation
2410
- ///
2411
- /// The [`bench` attribute] was accidentally allowed to be specified on
2412
- /// the [stable release channel]. Turning this to a hard error would have
2413
- /// broken some projects. This lint allows those projects to continue to
2414
- /// build correctly when [`--cap-lints`] is used, but otherwise signal an
2415
- /// error that `#[bench]` should not be used on the stable channel. This
2416
- /// is a [future-incompatible] lint to transition this to a hard error in
2417
- /// the future. See [issue #64266] for more details.
2392
+ /// The `soft_unstable` lint detects unstable features that were unintentionally allowed on
2393
+ /// stable. This is a [future-incompatible] lint to transition this to a hard error in the
2394
+ /// future. See [issue #64266] for more details.
2418
2395
///
2419
2396
/// [issue #64266]: https://github.com/rust-lang/rust/issues/64266
2420
- /// [`bench` attribute]: https://doc.rust-lang.org/nightly/unstable-book/library-features/test.html
2421
- /// [stable release channel]: https://doc.rust-lang.org/book/appendix-07-nightly-rust.html
2422
- /// [`--cap-lints`]: https://doc.rust-lang.org/rustc/lints/levels.html#capping-lints
2423
2397
/// [future-incompatible]: ../index.md#future-incompatible-lints
2424
2398
pub SOFT_UNSTABLE ,
2425
2399
Deny ,
Original file line number Diff line number Diff line change @@ -306,6 +306,7 @@ impl<'a> LintExtractor<'a> {
306
306
if matches ! (
307
307
lint. name. as_str( ) ,
308
308
"unused_features" // broken lint
309
+ | "soft_unstable" // cannot have a stable example
309
310
) {
310
311
return Ok ( ( ) ) ;
311
312
}
You can’t perform that action at this time.
0 commit comments