about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-09-08 02:51:20 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-09-08 14:15:11 +0300
commit2dce3779bbc0353ff9fb544774417a851027fcab (patch)
treeb1947e6ce697bd9b82be8a030d08f745e74375f7 /src/test/ui
parent9beb5c3ef3062226783529f626fb8c4a7eb7f936 (diff)
downloadrust-2dce3779bbc0353ff9fb544774417a851027fcab.tar.gz
rust-2dce3779bbc0353ff9fb544774417a851027fcab.zip
resolve: More precise spans for ambiguous resolution errors
Add labels to ambiguous resolution errors
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/error-codes/E0659.stderr4
-rw-r--r--src/test/ui/imports/duplicate.stderr14
-rw-r--r--src/test/ui/imports/glob-shadowing.stderr6
-rw-r--r--src/test/ui/imports/issue-53269.stderr2
-rw-r--r--src/test/ui/imports/local-modularized-tricky-fail-1.rs1
-rw-r--r--src/test/ui/imports/local-modularized-tricky-fail-1.stderr15
-rw-r--r--src/test/ui/imports/macro-paths.stderr4
-rw-r--r--src/test/ui/imports/macros.stderr6
-rw-r--r--src/test/ui/imports/rfc-1560-warning-cycle.stderr2
-rw-r--r--src/test/ui/imports/shadow_builtin_macros.stderr8
-rw-r--r--src/test/ui/macros/macro-path-prelude-shadowing.stderr2
-rw-r--r--src/test/ui/macros/macro-shadowing.stderr2
-rw-r--r--src/test/ui/macros/restricted-shadowing-legacy.stderr16
-rw-r--r--src/test/ui/macros/restricted-shadowing-modern.stderr30
-rw-r--r--src/test/ui/out-of-order-shadowing.stderr2
15 files changed, 47 insertions, 67 deletions
diff --git a/src/test/ui/error-codes/E0659.stderr b/src/test/ui/error-codes/E0659.stderr
index 06176085b38..f168b7797ca 100644
--- a/src/test/ui/error-codes/E0659.stderr
+++ b/src/test/ui/error-codes/E0659.stderr
@@ -1,8 +1,8 @@
 error[E0659]: `foo` is ambiguous
-  --> $DIR/E0659.rs:25:5
+  --> $DIR/E0659.rs:25:15
    |
 LL |     collider::foo(); //~ ERROR E0659
-   |     ^^^^^^^^^^^^^
+   |               ^^^ ambiguous name
    |
 note: `foo` could refer to the name imported here
   --> $DIR/E0659.rs:20:13
diff --git a/src/test/ui/imports/duplicate.stderr b/src/test/ui/imports/duplicate.stderr
index 452e3e1e200..9cdd7aa88f1 100644
--- a/src/test/ui/imports/duplicate.stderr
+++ b/src/test/ui/imports/duplicate.stderr
@@ -13,10 +13,10 @@ LL |     use a::foo as other_foo; //~ ERROR the name `foo` is defined multiple t
    |         ^^^^^^^^^^^^^^^^^^^
 
 error[E0659]: `foo` is ambiguous
-  --> $DIR/duplicate.rs:56:9
+  --> $DIR/duplicate.rs:56:15
    |
 LL |     use self::foo::bar; //~ ERROR `foo` is ambiguous
-   |         ^^^^^^^^^^^^^^
+   |               ^^^ ambiguous name
    |
 note: `foo` could refer to the name imported here
   --> $DIR/duplicate.rs:53:9
@@ -31,10 +31,10 @@ LL |     use self::m2::*;
    = note: consider adding an explicit import of `foo` to disambiguate
 
 error[E0659]: `foo` is ambiguous
-  --> $DIR/duplicate.rs:45:5
+  --> $DIR/duplicate.rs:45:8
    |
 LL |     f::foo(); //~ ERROR `foo` is ambiguous
-   |     ^^^^^^
+   |        ^^^ ambiguous name
    |
 note: `foo` could refer to the name imported here
   --> $DIR/duplicate.rs:34:13
@@ -49,10 +49,10 @@ LL |     pub use b::*;
    = note: consider adding an explicit import of `foo` to disambiguate
 
 error[E0659]: `foo` is ambiguous
