about summary refs log tree commit diff
path: root/src/test/ui/methods
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2019-09-24 14:01:31 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2019-09-25 13:10:25 +0200
commite58e144e6634e3cbdfd6d415eb0ea24bc2a2bb87 (patch)
tree8aea7d0dbfeab6444c297d5243e60909883ae24e /src/test/ui/methods
parentd8bf4f19a380cf38f71e24dd14e48f21512cb996 (diff)
downloadrust-e58e144e6634e3cbdfd6d415eb0ea24bc2a2bb87.tar.gz
rust-e58e144e6634e3cbdfd6d415eb0ea24bc2a2bb87.zip
Update ui tests
Diffstat (limited to 'src/test/ui/methods')
-rw-r--r--src/test/ui/methods/method-path-in-pattern.rs6
-rw-r--r--src/test/ui/methods/method-path-in-pattern.stderr21
2 files changed, 26 insertions, 1 deletions
diff --git a/src/test/ui/methods/method-path-in-pattern.rs b/src/test/ui/methods/method-path-in-pattern.rs
index fb1cf7f71e7..21a91f3f32b 100644
--- a/src/test/ui/methods/method-path-in-pattern.rs
+++ b/src/test/ui/methods/method-path-in-pattern.rs
@@ -23,4 +23,10 @@ fn main() {
         <Foo>::trait_bar => {}
         //~^ ERROR expected unit struct/variant or constant, found method `<Foo>::trait_bar`
     }
+    if let Foo::bar = 0u32 {}
+    //~^ ERROR expected unit struct/variant or constant, found method `<Foo>::bar`
+    if let <Foo>::bar = 0u32 {}
+    //~^ ERROR expected unit struct/variant or constant, found method `<Foo>::bar`
+    if let Foo::trait_bar = 0u32 {}
+    //~^ ERROR expected unit struct/variant or constant, found method `<Foo>::trait_bar`
 }
diff --git a/src/test/ui/methods/method-path-in-pattern.stderr b/src/test/ui/methods/method-path-in-pattern.stderr
index 3f53ad76882..257fff4c37d 100644
--- a/src/test/ui/methods/method-path-in-pattern.stderr
+++ b/src/test/ui/methods/method-path-in-pattern.stderr
@@ -16,5 +16,24 @@ error[E0533]: expected unit struct/variant or constant, found method `<Foo>::tra
 LL |         <Foo>::trait_bar => {}
    |         ^^^^^^^^^^^^^^^^
 
-error: aborting due to 3 previous errors
+error[E0533]: expected unit struct/variant or constant, found method `<Foo>::bar`
+  --> $DIR/method-path-in-pattern.rs:26:12
+   |
+LL |     if let Foo::bar = 0u32 {}
+   |            ^^^^^^^^
+
+error[E0533]: expected unit struct/variant or constant, found method `<Foo>::bar`
+  --> $DIR/method-path-in-pattern.rs:28:12
+   |
+LL |     if let <Foo>::bar = 0u32 {}
+   |            ^^^^^^^^^^
+
+error[E0533]: expected unit struct/variant or constant, found method `<Foo>::trait_bar`
+  --> $DIR/method-path-in-pattern.rs:30:12
+   |
+LL |     if let Foo::trait_bar = 0u32 {}
+   |            ^^^^^^^^^^^^^^
+
+error: aborting due to 6 previous errors
 
+For more information about this error, try `rustc --explain E0533`.