Skip to content

Commit b82cd9f

Browse files
committed
Address review comments + Update NLL tests
1 parent 642669c commit b82cd9f

8 files changed

+118
-6
lines changed
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+
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+
+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+
}
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`.

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`.

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() {}

src/test/ui/generator/auto-trait-regions.nll.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0716]: temporary value dropped while borrowed
2-
--> $DIR/auto-trait-regions.rs:44:24
2+
--> $DIR/auto-trait-regions.rs:45:24
33
|
44
LL | let a = A(&mut true, &mut true, No);
55
| ^^^^ - temporary value is freed at the end of this statement
@@ -12,7 +12,7 @@ LL | assert_foo(a);
1212
= note: consider using a `let` binding to create a longer lived value
1313

1414
error[E0716]: temporary value dropped while borrowed
15-
--> $DIR/auto-trait-regions.rs:44:35
15+
--> $DIR/auto-trait-regions.rs:45:35
1616
|
1717
LL | let a = A(&mut true, &mut true, No);
1818
| ^^^^ - temporary value is freed at the end of this statement
@@ -31,7 +31,7 @@ LL | assert_foo(gen);
3131
| ^^^^^^^^^^^^^^^
3232

3333
error: higher-ranked subtype error
34-
--> $DIR/auto-trait-regions.rs:48:5
34+
--> $DIR/auto-trait-regions.rs:49:5
3535
|
3636
LL | assert_foo(gen);
3737
| ^^^^^^^^^^^^^^^

src/test/ui/hrtb/hrtb-perfect-forwarding.nll.stderr

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ LL | | // Not OK -- The forwarding impl for `Foo` requires that `Bar` also
3939
... |
4040
LL | | foo_hrtb_bar_not(&mut t);
4141
| | ------------------------ recursive call site
42+
LL | |
4243
LL | | }
4344
| |_^ cannot return without recursing
4445
|
@@ -62,7 +63,7 @@ LL | foo_hrtb_bar_not(&mut t);
6263
| ^^^^^^^^^^^^^^^^^^^^^^^^
6364

6465
warning: function cannot return without recursing
65-
--> $DIR/hrtb-perfect-forwarding.rs:49:1
66+
--> $DIR/hrtb-perfect-forwarding.rs:50:1
6667
|
6768
LL | / fn foo_hrtb_bar_hrtb<T>(mut t: T)
6869
LL | | where T : for<'a> Foo<&'a isize> + for<'b> Bar<&'b isize>

0 commit comments

Comments
 (0)