-  --> $DIR/duplicate.rs:46:5
+  --> $DIR/duplicate.rs:46:8
    |
 LL |     g::foo(); //~ ERROR `foo` is ambiguous
-   |     ^^^^^^
+   |        ^^^ ambiguous name
    |
 note: `foo` could refer to the name imported here
   --> $DIR/duplicate.rs:39:13
@@ -70,7 +70,7 @@ error[E0659]: `foo` is ambiguous
   --> $DIR/duplicate.rs:59:9
    |
 LL |         foo::bar(); //~ ERROR `foo` is ambiguous
-   |         ^^^^^^^^
+   |         ^^^ ambiguous name
    |
 note: `foo` could refer to the name imported here
   --> $DIR/duplicate.rs:53:9
diff --git a/src/test/ui/imports/glob-shadowing.stderr b/src/test/ui/imports/glob-shadowing.stderr
index 7f61cd6c76d..33a2963fa29 100644
--- a/src/test/ui/imports/glob-shadowing.stderr
+++ b/src/test/ui/imports/glob-shadowing.stderr
@@ -2,7 +2,7 @@ error[E0659]: `env` is ambiguous
   --> $DIR/glob-shadowing.rs:21:17
    |
 LL |         let x = env!("PATH"); //~ ERROR `env` is ambiguous
-   |                 ^^^
+   |                 ^^^ ambiguous name
    |
 note: `env` could refer to the name imported here
   --> $DIR/glob-shadowing.rs:19:9
@@ -16,7 +16,7 @@ error[E0659]: `env` is ambiguous
   --> $DIR/glob-shadowing.rs:29:21
    |
 LL |             let x = env!("PATH"); //~ ERROR `env` is ambiguous
-   |                     ^^^
+   |                     ^^^ ambiguous name
    |
 note: `env` could refer to the name imported here
   --> $DIR/glob-shadowing.rs:27:13
@@ -30,7 +30,7 @@ error[E0659]: `fenv` is ambiguous
   --> $DIR/glob-shadowing.rs:39:21
    |
 LL |             let x = fenv!(); //~ ERROR `fenv` is ambiguous
-   |                     ^^^^
+   |                     ^^^^ ambiguous name
    |
 note: `fenv` could refer to the name imported here
   --> $DIR/glob-shadowing.rs:37:13
diff --git a/src/test/ui/imports/issue-53269.stderr b/src/test/ui/imports/issue-53269.stderr
index 0036d71107a..e125983151d 100644
--- a/src/test/ui/imports/issue-53269.stderr
+++ b/src/test/ui/imports/issue-53269.stderr
@@ -8,7 +8,7 @@ error[E0659]: `mac` is ambiguous
   --> $DIR/issue-53269.rs:18:5
    |
 LL |     mac!(); //~ ERROR `mac` is ambiguous
-   |     ^^^
+   |     ^^^ ambiguous name
    |
 note: `mac` could refer to the name defined here
   --> $DIR/issue-53269.rs:13:1
