diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2019-10-14 17:20:50 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2019-10-27 11:50:43 -0700 |
| commit | b26ddb8af37362e33c45c78c9c91a3c5cdabfe7e (patch) | |
| tree | 13882f89b25e139a8e0997d8c7146bc15b0483c0 /src/test/ui/empty/empty-struct-braces-expr.rs | |
| parent | 0f677c65e867d93a47ccbaeaf6e6725cde8c5ff6 (diff) | |
| download | rust-b26ddb8af37362e33c45c78c9c91a3c5cdabfe7e.tar.gz rust-b26ddb8af37362e33c45c78c9c91a3c5cdabfe7e.zip | |
Point at local similarly named element and tweak references to variants
Point at the span for the definition of ADTs internal to the current crate. Look at the leading char of the ident to determine whether we're expecting a likely fn or any of a fn, a tuple struct or a tuple variant. Turn fn `add_typo_suggestion` into a `Resolver` method.
Diffstat (limited to 'src/test/ui/empty/empty-struct-braces-expr.rs')
| -rw-r--r-- | src/test/ui/empty/empty-struct-braces-expr.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/test/ui/empty/empty-struct-braces-expr.rs b/src/test/ui/empty/empty-struct-braces-expr.rs index e33fcb70db7..1a38d3d7601 100644 --- a/src/test/ui/empty/empty-struct-braces-expr.rs +++ b/src/test/ui/empty/empty-struct-braces-expr.rs @@ -13,12 +13,15 @@ enum E { fn main() { let e1 = Empty1; //~ ERROR expected value, found struct `Empty1` - let e1 = Empty1(); //~ ERROR expected function, found struct `Empty1` + let e1 = Empty1(); + //~^ ERROR expected function, tuple struct or tuple variant, found struct `Empty1` let e3 = E::Empty3; //~ ERROR expected value, found struct variant `E::Empty3` - let e3 = E::Empty3(); //~ ERROR expected function, found struct variant `E::Empty3` + let e3 = E::Empty3(); + //~^ ERROR expected function, tuple struct or tuple variant, found struct variant `E::Empty3` let xe1 = XEmpty1; //~ ERROR expected value, found struct `XEmpty1` - let xe1 = XEmpty1(); //~ ERROR expected function, found struct `XEmpty1` + let xe1 = XEmpty1(); + //~^ ERROR expected function, tuple struct or tuple variant, found struct `XEmpty1` let xe3 = XE::Empty3; //~ ERROR no variant or associated item named `Empty3` found for type let xe3 = XE::Empty3(); //~ ERROR no variant or associated item named `Empty3` found for type |
