about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-09-06 00:14:41 +0000
committerbors <bors@rust-lang.org>2021-09-06 00:14:41 +0000
commit8f3aa5e8b9e176e8a5fff81a681eba1805366e3d (patch)
tree9aff1d58e6d28e96d4d10d8f9dbebf569f66faf9 /src/tools
parent7849e3e9dda60e8ec826ee245c6b180e73911b37 (diff)
parentca27f03ca8862344567dcc1e6ec01f29442835fa (diff)
downloadrust-8f3aa5e8b9e176e8a5fff81a681eba1805366e3d.tar.gz
rust-8f3aa5e8b9e176e8a5fff81a681eba1805366e3d.zip
Auto merge of #88493 - chenyukang:fix-duplicated-diagnostic, r=estebank
Fix #88256 remove duplicated diagnostics

Fix #88256
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/clippy/tests/ui/match_same_arms.stderr20
-rw-r--r--src/tools/clippy/tests/ui/modulo_one.stderr8
-rw-r--r--src/tools/clippy/tests/ui/suspicious_operation_groupings.stderr8
-rw-r--r--src/tools/rustfmt/src/syntux/session.rs1
4 files changed, 4 insertions, 33 deletions
diff --git a/src/tools/clippy/tests/ui/match_same_arms.stderr b/src/tools/clippy/tests/ui/match_same_arms.stderr
index e48451acfe8..7752a8a6ff2 100644
--- a/src/tools/clippy/tests/ui/match_same_arms.stderr
+++ b/src/tools/clippy/tests/ui/match_same_arms.stderr
@@ -107,24 +107,6 @@ LL |         1 => 2,
    = help: ...or consider changing the match arm bodies
 
 error: this `match` has identical arm bodies
-  --> $DIR/match_same_arms.rs:33:14
-   |
-LL |         3 => 2, //~ ERROR 3rd matched arms have same body
-   |              ^
-   |
-note: same as this
-  --> $DIR/match_same_arms.rs:32:14
-   |
-LL |         2 => 2, //~ ERROR 2nd matched arms have same body
-   |              ^
-help: consider refactoring into `2 | 3`
-  --> $DIR/match_same_arms.rs:32:9
-   |
-LL |         2 => 2, //~ ERROR 2nd matched arms have same body
-   |         ^
-   = help: ...or consider changing the match arm bodies
-
-error: this `match` has identical arm bodies
   --> $DIR/match_same_arms.rs:50:55
    |
 LL |                 CommandInfo::External { name, .. } => name.to_string(),
@@ -142,5 +124,5 @@ LL |                 CommandInfo::BuiltIn { name, .. } => name.to_string(),
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: ...or consider changing the match arm bodies
 
-error: aborting due to 8 previous errors
+error: aborting due to 7 previous errors
 
diff --git a/src/tools/clippy/tests/ui/modulo_one.stderr b/src/tools/clippy/tests/ui/modulo_one.stderr
index 2b2c6997338..34f762bbb92 100644
--- a/src/tools/clippy/tests/ui/modulo_one.stderr
+++ b/src/tools/clippy/tests/ui/modulo_one.stderr
@@ -46,12 +46,6 @@ LL |     const ONE: u32 = 1 * 1;
    |
    = note: `-D clippy::identity-op` implied by `-D warnings`
 
-error: the operation is ineffective. Consider reducing it to `1`
-  --> $DIR/modulo_one.rs:13:22
-   |
-LL |     const ONE: u32 = 1 * 1;
-   |                      ^^^^^
-
 error: any number modulo 1 will be 0
   --> $DIR/modulo_one.rs:17:5
    |
@@ -70,5 +64,5 @@ error: any number modulo -1 will panic/overflow or result in 0
 LL |     INT_MIN % NEG_ONE; // also caught by rustc
    |     ^^^^^^^^^^^^^^^^^
 
-error: aborting due to 11 previous errors
+error: aborting due to 10 previous errors
 
diff --git a/src/tools/clippy/tests/ui/suspicious_operation_groupings.stderr b/src/tools/clippy/tests/ui/suspicious_operation_groupings.stderr
index 96065699d32..dd6f2f6641d 100644
--- a/src/tools/clippy/tests/ui/suspicious_operation_groupings.stderr
+++ b/src/tools/clippy/tests/ui/suspicious_operation_groupings.stderr
@@ -7,12 +7,6 @@ LL |         self.x == other.y && self.y == other.y && self.z == other.z
    = note: `-D clippy::suspicious-operation-groupings` implied by `-D warnings`
 
 error: this sequence of operators looks suspiciously like a bug
-  --> $DIR/suspicious_operation_groupings.rs:14:9
-   |
-LL |         self.x == other.y && self.y == other.y && self.z == other.z
-   |         ^^^^^^^^^^^^^^^^^ help: did you mean: `self.x == other.x`
-
-error: this sequence of operators looks suspiciously like a bug
   --> $DIR/suspicious_operation_groupings.rs:27:20
    |
 LL |     s1.a < s2.a && s1.a < s2.b
@@ -162,5 +156,5 @@ error: this sequence of operators looks suspiciously like a bug
 LL |     -(if -s1.a < -s2.a && -s1.a < -s2.b { s1.c } else { s2.a })
    |                           ^^^^^^^^^^^^^ help: did you mean: `-s1.b < -s2.b`
 
-error: aborting due to 27 previous errors
+error: aborting due to 26 previous errors
 
diff --git a/src/tools/rustfmt/src/syntux/session.rs b/src/tools/rustfmt/src/syntux/session.rs
index 870f0acfe39..2965b0928aa 100644
--- a/src/tools/rustfmt/src/syntux/session.rs
+++ b/src/tools/rustfmt/src/syntux/session.rs
@@ -311,6 +311,7 @@ mod tests {
                 suggestions: vec![],
                 span: span.unwrap_or_else(MultiSpan::new),
                 sort_span: DUMMY_SP,
+                is_lint: false,
             }
         }