File tree Expand file tree Collapse file tree 2 files changed +4
-29
lines changed 
compiler/rustc_lint_defs/src Expand file tree Collapse file tree 2 files changed +4
-29
lines changed Original file line number Diff line number Diff line change @@ -2389,37 +2389,11 @@ declare_lint! {
23892389} 
23902390
23912391declare_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. 
24182395     /// 
24192396     /// [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 
24232397     /// [future-incompatible]: ../index.md#future-incompatible-lints 
24242398     pub  SOFT_UNSTABLE , 
24252399    Deny , 
Original file line number Diff line number Diff line change @@ -306,6 +306,7 @@ impl<'a> LintExtractor<'a> {
306306        if  matches ! ( 
307307            lint. name. as_str( ) , 
308308            "unused_features"  // broken lint 
309+             | "soft_unstable"  // cannot have a stable example 
309310        )  { 
310311            return  Ok ( ( ) ) ; 
311312        } 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments