Skip to content

Commit d426771

Browse files
committed
Address review comments
1 parent 8fd85db commit d426771

6 files changed

+113
-2
lines changed
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
warning: floating-point types cannot be used in patterns
2+
--> $DIR/deduplicate-diagnostics-2.rs:7:9
3+
|
4+
LL | 1.0 => {}
5+
| ^^^
6+
|
7+
= note: `#[warn(illegal_floating_point_literal_pattern)]` on by default
8+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
9+
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
10+
11+
warning: floating-point types cannot be used in patterns
12+
--> $DIR/deduplicate-diagnostics-2.rs:11:9
13+
|
14+
LL | 2.0 => {}
15+
| ^^^
16+
|
17+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
18+
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
19+
20+
warning: floating-point types cannot be used in patterns
21+
--> $DIR/deduplicate-diagnostics-2.rs:7:9
22+
|
23+
LL | 1.0 => {}
24+
| ^^^
25+
|
26+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
27+
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
28+
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
warning: floating-point types cannot be used in patterns
2+
--> $DIR/deduplicate-diagnostics-2.rs:7:9
3+
|
4+
LL | 1.0 => {}
5+
| ^^^
6+
|
7+
= note: `#[warn(illegal_floating_point_literal_pattern)]` on by default
8+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
9+
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
10+
11+
warning: floating-point types cannot be used in patterns
12+
--> $DIR/deduplicate-diagnostics-2.rs:11:9
13+
|
14+
LL | 2.0 => {}
15+
| ^^^
16+
|
17+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
18+
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
19+
20+
warning: floating-point types cannot be used in patterns
21+
--> $DIR/deduplicate-diagnostics-2.rs:7:9
22+
|
23+
LL | 1.0 => {}
24+
| ^^^
25+
|
26+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
27+
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
28+
29+
warning: floating-point types cannot be used in patterns
30+
--> $DIR/deduplicate-diagnostics-2.rs:11:9
31+
|
32+
LL | 2.0 => {}
33+
| ^^^
34+
|
35+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
36+
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
37+

Diff for: src/test/ui/deduplicate-diagnostics-2.rs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// build-pass
2+
// revisions: duplicate deduplicate
3+
//[deduplicate] compile-flags: -Z deduplicate-diagnostics=yes
4+
5+
fn main() {
6+
match 0.0 {
7+
1.0 => {} //~ WARNING floating-point types cannot be used in patterns
8+
//~| WARNING this was previously accepted
9+
//~| WARNING floating-point types cannot be used in patterns
10+
//~| WARNING this was previously accepted
11+
2.0 => {} //~ WARNING floating-point types cannot be used in patterns
12+
//~| WARNING this was previously accepted
13+
//[duplicate]~| WARNING floating-point types cannot be used in patterns
14+
//[duplicate]~| WARNING this was previously accepted
15+
_ => {}
16+
}
17+
}
+8-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1+
error[E0452]: malformed lint attribute input
2+
--> $DIR/deduplicate-diagnostics.rs:8:8
3+
|
4+
LL | #[deny("literal")]
5+
| ^^^^^^^^^ bad attribute argument
6+
17
error: cannot find derive macro `Unresolved` in this scope
28
--> $DIR/deduplicate-diagnostics.rs:4:10
39
|
410
LL | #[derive(Unresolved)]
511
| ^^^^^^^^^^
612

7-
error: aborting due to previous error
13+
error: aborting due to 2 previous errors
814

15+
For more information about this error, try `rustc --explain E0452`.

Diff for: src/test/ui/deduplicate-diagnostics.duplicate.stderr

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
error[E0452]: malformed lint attribute input
2+
--> $DIR/deduplicate-diagnostics.rs:8:8
3+
|
4+
LL | #[deny("literal")]
5+
| ^^^^^^^^^ bad attribute argument
6+
17
error: cannot find derive macro `Unresolved` in this scope
28
--> $DIR/deduplicate-diagnostics.rs:4:10
39
|
@@ -10,5 +16,18 @@ error: cannot find derive macro `Unresolved` in this scope
1016
LL | #[derive(Unresolved)]
1117
| ^^^^^^^^^^
1218

13-
error: aborting due to 2 previous errors
19+
error[E0452]: malformed lint attribute input
20+
--> $DIR/deduplicate-diagnostics.rs:8:8
21+
|
22+
LL | #[deny("literal")]
23+
| ^^^^^^^^^ bad attribute argument
24+
25+
error[E0452]: malformed lint attribute input
26+
--> $DIR/deduplicate-diagnostics.rs:8:8
27+
|
28+
LL | #[deny("literal")]
29+
| ^^^^^^^^^ bad attribute argument
30+
31+
error: aborting due to 5 previous errors
1432

33+
For more information about this error, try `rustc --explain E0452`.

Diff for: src/test/ui/deduplicate-diagnostics.rs

+3
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@
55
//[duplicate]~| ERROR cannot find derive macro `Unresolved` in this scope
66
struct S;
77

8+
#[deny("literal")] //~ ERROR malformed lint attribute input
9+
//[duplicate]~| ERROR malformed lint attribute input
10+
//[duplicate]~| ERROR malformed lint attribute input
811
fn main() {}

0 commit comments

Comments
 (0)