about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2020-03-23 04:26:08 +0100
committerGitHub <noreply@github.com>2020-03-23 04:26:08 +0100
commit11f5309858db86d0419e53fbb5eb622c87664e3b (patch)
treede20764d5cc5e187b91e3a0acf3048e0c47cbe86 /src/test
parent675bdf6d6d7b6441598961052df6466efbb4bee4 (diff)
parentcb7a2c16aa086f89b0cc5ceb29dd46988ff21fc3 (diff)
downloadrust-11f5309858db86d0419e53fbb5eb622c87664e3b.tar.gz
rust-11f5309858db86d0419e53fbb5eb622c87664e3b.zip
Rollup merge of #70227 - LeSeulArtichaut:typo-def, r=Centril
Only display definition when suggesting a typo

Closes #70206
r? @Centril
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/error-codes/E0423.stderr21
-rw-r--r--src/test/ui/glob-resolve1.stderr6
-rw-r--r--src/test/ui/issues/issue-31845.stderr9
-rw-r--r--src/test/ui/issues/issue-46332.stderr2
-rw-r--r--src/test/ui/macros/macro_undefined.stderr10
-rw-r--r--src/test/ui/privacy/legacy-ctor-visibility.stderr10
-rw-r--r--src/test/ui/proc-macro/resolve-error.stderr20
-rw-r--r--src/test/ui/resolve/issue-5035.stderr2
-rw-r--r--src/test/ui/resolve/levenshtein.stderr4
-rw-r--r--src/test/ui/resolve/privacy-enum-ctor.stderr84
-rw-r--r--src/test/ui/traits/trait-impl-for-module.stderr11
-rw-r--r--src/test/ui/ufcs/ufcs-partially-resolved.stderr4
12 files changed, 68 insertions, 115 deletions
diff --git a/src/test/ui/error-codes/E0423.stderr b/src/test/ui/error-codes/E0423.stderr
index 09792845d16..a985e963e57 100644
--- a/src/test/ui/error-codes/E0423.stderr
+++ b/src/test/ui/error-codes/E0423.stderr
@@ -29,20 +29,17 @@ LL |     for _ in (std::ops::Range { start: 0, end: 10 }) {}
 error[E0423]: expected function, tuple struct or tuple variant, found struct `Foo`
   --> $DIR/E0423.rs:4:13
    |
-LL |       struct Foo { a: bool };
-   |       ---------------------- `Foo` defined here
+LL |     struct Foo { a: bool };
+   |     ---------------------- `Foo` defined here
 LL | 
-LL |       let f = Foo();
-   |               ^^^
-   |               |
-   |               did you mean `Foo { /* fields */ }`?
-   |               help: a function with a similar name exists (notice the capitalization): `foo`
+LL |     let f = Foo();
+   |             ^^^
+   |             |
+   |             did you mean `Foo { /* fields */ }`?
+   |             help: a function with a similar name exists (notice the capitalization): `foo`
 ...
