summary refs log tree commit diff
path: root/src/test/ui/parser
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-10-14 17:20:50 -0700
committerEsteban Küber <esteban@kuber.com.ar>2019-10-27 11:50:43 -0700
commitb26ddb8af37362e33c45c78c9c91a3c5cdabfe7e (patch)
tree13882f89b25e139a8e0997d8c7146bc15b0483c0 /src/test/ui/parser
parent0f677c65e867d93a47ccbaeaf6e6725cde8c5ff6 (diff)
downloadrust-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/parser')
-rw-r--r--src/test/ui/parser/recover-from-bad-variant.rs2
-rw-r--r--src/test/ui/parser/recover-from-bad-variant.stderr2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/test/ui/parser/recover-from-bad-variant.rs b/src/test/ui/parser/recover-from-bad-variant.rs
index 35088fb3068..27b03c0c2db 100644
--- a/src/test/ui/parser/recover-from-bad-variant.rs
+++ b/src/test/ui/parser/recover-from-bad-variant.rs
@@ -8,7 +8,7 @@ fn main() {
     //~^ ERROR expected type, found `3`
     match x {
         Enum::Foo(a, b) => {}
-        //~^ ERROR expected tuple struct/variant, found struct variant `Enum::Foo`
+        //~^ ERROR expected tuple struct or tuple variant, found struct variant `Enum::Foo`
         Enum::Bar(a, b) => {}
     }
 }
diff --git a/src/test/ui/parser/recover-from-bad-variant.stderr b/src/test/ui/parser/recover-from-bad-variant.stderr
index 32bb88d31c4..375e2d54544 100644
--- a/src/test/ui/parser/recover-from-bad-variant.stderr
+++ b/src/test/ui/parser/recover-from-bad-variant.stderr
@@ -9,7 +9,7 @@ LL |     let x = Enum::Foo(a: 3, b: 4);
    = note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
    = note: for more information, see https://github.com/rust-lang/rust/issues/23416
 
-error[E0532]: expected tuple struct/variant, found struct variant `Enum::Foo`
+error[E0532]: expected tuple struct or tuple variant, found struct variant `Enum::Foo`
   --> $DIR/recover-from-bad-variant.rs:10:9
    |
 LL |     Foo { a: usize, b: usize },