diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-09-29 20:34:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-29 20:34:14 +0200 |
| commit | f34e2b1e7cbbc77d1fadcdb613c3db9c79841e5f (patch) | |
| tree | 367aab863cb6b3b9228d957674f7a675307d1dde /src/test/ui/methods | |
| parent | 0a2ddcc3464f53c23ffc5d3e904ba909753fe341 (diff) | |
| parent | e58e144e6634e3cbdfd6d415eb0ea24bc2a2bb87 (diff) | |
| download | rust-f34e2b1e7cbbc77d1fadcdb613c3db9c79841e5f.tar.gz rust-f34e2b1e7cbbc77d1fadcdb613c3db9c79841e5f.zip | |
Rollup merge of #64735 - GuillaumeGomez:long-err-explanation-E0533, r=Centril
Add long error explanation for E0533 Part of https://github.com/rust-lang/rust/issues/61137
Diffstat (limited to 'src/test/ui/methods')
| -rw-r--r-- | src/test/ui/methods/method-path-in-pattern.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/methods/method-path-in-pattern.stderr | 21 |
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`. |