diff --git a/src/test/ui/imports/local-modularized-tricky-fail-1.rs b/src/test/ui/imports/local-modularized-tricky-fail-1.rs
index 445344732f7..fb05b95a96d 100644
--- a/src/test/ui/imports/local-modularized-tricky-fail-1.rs
+++ b/src/test/ui/imports/local-modularized-tricky-fail-1.rs
@@ -43,7 +43,6 @@ mod inner2 {
 
 fn main() {
     panic!(); //~ ERROR `panic` is ambiguous
-              //~^ ERROR `panic` is ambiguous
 }
 
 mod inner3 {
diff --git a/src/test/ui/imports/local-modularized-tricky-fail-1.stderr b/src/test/ui/imports/local-modularized-tricky-fail-1.stderr
index e9a81e7ae4c..cce1fd30f1d 100644
--- a/src/test/ui/imports/local-modularized-tricky-fail-1.stderr
+++ b/src/test/ui/imports/local-modularized-tricky-fail-1.stderr
@@ -2,7 +2,7 @@ error[E0659]: `exported` is ambiguous
   --> $DIR/local-modularized-tricky-fail-1.rs:38:1
    |
 LL | exported!(); //~ ERROR `exported` is ambiguous
-   | ^^^^^^^^
+   | ^^^^^^^^ ambiguous name
    |
 note: `exported` could refer to the name defined here
   --> $DIR/local-modularized-tricky-fail-1.rs:15:5
@@ -22,10 +22,10 @@ LL | use inner1::*;
    = note: macro-expanded macros do not shadow
 
 error[E0659]: `include` is ambiguous
-  --> $DIR/local-modularized-tricky-fail-1.rs:57:1
+  --> $DIR/local-modularized-tricky-fail-1.rs:56:1
    |
 LL | include!(); //~ ERROR `include` is ambiguous
-   | ^^^^^^^
+   | ^^^^^^^ ambiguous name
    |
 note: `include` could refer to the name defined here
   --> $DIR/local-modularized-tricky-fail-1.rs:27:5
@@ -44,7 +44,7 @@ error[E0659]: `panic` is ambiguous
   --> $DIR/local-modularized-tricky-fail-1.rs:45:5
    |
 LL |     panic!(); //~ ERROR `panic` is ambiguous
-   |     ^^^^^
+   |     ^^^^^ ambiguous name
    |
 note: `panic` could refer to the name defined here
   --> $DIR/local-modularized-tricky-fail-1.rs:21:5
@@ -60,10 +60,10 @@ LL |       define_panic!();
    = note: macro-expanded macros do not shadow
 
 error[E0659]: `panic` is ambiguous
-  --> $DIR/local-modularized-tricky-fail-1.rs:45:5
+  --> <panic macros>:1:13
    |
-LL |     panic!(); //~ ERROR `panic` is ambiguous
-   |     ^^^^^^^^^
+LL | (  ) => ( { panic ! ( "explicit panic" ) } ) ; ( $ msg : expr ) => (
+   |             ^^^^^ ambiguous name
    |
 note: `panic` could refer to the name defined here
   --> $DIR/local-modularized-tricky-fail-1.rs:21:5
@@ -77,7 +77,6 @@ LL |       define_panic!();
    |       ---------------- in this macro invocation
    = note: `panic` is also a builtin macro
    = note: macro-expanded macros do not shadow
-   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
 
 error: aborting due to 4 previous errors
 
diff --git a/src/test/ui/imports/macro-paths.stderr b/src/test/ui/imports/macro-paths.stderr
index 08f45e1a575..a612c64c2f4 100644
--- a/src/test/ui/imports/macro-paths.stderr
+++ b/src/test/ui/imports/macro-paths.stderr
@@ -2,7 +2,7 @@ error[E0659]: `bar` is ambiguous
   --> $DIR/macro-paths.rs:23:5
    |
 LL |     bar::m! { //~ ERROR ambiguous
-   |     ^^^^^^
+   |     ^^^ ambiguous name
    |
 note: `bar` could refer to the name defined here
   --> $DIR/macro-paths.rs:24:9
@@ -20,7 +20,7 @@ error[E0659]: `baz` is ambiguous
   --> $DIR/macro-paths.rs:33:5
    |
 LL |     baz::m! { //~ ERROR ambiguous
-   |     ^^^^^^
+   |     ^^^ ambiguous name
    |
 note: `baz` could refer to the name defined here
   --> $DIR/macro-paths.rs:34:9
diff --git a/src/test/ui/imports/macros.stderr b/src/test/ui/imports/macros.stderr
index 2c0c4642067..c54101fc6e6 100644
--- a/src/test/ui/imports/macros.stderr
+++ b/src/test/ui/imports/macros.stderr
@@ -2,7 +2,7 @@ error[E0659]: `m` is ambiguous
   --> $DIR/macros.rs:48:5
    |
 LL |     m!(); //~ ERROR ambiguous
-   |     ^
+   |     ^ ambiguous name
    |
 note: `m` could refer to the name defined here
   --> $DIR/macros.rs:46:5
@@ -19,7 +19,7 @@ error[E0659]: `m` is ambiguous
   --> $DIR/macros.rs:26:5
    |
 LL |     m! { //~ ERROR ambiguous
-   |     ^
+   |     ^ ambiguous name
    |
 note: `m` could refer to the name imported here
   --> $DIR/macros.rs:27:13
@@ -37,7 +37,7 @@ error[E0659]: `m` is ambiguous
   --> $DIR/macros.rs:39:9
    |
 LL |         m! { //~ ERROR ambiguous
-   |         ^
+   |         ^ ambiguous name
    |
 note: `m` could refer to the name imported here
   --> $DIR/macros.rs:40:17
diff --git a/src/test/ui/imports/rfc-1560-warning-cycle.stderr b/src/test/ui/imports/rfc-1560-warning-cycle.stderr
index 5a01680fc19..91af3a4b6ac 100644
--- a/src/test/ui/imports/rfc-1560-warning-cycle.stderr
+++ b/src/test/ui/imports/rfc-1560-warning-cycle.stderr
@@ -2,7 +2,7 @@ error[E0659]: `Foo` is ambiguous
   --> $DIR/rfc-1560-warning-cycle.rs:19:17
    |
 LL |         fn f(_: Foo) {} //~ ERROR `Foo` is ambiguous
-   |                 ^^^
+   |                 ^^^ ambiguous name
    |
 note: `Foo` could refer to the name imported here
   --> $DIR/rfc-1560-warning-cycle.rs:17:13
diff --git a/src/test/ui/imports/shadow_builtin_macros.stderr b/src/test/ui/imports/shadow_builtin_macros.stderr
index 5c7f15b6fe2..e554bbb4f31 100644
--- a/src/test/ui/imports/shadow_builtin_macros.stderr
+++ b/src/test/ui/imports/shadow_builtin_macros.stderr
@@ -2,7 +2,7 @@ error[E0659]: `panic` is ambiguous
   --> $DIR/shadow_builtin_macros.rs:43:5
    |
 LL |     panic!(); //~ ERROR `panic` is ambiguous
-   |     ^^^^^
+   |     ^^^^^ ambiguous name
    |
 note: `panic` could refer to the name defined here
   --> $DIR/shadow_builtin_macros.rs:40:9
@@ -19,7 +19,7 @@ error[E0659]: `panic` is ambiguous
   --> $DIR/shadow_builtin_macros.rs:25:14
    |
 LL |     fn f() { panic!(); } //~ ERROR ambiguous
-   |              ^^^^^
+   |              ^^^^^ ambiguous name
    |
 note: `panic` could refer to the name imported here
   --> $DIR/shadow_builtin_macros.rs:24:9
@@ -33,7 +33,7 @@ error[E0659]: `panic` is ambiguous
   --> $DIR/shadow_builtin_macros.rs:30:14
    |
 LL |     fn f() { panic!(); } //~ ERROR ambiguous
-   |              ^^^^^
+   |              ^^^^^ ambiguous name
    |
 note: `panic` could refer to the name imported here
   --> $DIR/shadow_builtin_macros.rs:29:26
@@ -47,7 +47,7 @@ error[E0659]: `n` is ambiguous
   --> $DIR/shadow_builtin_macros.rs:59:5
    |
 LL |     n!(); //~ ERROR ambiguous
-   |     ^
+   |     ^ ambiguous name
    |
 note: `n` could refer to the name imported here
   --> $DIR/shadow_builtin_macros.rs:58:9
diff --git a/src/test/ui/macros/macro-path-prelude-shadowing.stderr b/src/test/ui/macros/macro-path-prelude-shadowing.stderr
index c0892f97376..607d3e100aa 100644
--- a/src/test/ui/macros/macro-path-prelude-shadowing.stderr
+++ b/src/test/ui/macros/macro-path-prelude-shadowing.stderr
@@ -2,7 +2,7 @@ error[E0659]: `std` is ambiguous
   --> $DIR/macro-path-prelude-shadowing.rs:39:9
    |
 LL |         std::panic!(); //~ ERROR `std` is ambiguous
-   |         ^^^^^^^^^^
+   |         ^^^ ambiguous name
    |
 note: `std` could refer to the name imported here
   --> $DIR/macro-path-prelude-shadowing.rs:37:9
diff --git a/src/test/ui/macros/macro-shadowing.stderr b/src/test/ui/macros/macro-shadowing.stderr
index 04f4abc4013..d996f3a7041 100644
--- a/src/test/ui/macros/macro-shadowing.stderr
+++ b/src/test/ui/macros/macro-shadowing.stderr
@@ -13,7 +13,7 @@ error[E0659]: `foo` is ambiguous
   --> $DIR/macro-shadowing.rs:27:1
    |
 LL | foo!(); //~ ERROR `foo` is ambiguous
-   | ^^^
+   | ^^^ ambiguous name
    |
 note: `foo` could refer to the name defined here
   --> $DIR/macro-shadowing.rs:20:5
diff --git a/src/test/ui/macros/restricted-shadowing-legacy.stderr b/src/test/ui/macros/restricted-shadowing-legacy.stderr
index c1a01956998..9e0d40c44b6 100644
--- a/src/test/ui/macros/restricted-shadowing-legacy.stderr
+++ b/src/test/ui/macros/restricted-shadowing-legacy.stderr
@@ -2,7 +2,7 @@ error[E0659]: `m` is ambiguous
   --> $DIR/restricted-shadowing-legacy.rs:101:13
    |
 LL |             m!(); //~ ERROR `m` is ambiguous
-   |             ^
+   |             ^ ambiguous name
    |
 note: `m` could refer to the name defined here
   --> $DIR/restricted-shadowing-legacy.rs:88:9
@@ -26,7 +26,7 @@ error[E0659]: `m` is ambiguous
   --> $DIR/restricted-shadowing-legacy.rs:139:42
    |
 LL |         macro_rules! gen_invoc { () => { m!() } } //~ ERROR `m` is ambiguous
-   |                                          ^
+   |                                          ^ ambiguous name
    |
 note: `m` could refer to the name defined here
   --> $DIR/restricted-shadowing-legacy.rs:88:9
@@ -50,7 +50,7 @@ error[E0659]: `m` is ambiguous
   --> $DIR/restricted-shadowing-legacy.rs:148:9
    |
 LL |         m!(); //~ ERROR `m` is ambiguous
-   |         ^
+   |         ^ ambiguous name
    |
 note: `m` could refer to the name defined here
   --> $DIR/restricted-shadowing-legacy.rs:88:9
@@ -74,7 +74,7 @@ error[E0659]: `m` is ambiguous
   --> $DIR/restricted-shadowing-legacy.rs:164:9
    |
 LL |         m!(); //~ ERROR `m` is ambiguous
-   |         ^
+   |         ^ ambiguous name
    |
 note: `m` could refer to the name defined here
   --> $DIR/restricted-shadowing-legacy.rs:88:9
@@ -98,7 +98,7 @@ error[E0659]: `m` is ambiguous
   --> $DIR/restricted-shadowing-legacy.rs:180:13
    |
 LL |             m!(); //~ ERROR `m` is ambiguous
-   |             ^
+   |             ^ ambiguous name
    |
 note: `m` could refer to the name defined here
   --> $DIR/restricted-shadowing-legacy.rs:88:9
@@ -122,7 +122,7 @@ error[E0659]: `m` is ambiguous
   --> $DIR/restricted-shadowing-legacy.rs:218:42
    |
 LL |         macro_rules! gen_invoc { () => { m!() } } //~ ERROR `m` is ambiguous
-   |                                          ^
+   |                                          ^ ambiguous name
    |
 note: `m` could refer to the name defined here
   --> $DIR/restricted-shadowing-legacy.rs:88:9
@@ -146,7 +146,7 @@ error[E0659]: `m` is ambiguous
   --> $DIR/restricted-shadowing-legacy.rs:232:9
    |
 LL |         m!(); //~ ERROR `m` is ambiguous
-   |         ^
+   |         ^ ambiguous name
    |
 note: `m` could refer to the name defined here
   --> $DIR/restricted-shadowing-legacy.rs:88:9
@@ -170,7 +170,7 @@ error[E0659]: `m` is ambiguous
   --> $DIR/restricted-shadowing-legacy.rs:262:42
    |
 LL |         macro_rules! gen_invoc { () => { m!() } } //~ ERROR `m` is ambiguous
-   |                                          ^
+   |                                          ^ ambiguous name
    |
 note: `m` could refer to the name defined here
   --> $DIR/restricted-shadowing-legacy.rs:88:9
diff --git a/src/test/ui/macros/restricted-shadowing-modern.stderr b/src/test/ui/macros/restricted-shadowing-modern.stderr
index af4a93a4079..0462438be78 100644
--- a/src/test/ui/macros/restricted-shadowing-modern.stderr
+++ b/src/test/ui/macros/restricted-shadowing-modern.stderr
@@ -2,10 +2,7 @@ error[E0659]: `m` is ambiguous
   --> $DIR/restricted-shadowing-modern.rs:106:17
    |
 LL |                 m!(); //~ ERROR `m` is ambiguous
-   |                 ^
-...
-LL | include!();
-   | ----------- in this macro invocation
+   |                 ^ ambiguous name
    |
 note: `m` could refer to the name defined here
   --> $DIR/restricted-shadowing-modern.rs:91:9
@@ -29,10 +26,7 @@ error[E0659]: `m` is ambiguous
   --> $DIR/restricted-shadowing-modern.rs:149:33
    |
 LL |             macro gen_invoc() { m!() } //~ ERROR `m` is ambiguous
-   |                                 ^
-...
-LL | include!();
-   | ----------- in this macro invocation
+   |                                 ^ ambiguous name
    |
 note: `m` could refer to the name defined here
   --> $DIR/restricted-shadowing-modern.rs:91:9
@@ -56,10 +50,7 @@ error[E0659]: `m` is ambiguous
   --> $DIR/restricted-shadowing-modern.rs:158:13
    |
 LL |             m!(); //~ ERROR `m` is ambiguous
-   |             ^
-...
-LL | include!();
-   | ----------- in this macro invocation
+   |             ^ ambiguous name
    |
 note: `m` could refer to the name defined here
   --> $DIR/restricted-shadowing-modern.rs:91:9
@@ -83,10 +74,7 @@ error[E0659]: `m` is ambiguous
   --> $DIR/restricted-shadowing-modern.rs:174:13
    |
 LL |             m!(); //~ ERROR `m` is ambiguous
-   |             ^
-...
-LL | include!();
-   | ----------- in this macro invocation
+   |             ^ ambiguous name
    |
 note: `m` could refer to the name defined here
   --> $DIR/restricted-shadowing-modern.rs:91:9
@@ -110,10 +98,7 @@ error[E0659]: `m` is ambiguous
   --> $DIR/restricted-shadowing-modern.rs:192:17
    |
 LL |                 m!(); //~ ERROR `m` is ambiguous
-   |                 ^
-...
-LL | include!();
-   | ----------- in this macro invocation
+   |                 ^ ambiguous name
    |
 note: `m` could refer to the name defined here
   --> $DIR/restricted-shadowing-modern.rs:91:9
@@ -137,10 +122,7 @@ error[E0659]: `m` is ambiguous
   --> $DIR/restricted-shadowing-modern.rs:235:33
    |
 LL |             macro gen_invoc() { m!() } //~ ERROR `m` is ambiguous
-   |                                 ^
-...
-LL | include!();
-   | ----------- in this macro invocation
+   |                                 ^ ambiguous name
    |
 note: `m` could refer to the name defined here
   --> $DIR/restricted-shadowing-modern.rs:91:9
diff --git a/src/test/ui/out-of-order-shadowing.stderr b/src/test/ui/out-of-order-shadowing.stderr
index 424c194d8fc..d96a802cb3f 100644
--- a/src/test/ui/out-of-order-shadowing.stderr
+++ b/src/test/ui/out-of-order-shadowing.stderr
@@ -2,7 +2,7 @@ error[E0659]: `bar` is ambiguous
   --> $DIR/out-of-order-shadowing.rs:15:1
    |
 LL | bar!(); //~ ERROR `bar` is ambiguous
-   | ^^^
+   | ^^^ ambiguous name
    |
 note: `bar` could refer to the name defined here
   --> $DIR/out-of-order-shadowing.rs:14:1