This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
compiler/rustc_lint_defs/src Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -495,6 +495,39 @@ declare_lint! {
495
495
"unrecognized lint attribute"
496
496
}
497
497
498
+ declare_lint ! {
499
+ /// The `unfulfilled_lint_expectations` lint detects lint trigger expectations
500
+ /// that have not been fulfilled.
501
+ ///
502
+ /// ### Example
503
+ ///
504
+ /// ```rust
505
+ /// #![feature(lint_reasons)]
506
+ ///
507
+ /// #[expect(unused_variables)]
508
+ /// let x = 10;
509
+ /// println!("{}", x);
510
+ /// ```
511
+ ///
512
+ /// {{produces}}
513
+ ///
514
+ /// ### Explanation
515
+ ///
516
+ /// It was expected that the marked code would emit a lint. This expectation
517
+ /// has not been fulfilled.
518
+ ///
519
+ /// The `expect` attribute can be removed if this is intended behavior otherwise
520
+ /// it should be investigated why the expected lint is no longer issued.
521
+ ///
522
+ /// Part of RFC 2383. The progress is being tracked in [#54503]
523
+ ///
524
+ /// [#54503]: https://github.com/rust-lang/rust/issues/54503
525
+ pub UNFULFILLED_LINT_EXPECTATIONS ,
526
+ Warn ,
527
+ "unfulfilled lint expectation" ,
528
+ @feature_gate = rustc_span:: sym:: lint_reasons;
529
+ }
530
+
498
531
declare_lint ! {
499
532
/// The `unused_variables` lint detects variables which are not used in
500
533
/// any way.
@@ -3007,6 +3040,7 @@ declare_lint_pass! {
3007
3040
UNUSED_CRATE_DEPENDENCIES ,
3008
3041
UNUSED_QUALIFICATIONS ,
3009
3042
UNKNOWN_LINTS ,
3043
+ UNFULFILLED_LINT_EXPECTATIONS ,
3010
3044
UNUSED_VARIABLES ,
3011
3045
UNUSED_ASSIGNMENTS ,
3012
3046
DEAD_CODE ,
You can’t perform that action at this time.
0 commit comments