about summary refs log tree commit diff
path: root/compiler/rustc_lint/src/expect.rs
diff options
context:
space:
mode:
authorxFrednet <xFrednet@gmail.com>2021-08-06 23:38:09 +0200
committerxFrednet <xFrednet@gmail.com>2022-03-02 17:46:08 +0100
commita9bf9eaef5165067414b33777a2c924e42aab5aa (patch)
tree923db2fe48114dbda3712924355b3aeaf518a7af /compiler/rustc_lint/src/expect.rs
parent33a5945069e2c7bd3ba8a0dd65b74ebdd234ad7c (diff)
downloadrust-a9bf9eaef5165067414b33777a2c924e42aab5aa.tar.gz
rust-a9bf9eaef5165067414b33777a2c924e42aab5aa.zip
Add UI tests for the `expect` attribute (RFC-2383)
* Add UI tests with macros for the `expect` attribute (RFC-2383)
* Addressed review comments - mostly UI test updates (RFC-2383)
* Documented lint level attribute on macro not working bug (RFC-2383)
  See `rust#87391`
Diffstat (limited to 'compiler/rustc_lint/src/expect.rs')
-rw-r--r--compiler/rustc_lint/src/expect.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_lint/src/expect.rs b/compiler/rustc_lint/src/expect.rs
index 49664322a98..db0756f5f54 100644
--- a/compiler/rustc_lint/src/expect.rs
+++ b/compiler/rustc_lint/src/expect.rs
@@ -16,11 +16,9 @@ pub fn check_expectations(tcx: TyCtxt<'_>) {
         &tcx.lint_levels(()).lint_expectations;
 
     for (id, expectation) in lint_expectations {
-        if fulfilled_expectations.contains(id) {
-            continue;
+        if !fulfilled_expectations.contains(id) {
+            emit_unfulfilled_expectation_lint(tcx, expectation);
         }
-
-        emit_unfulfilled_expectation_lint(tcx, expectation);
     }
 }