-LL | / fn foo() {
-LL | |     for _ in std::ops::Range { start: 0, end: 10 } {}
-LL | |
-LL | | }
-   | |_- similarly named function `foo` defined here
+LL | fn foo() {
+   | -------- similarly named function `foo` defined here
 
 error[E0423]: expected value, found struct `T`
   --> $DIR/E0423.rs:14:8
diff --git a/src/test/ui/glob-resolve1.stderr b/src/test/ui/glob-resolve1.stderr
index 3db24431586..efbd53fd223 100644
--- a/src/test/ui/glob-resolve1.stderr
+++ b/src/test/ui/glob-resolve1.stderr
@@ -47,7 +47,7 @@ error[E0412]: cannot find type `A` in this scope
   --> $DIR/glob-resolve1.rs:28:11
    |
 LL |     pub enum B { B1 }
-   |     ----------------- similarly named enum `B` defined here
+   |     ---------- similarly named enum `B` defined here
 ...
 LL |     foo::<A>();
    |           ^
@@ -65,7 +65,7 @@ error[E0412]: cannot find type `C` in this scope
   --> $DIR/glob-resolve1.rs:29:11
    |
 LL |     pub enum B { B1 }
-   |     ----------------- similarly named enum `B` defined here
+   |     ---------- similarly named enum `B` defined here
 ...
 LL |     foo::<C>();
    |           ^
@@ -83,7 +83,7 @@ error[E0412]: cannot find type `D` in this scope
   --> $DIR/glob-resolve1.rs:30:11
    |
 LL |     pub enum B { B1 }
-   |     ----------------- similarly named enum `B` defined here
+   |     ---------- similarly named enum `B` defined here
 ...
 LL |     foo::<D>();
    |           ^
diff --git a/src/test/ui/issues/issue-31845.stderr b/src/test/ui/issues/issue-31845.stderr
index 75d8859961a..fe51fa0699f 100644
--- a/src/test/ui/issues/issue-31845.stderr
+++ b/src/test/ui/issues/issue-31845.stderr
@@ -1,11 +1,10 @@
 error[E0425]: cannot find function `g` in this scope
   --> $DIR/issue-31845.rs:7:12
    |
-LL | /         fn h() {
-LL | |            g();
-   | |            ^ help: a function with a similar name exists: `h`
-LL | |         }
-   | |_________- similarly named function `h` defined here
+LL |         fn h() {
+   |         ------ similarly named function `h` defined here
+LL |            g();
+   |            ^ help: a function with a similar name exists: `h`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/issues/issue-46332.stderr b/src/test/ui/issues/issue-46332.stderr
index 5d8a859a737..890ef8014b4 100644
--- a/src/test/ui/issues/issue-46332.stderr
+++ b/src/test/ui/issues/issue-46332.stderr
@@ -2,7 +2,7 @@ error[E0422]: cannot find struct, variant or union type `TyUInt` in this scope
   --> $DIR/issue-46332.rs:9:5
    |
 LL | struct TyUint {}
-   | ---------------- similarly named struct `TyUint` defined here
+   | ------------- similarly named struct `TyUint` defined here
 ...
 LL |     TyUInt {};
    |     ^^^^^^ help: a struct with a similar name exists (notice the capitalization): `TyUint`
diff --git a/src/test/ui/macros/macro_undefined.stderr b/src/test/ui/macros/macro_undefined.stderr
index b2caba893e0..4ab16bd1017 100644
--- a/src/test/ui/macros/macro_undefined.stderr
+++ b/src/test/ui/macros/macro_undefined.stderr
@@ -1,13 +1,11 @@
 error: cannot find macro `k` in this scope
   --> $DIR/macro_undefined.rs:11:5
    |
-LL | /     macro_rules! kl {
-LL | |         () => ()
-LL | |     }
-   | |_____- similarly named macro `kl` defined here
+LL |     macro_rules! kl {
+   |     --------------- similarly named macro `kl` defined here
 ...
-LL |       k!();
-   |       ^ help: a macro with a similar name exists: `kl`
+LL |     k!();
+   |     ^ help: a macro with a similar name exists: `kl`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/privacy/legacy-ctor-visibility.stderr b/src/test/ui/privacy/legacy-ctor-visibility.stderr
index 74a1f1ceeff..4f0d72de6f1 100644
--- a/src/test/ui/privacy/legacy-ctor-visibility.stderr
+++ b/src/test/ui/privacy/legacy-ctor-visibility.stderr
@@ -1,12 +1,10 @@
 error[E0423]: expected function, tuple struct or tuple variant, found struct `S`
   --> $DIR/legacy-ctor-visibility.rs:9:13
    |
-LL | /         fn f() {
-LL | |             S(10);
-   | |             ^ help: a function with a similar name exists: `f`
-LL | |
-LL | |         }
-   | |_________- similarly named function `f` defined here
+LL |         fn f() {
+   |         ------ similarly named function `f` defined here
+LL |             S(10);
+   |             ^ help: a function with a similar name exists: `f`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/proc-macro/resolve-error.stderr b/src/test/ui/proc-macro/resolve-error.stderr
index 73a6ab1cfb9..15a1d6d9479 100644
--- a/src/test/ui/proc-macro/resolve-error.stderr
+++ b/src/test/ui/proc-macro/resolve-error.stderr
@@ -18,24 +18,20 @@ LL |     Dlona!();
 error: cannot find macro `attr_proc_macra` in this scope
   --> $DIR/resolve-error.rs:58:5
    |
-LL | / macro_rules! attr_proc_mac {
-LL | |     () => {}
-LL | | }
-   | |_- similarly named macro `attr_proc_mac` defined here
+LL | macro_rules! attr_proc_mac {
+   | -------------------------- similarly named macro `attr_proc_mac` defined here
 ...
-LL |       attr_proc_macra!();
-   |       ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `attr_proc_mac`
+LL |     attr_proc_macra!();
+   |     ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `attr_proc_mac`
 
 error: cannot find macro `FooWithLongNama` in this scope
   --> $DIR/resolve-error.rs:55:5
    |
-LL | / macro_rules! FooWithLongNam {
-LL | |     () => {}
-LL | | }
-   | |_- similarly named macro `FooWithLongNam` defined here
+LL | macro_rules! FooWithLongNam {
+   | --------------------------- similarly named macro `FooWithLongNam` defined here
 ...
-LL |       FooWithLongNama!();
-   |       ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `FooWithLongNam`
+LL |     FooWithLongNama!();
+   |     ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `FooWithLongNam`
 
 error: cannot find derive macro `attr_proc_macra` in this scope
   --> $DIR/resolve-error.rs:49:10
diff --git a/src/test/ui/resolve/issue-5035.stderr b/src/test/ui/resolve/issue-5035.stderr
index 1674c166dda..622f0dfcda4 100644
--- a/src/test/ui/resolve/issue-5035.stderr
+++ b/src/test/ui/resolve/issue-5035.stderr
@@ -8,7 +8,7 @@ error[E0404]: expected trait, found type alias `K`
   --> $DIR/issue-5035.rs:3:6
    |
 LL | trait I {}
-   | ---------- similarly named trait `I` defined here
+   | ------- similarly named trait `I` defined here
 LL | type K = dyn I;
 LL | impl K for isize {}
    |      ^
diff --git a/src/test/ui/resolve/levenshtein.stderr b/src/test/ui/resolve/levenshtein.stderr
index a622d6cb349..ecdec3c24a1 100644
--- a/src/test/ui/resolve/levenshtein.stderr
+++ b/src/test/ui/resolve/levenshtein.stderr
@@ -8,7 +8,7 @@ error[E0412]: cannot find type `Baz` in this scope
   --> $DIR/levenshtein.rs:14:10
    |
 LL | enum Bar { }
-   | ------------ similarly named enum `Bar` defined here
+   | -------- similarly named enum `Bar` defined here
 LL | 
 LL | type A = Baz; // Misspelled type name.
    |          ^^^ help: an enum with a similar name exists: `Bar`
@@ -43,7 +43,7 @@ error[E0425]: cannot find function `foobar` in this scope
   --> $DIR/levenshtein.rs:30:5
    |
 LL | fn foo_bar() {}
-   | --------------- similarly named function `foo_bar` defined here
+   | ------------ similarly named function `foo_bar` defined here
 ...
 LL |     foobar(); // Misspelled function name.
    |     ^^^^^^ help: a function with a similar name exists: `foo_bar`
diff --git a/src/test/ui/resolve/privacy-enum-ctor.stderr b/src/test/ui/resolve/privacy-enum-ctor.stderr
index 08a1d790197..1187a661bbe 100644
--- a/src/test/ui/resolve/privacy-enum-ctor.stderr
+++ b/src/test/ui/resolve/privacy-enum-ctor.stderr
@@ -16,15 +16,11 @@ LL |         m::Z::Unit;
 error[E0423]: expected value, found enum `Z`
   --> $DIR/privacy-enum-ctor.rs:25:9
    |
-LL | /     fn f() {
-LL | |         n::Z;
-LL | |
-LL | |         Z;
-   | |         ^
-...  |
-LL | |         // This is ok, it is equivalent to not having braces
-LL | |     }
-   | |_____- similarly named function `f` defined here
+LL |     fn f() {
+   |     ------ similarly named function `f` defined here
+...
+LL |         Z;
+   |         ^
    |
 help: a function with a similar name exists
    |
@@ -53,17 +49,11 @@ LL |           let _: Z = Z::Struct;
 error[E0423]: expected value, found enum `m::E`
   --> $DIR/privacy-enum-ctor.rs:41:16
    |
-LL | /     fn f() {
-LL | |         n::Z;
-LL | |
-LL | |         Z;
-...  |
-LL | |         // This is ok, it is equivalent to not having braces
-LL | |     }
-   | |_____- similarly named function `f` defined here
+LL |     fn f() {
+   |     ------ similarly named function `f` defined here
 ...
-LL |       let _: E = m::E;
-   |                  ^^^^
+LL |     let _: E = m::E;
+   |                ^^^^
    |
 help: a function with a similar name exists
    |
@@ -130,17 +120,11 @@ LL |       let _: E = E::Struct;
 error[E0412]: cannot find type `Z` in this scope
   --> $DIR/privacy-enum-ctor.rs:57:12
    |
-LL | /     pub enum E {
-LL | |         Fn(u8),
-LL | |         Struct {
-LL | |             s: u8,
-LL | |         },
-LL | |         Unit,
-LL | |     }
-   | |_____- similarly named enum `E` defined here
+LL |     pub enum E {
+   |     ---------- similarly named enum `E` defined here
 ...
-LL |       let _: Z = m::n::Z;
-   |              ^
+LL |     let _: Z = m::n::Z;
+   |            ^
    |
 help: an enum with a similar name exists
    |
@@ -169,17 +153,11 @@ LL |     let _: Z = m::Z::Unit;
 error[E0412]: cannot find type `Z` in this scope
   --> $DIR/privacy-enum-ctor.rs:61:12
    |
-LL | /     pub enum E {
-LL | |         Fn(u8),
-LL | |         Struct {
-LL | |             s: u8,
-LL | |         },
-LL | |         Unit,
-LL | |     }
-   | |_____- similarly named enum `E` defined here
+LL |     pub enum E {
+   |     ---------- similarly named enum `E` defined here
 ...
-LL |       let _: Z = m::n::Z::Fn;
-   |              ^
+LL |     let _: Z = m::n::Z::Fn;
+   |            ^
    |
 help: an enum with a similar name exists
    |
@@ -193,17 +171,11 @@ LL | use m::n::Z;
 error[E0412]: cannot find type `Z` in this scope
   --> $DIR/privacy-enum-ctor.rs:64:12
    |
-LL | /     pub enum E {
-LL | |         Fn(u8),
-LL | |         Struct {
-LL | |             s: u8,
-LL | |         },
-LL | |         Unit,
-LL | |     }
-   | |_____- similarly named enum `E` defined here
+LL |     pub enum E {
+   |     ---------- similarly named enum `E` defined here
 ...
-LL |       let _: Z = m::n::Z::Struct;
-   |              ^
+LL |     let _: Z = m::n::Z::Struct;
+   |            ^
    |
 help: an enum with a similar name exists
    |
@@ -228,17 +200,11 @@ LL |       let _: Z = m::n::Z::Struct;
 error[E0412]: cannot find type `Z` in this scope
   --> $DIR/privacy-enum-ctor.rs:68:12
    |
-LL | /     pub enum E {
-LL | |         Fn(u8),
-LL | |         Struct {
-LL | |             s: u8,
-LL | |         },
-LL | |         Unit,
-LL | |     }
-   | |_____- similarly named enum `E` defined here
+LL |     pub enum E {
+   |     ---------- similarly named enum `E` defined here
 ...
-LL |       let _: Z = m::n::Z::Unit {};
-   |              ^
+LL |     let _: Z = m::n::Z::Unit {};
+   |            ^
    |
 help: an enum with a similar name exists
    |
diff --git a/src/test/ui/traits/trait-impl-for-module.stderr b/src/test/ui/traits/trait-impl-for-module.stderr
index 4b3c930dccd..cd2713a5bd5 100644
--- a/src/test/ui/traits/trait-impl-for-module.stderr
+++ b/src/test/ui/traits/trait-impl-for-module.stderr
@@ -1,12 +1,11 @@
 error[E0573]: expected type, found module `a`
   --> $DIR/trait-impl-for-module.rs:7:12
    |
-LL | / trait A {
-LL | | }
-   | |_- similarly named trait `A` defined here
-LL | 
-LL |   impl A for a {
-   |              ^ help: a trait with a similar name exists: `A`
+LL | trait A {
+   | ------- similarly named trait `A` defined here
+...
+LL | impl A for a {
+   |            ^ help: a trait with a similar name exists: `A`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/ufcs/ufcs-partially-resolved.stderr b/src/test/ui/ufcs/ufcs-partially-resolved.stderr
index 7177ca49085..3950dc9877c 100644
--- a/src/test/ui/ufcs/ufcs-partially-resolved.stderr
+++ b/src/test/ui/ufcs/ufcs-partially-resolved.stderr
@@ -35,7 +35,7 @@ error[E0576]: cannot find method or associated constant `N` in trait `Tr`
   --> $DIR/ufcs-partially-resolved.rs:22:17
    |
 LL |     fn Y() {}
-   |     --------- similarly named associated function `Y` defined here
+   |     ------ similarly named associated function `Y` defined here
 ...
 LL |     <u8 as Tr>::N;
    |                 ^ help: an associated function with a similar name exists: `Y`
@@ -181,7 +181,7 @@ error[E0575]: expected method or associated constant, found associated type `Dr:
   --> $DIR/ufcs-partially-resolved.rs:53:5
    |
 LL |     fn Z() {}
-   |     --------- similarly named associated function `Z` defined here
+   |     ------ similarly named associated function `Z` defined here
 ...
 LL |     <u8 as Dr>::X;
    |     ^^^^^^^^^^^^-