Skip to content

Commit 3faef3c

Browse files
committed
Update error annotations positions
Since 8ec9d72, in the case of a local macro expansion, the errors are now matched to macro definition location. Update test cases accordingly.
1 parent 1c9b979 commit 3faef3c

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

src/test/ui/if/if-let.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ fn macros() {
44
macro_rules! foo{
55
($p:pat, $e:expr, $b:block) => {{
66
if let $p = $e $b
7+
//~^ WARN irrefutable if-let
8+
//~| WARN irrefutable if-let
79
}}
810
}
911
macro_rules! bar{
@@ -12,10 +14,10 @@ fn macros() {
1214
}}
1315
}
1416

15-
foo!(a, 1, { //~ WARN irrefutable if-let
17+
foo!(a, 1, {
1618
println!("irrefutable pattern");
1719
});
18-
bar!(a, 1, { //~ WARN irrefutable if-let
20+
bar!(a, 1, {
1921
println!("irrefutable pattern");
2022
});
2123
}

src/test/ui/if/if-let.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ LL | | });
2323
| |_______- in this macro invocation
2424

2525
warning: irrefutable if-let pattern
26-
--> $DIR/if-let.rs:24:5
26+
--> $DIR/if-let.rs:26:5
2727
|
2828
LL | / if let a = 1 {
2929
LL | | println!("irrefutable pattern");
3030
LL | | }
3131
| |_____^
3232

3333
warning: irrefutable if-let pattern
34-
--> $DIR/if-let.rs:28:5
34+
--> $DIR/if-let.rs:30:5
3535
|
3636
LL | / if let a = 1 {
3737
LL | | println!("irrefutable pattern");
@@ -43,7 +43,7 @@ LL | | }
4343
| |_____^
4444

4545
warning: irrefutable if-let pattern
46-
--> $DIR/if-let.rs:38:12
46+
--> $DIR/if-let.rs:40:12
4747
|
4848
LL | } else if let a = 1 {
4949
| ____________^
@@ -52,7 +52,7 @@ LL | | }
5252
| |_____^
5353

5454
warning: irrefutable if-let pattern
55-
--> $DIR/if-let.rs:44:12
55+
--> $DIR/if-let.rs:46:12
5656
|
5757
LL | } else if let a = 1 {
5858
| ____________^

src/test/ui/while-let.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ fn macros() {
55
macro_rules! foo{
66
($p:pat, $e:expr, $b:block) => {{
77
while let $p = $e $b
8+
//~^ WARN irrefutable while-let
9+
//~| WARN irrefutable while-let
810
}}
911
}
1012
macro_rules! bar{
@@ -13,10 +15,10 @@ fn macros() {
1315
}}
1416
}
1517

16-
foo!(_a, 1, { //~ WARN irrefutable while-let
18+
foo!(_a, 1, {
1719
println!("irrefutable pattern");
1820
});
19-
bar!(_a, 1, { //~ WARN irrefutable while-let
21+
bar!(_a, 1, {
2022
println!("irrefutable pattern");
2123
});
2224
}

src/test/ui/while-let.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ LL | | });
2323
| |_______- in this macro invocation
2424

2525
warning: irrefutable while-let pattern
26-
--> $DIR/while-let.rs:25:5
26+
--> $DIR/while-let.rs:27:5
2727
|
2828
LL | / while let _a = 1 {
2929
LL | | println!("irrefutable pattern");

0 commit comments

Comments
 (0)