about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2019-10-24 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2019-11-03 10:20:11 +0100
commitf6c2c4dc43bc0340368ed38cecb309be472df146 (patch)
tree1abb4f5812f28b8aa28be14ee0ee137a8f3ce58a /src
parent23ada9495ff8dccc2c38f235f8289b0ee76cee6b (diff)
downloadrust-f6c2c4dc43bc0340368ed38cecb309be472df146.tar.gz
rust-f6c2c4dc43bc0340368ed38cecb309be472df146.zip
Update error annotations positions
Since 8ec9d7242c3352fbc617d907bec3632215811356, in the case of a local
macro expansion, the errors are now matched to macro definition
location. Update test cases accordingly.
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/if/if-let.rs6
-rw-r--r--src/test/ui/if/if-let.stderr8
-rw-r--r--src/test/ui/while-let.rs6
-rw-r--r--src/test/ui/while-let.stderr2
4 files changed, 13 insertions, 9 deletions
diff --git a/src/test/ui/if/if-let.rs b/src/test/ui/if/if-let.rs
index 3447f358d85..157eb386320 100644
--- a/src/test/ui/if/if-let.rs
+++ b/src/test/ui/if/if-let.rs
@@ -4,6 +4,8 @@ fn macros() {
     macro_rules! foo{
         ($p:pat, $e:expr, $b:block) => {{
             if let $p = $e $b
+            //~^ WARN irrefutable if-let
+            //~| WARN irrefutable if-let
         }}
     }
     macro_rules! bar{
@@ -12,10 +14,10 @@ fn macros() {
         }}
     }
 
-    foo!(a, 1, { //~ WARN irrefutable if-let
+    foo!(a, 1, {
         println!("irrefutable pattern");
     });
-    bar!(a, 1, { //~ WARN irrefutable if-let
+    bar!(a, 1, {
         println!("irrefutable pattern");
     });
 }
diff --git a/src/test/ui/if/if-let.stderr b/src/test/ui/if/if-let.stderr
index f105098b74c..83ab234cf04 100644
--- a/src/test/ui/if/if-let.stderr
+++ b/src/test/ui/if/if-let.stderr
@@ -23,7 +23,7 @@ LL | |     });
    | |_______- in this macro invocation
 
 warning: irrefutable if-let pattern
-  --> $DIR/if-let.rs:24:5
+  --> $DIR/if-let.rs:26:5
    |
 LL | /     if let a = 1 {
 LL | |         println!("irrefutable pattern");
@@ -31,7 +31,7 @@ LL | |     }
    | |_____^
 
 warning: irrefutable if-let pattern
-  --> $DIR/if-let.rs:28:5
+  --> $DIR/if-let.rs:30:5
    |
 LL | /     if let a = 1 {
 LL | |         println!("irrefutable pattern");
@@ -43,7 +43,7 @@ LL | |     }
    | |_____^
 
 warning: irrefutable if-let pattern
-  --> $DIR/if-let.rs:38:12
+  --> $DIR/if-let.rs:40:12
    |
 LL |       } else if let a = 1 {
    |  ____________^
@@ -52,7 +52,7 @@ LL | |     }
    | |_____^
 
 warning: irrefutable if-let pattern
-  --> $DIR/if-let.rs:44:12
+  --> $DIR/if-let.rs:46:12
    |
 LL |       } else if let a = 1 {
    |  ____________^
diff --git a/src/test/ui/while-let.rs b/src/test/ui/while-let.rs
index 53babefae81..cfbf7565cb6 100644
--- a/src/test/ui/while-let.rs
+++ b/src/test/ui/while-let.rs
@@ -5,6 +5,8 @@ fn macros() {
     macro_rules! foo{
         ($p:pat, $e:expr, $b:block) => {{
             while let $p = $e $b
+            //~^ WARN irrefutable while-let
+            //~| WARN irrefutable while-let
         }}
     }
     macro_rules! bar{
@@ -13,10 +15,10 @@ fn macros() {
         }}
     }
 
-    foo!(_a, 1, { //~ WARN irrefutable while-let
+    foo!(_a, 1, {
         println!("irrefutable pattern");
     });
-    bar!(_a, 1, { //~ WARN irrefutable while-let
+    bar!(_a, 1, {
         println!("irrefutable pattern");
     });
 }
diff --git a/src/test/ui/while-let.stderr b/src/test/ui/while-let.stderr
index 30307ecaead..172874ad5fc 100644
--- a/src/test/ui/while-let.stderr
+++ b/src/test/ui/while-let.stderr
@@ -23,7 +23,7 @@ LL | |     });
    | |_______- in this macro invocation
 
 warning: irrefutable while-let pattern
-  --> $DIR/while-let.rs:25:5
+  --> $DIR/while-let.rs:27:5
    |
 LL | /     while let _a = 1 {
 LL | |         println!("irrefutable pattern");