diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-01-14 11:31:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-14 11:31:53 +0100 |
| commit | 0b7d8f99ed843cbb31989d0635a8c6651c28df38 (patch) | |
| tree | 054723885e65e445a82ea145c16c88b77b90589b /src/test/ui/resolve | |
| parent | 74cc0be8f6388aa2fc1ecaf18904c395a2306c40 (diff) | |
| parent | 404ad50d148af4ea388861d1f9a45dd9f5c43ef7 (diff) | |
Rollup merge of #57477 - euclio:clarify-lev-suggestion, r=zackmdavis
clarify resolve typo suggestion Include the kind of the binding that we're suggesting, and use a structured suggestion. Fixes #53445.
Diffstat (limited to 'src/test/ui/resolve')
| -rw-r--r-- | src/test/ui/resolve/issue-39226.stderr | 2 | ||||
| -rw-r--r-- | src/test/ui/resolve/issue-5035.stderr | 2 | ||||
| -rw-r--r-- | src/test/ui/resolve/levenshtein.stderr | 14 | ||||
| -rw-r--r-- | src/test/ui/resolve/privacy-enum-ctor.stderr | 34 | ||||
| -rw-r--r-- | src/test/ui/resolve/privacy-struct-ctor.stderr | 7 | ||||
| -rw-r--r-- | src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr | 10 | ||||
| -rw-r--r-- | src/test/ui/resolve/tuple-struct-alias.stderr | 4 |
7 files changed, 46 insertions, 27 deletions
diff --git a/src/test/ui/resolve/issue-39226.stderr b/src/test/ui/resolve/issue-39226.stderr index 3a93928aef9..c97fb4db6be 100644 --- a/src/test/ui/resolve/issue-39226.stderr +++ b/src/test/ui/resolve/issue-39226.stderr @@ -4,8 +4,8 @@ error[E0423]: expected value, found struct `Handle` LL | handle: Handle | ^^^^^^ | | - | did you mean `handle`? | did you mean `Handle { /* fields */ }`? + | help: a local variable with a similar name exists: `handle` error: aborting due to previous error diff --git a/src/test/ui/resolve/issue-5035.stderr b/src/test/ui/resolve/issue-5035.stderr index 39216c6ec0c..57ad5f22f4c 100644 --- a/src/test/ui/resolve/issue-5035.stderr +++ b/src/test/ui/resolve/issue-5035.stderr @@ -10,8 +10,8 @@ error[E0404]: expected trait, found type alias `K` LL | impl K for isize {} //~ ERROR expected trait, found type alias `K` | ^ | | - | did you mean `I`? | type aliases cannot be used as traits + | help: a trait with a similar name exists: `I` | = note: did you mean to use a trait alias? diff --git a/src/test/ui/resolve/levenshtein.stderr b/src/test/ui/resolve/levenshtein.stderr index df075d15d7f..cddfe4e7ff5 100644 --- a/src/test/ui/resolve/levenshtein.stderr +++ b/src/test/ui/resolve/levenshtein.stderr @@ -2,19 +2,19 @@ error[E0412]: cannot find type `esize` in this scope --> $DIR/levenshtein.rs:5:11 | LL | fn foo(c: esize) {} // Misspelled primitive type name. - | ^^^^^ did you mean `isize`? + | ^^^^^ help: a primitive type with a similar name exists: `isize` error[E0412]: cannot find type `Baz` in this scope --> $DIR/levenshtein.rs:10:10 | LL | type A = Baz; // Misspelled type name. - | ^^^ did you mean `Bar`? + | ^^^ help: an enum with a similar name exists: `Bar` error[E0412]: cannot find type `Opiton` in this scope --> $DIR/levenshtein.rs:12:10 | LL | type B = Opiton<u8>; // Misspelled type name from the prelude. - | ^^^^^^ did you mean `Option`? + | ^^^^^^ help: an enum with a similar name exists: `Option` error[E0412]: cannot find type `Baz` in this scope --> $DIR/levenshtein.rs:16:14 @@ -26,25 +26,25 @@ error[E0425]: cannot find value `MAXITEM` in this scope --> $DIR/levenshtein.rs:24:20 | LL | let v = [0u32; MAXITEM]; // Misspelled constant name. - | ^^^^^^^ did you mean `MAX_ITEM`? + | ^^^^^^^ help: a constant with a similar name exists: `MAX_ITEM` error[E0425]: cannot find function `foobar` in this scope --> $DIR/levenshtein.rs:26:5 | LL | foobar(); // Misspelled function name. - | ^^^^^^ did you mean `foo_bar`? + | ^^^^^^ help: a function with a similar name exists: `foo_bar` error[E0412]: cannot find type `first` in module `m` --> $DIR/levenshtein.rs:28:15 | LL | let b: m::first = m::second; // Misspelled item in module. - | ^^^^^ did you mean `First`? + | ^^^^^ help: a struct with a similar name exists: `First` error[E0425]: cannot find value `second` in module `m` --> $DIR/levenshtein.rs:28:26 | LL | let b: m::first = m::second; // Misspelled item in module. - | ^^^^^^ did you mean `Second`? + | ^^^^^^ help: a unit struct with a similar name exists: `Second` error: aborting due to 8 previous errors diff --git a/src/test/ui/resolve/privacy-enum-ctor.stderr b/src/test/ui/resolve/privacy-enum-ctor.stderr index 71b1ec46247..01f0941282e 100644 --- a/src/test/ui/resolve/privacy-enum-ctor.stderr +++ b/src/test/ui/resolve/privacy-enum-ctor.stderr @@ -13,7 +13,7 @@ error[E0423]: expected value, found enum `Z` --> $DIR/privacy-enum-ctor.rs:25:9 | LL | Z; - | ^ did you mean `f`? + | ^ help: a function with a similar name exists: `f` | = note: did you mean to use one of the following variants? - `m::Z::Fn` @@ -30,14 +30,16 @@ error[E0423]: expected value, found enum `m::E` --> $DIR/privacy-enum-ctor.rs:41:16 | LL | let _: E = m::E; - | ^^^- - | | - | did you mean `f`? + | ^^^^ | = note: did you mean to use one of the following variants? - `E::Fn` - `E::Struct` - `E::Unit` +help: a function with a similar name exists + | +LL | let _: E = m::f; + | ^ help: possible better candidates are found in other modules, you can import them into scope | LL | use std::f32::consts::E; @@ -78,7 +80,11 @@ error[E0412]: cannot find type `Z` in this scope --> $DIR/privacy-enum-ctor.rs:57:12 | LL | let _: Z = m::n::Z; - | ^ did you mean `E`? + | ^ +help: an enum with a similar name exists + | +LL | let _: E = m::n::Z; + | ^ help: possible candidate is found in another module, you can import it into scope | LL | use m::n::Z; @@ -99,7 +105,11 @@ error[E0412]: cannot find type `Z` in this scope --> $DIR/privacy-enum-ctor.rs:61:12 | LL | let _: Z = m::n::Z::Fn; - | ^ did you mean `E`? + | ^ +help: an enum with a similar name exists + | +LL | let _: E = m::n::Z::Fn; + | ^ help: possible candidate is found in another module, you can import it into scope | LL | use m::n::Z; @@ -109,7 +119,11 @@ error[E0412]: cannot find type `Z` in this scope --> $DIR/privacy-enum-ctor.rs:64:12 | LL | let _: Z = m::n::Z::Struct; - | ^ did you mean `E`? + | ^ +help: an enum with a similar name exists + | +LL | let _: E = m::n::Z::Struct; + | ^ help: possible candidate is found in another module, you can import it into scope | LL | use m::n::Z; @@ -125,7 +139,11 @@ error[E0412]: cannot find type `Z` in this scope --> $DIR/privacy-enum-ctor.rs:68:12 | LL | let _: Z = m::n::Z::Unit {}; - | ^ did you mean `E`? + | ^ +help: an enum with a similar name exists + | +LL | let _: E = m::n::Z::Unit {}; + | ^ help: possible candidate is found in another module, you can import it into scope | LL | use m::n::Z; diff --git a/src/test/ui/resolve/privacy-struct-ctor.stderr b/src/test/ui/resolve/privacy-struct-ctor.stderr index edb7a672edd..44ecf6b97bf 100644 --- a/src/test/ui/resolve/privacy-struct-ctor.stderr +++ b/src/test/ui/resolve/privacy-struct-ctor.stderr @@ -2,10 +2,11 @@ error[E0423]: expected value, found struct `Z` --> $DIR/privacy-struct-ctor.rs:20:9 | LL | Z; + | ^ constructor is not visible here due to private fields +help: a tuple struct with a similar name exists + | +LL | S; | ^ - | | - | did you mean `S`? - | constructor is not visible here due to private fields help: possible better candidate is found in another module, you can import it into scope | LL | use m::n::Z; diff --git a/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr b/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr index 157b4cc79df..8a9426bfee8 100644 --- a/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr +++ b/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr @@ -28,7 +28,7 @@ error[E0423]: expected value, found module `a::b` LL | a::b.J | ^^^--- | | | - | | did you mean `I`? + | | help: a constant with a similar name exists: `I` | did you mean `a::b::J`? error[E0423]: expected value, found module `a` @@ -45,7 +45,7 @@ error[E0423]: expected value, found module `a::b` LL | v.push(a::b); | ^^^- | | - | did you mean `I`? + | help: a constant with a similar name exists: `I` error[E0423]: expected value, found module `a::b` --> $DIR/suggest-path-instead-of-mod-dot-item.rs:45:5 @@ -53,7 +53,7 @@ error[E0423]: expected value, found module `a::b` LL | a::b.f() | ^^^----- | | | - | | did you mean `I`? + | | help: a constant with a similar name exists: `I` | did you mean `a::b::f(...)`? error[E0423]: expected value, found module `a::b` @@ -62,7 +62,7 @@ error[E0423]: expected value, found module `a::b` LL | a::b | ^^^- | | - | did you mean `I`? + | help: a constant with a similar name exists: `I` error[E0423]: expected function, found module `a::b` --> $DIR/suggest-path-instead-of-mod-dot-item.rs:55:5 @@ -70,7 +70,7 @@ error[E0423]: expected function, found module `a::b` LL | a::b() | ^^^- | | - | did you mean `I`? + | help: a constant with a similar name exists: `I` error: aborting due to 9 previous errors diff --git a/src/test/ui/resolve/tuple-struct-alias.stderr b/src/test/ui/resolve/tuple-struct-alias.stderr index 6338c340c23..f299aa40a31 100644 --- a/src/test/ui/resolve/tuple-struct-alias.stderr +++ b/src/test/ui/resolve/tuple-struct-alias.stderr @@ -2,7 +2,7 @@ error[E0423]: expected function, found type alias `A` --> $DIR/tuple-struct-alias.rs:5:13 | LL | let s = A(0, 1); //~ ERROR expected function - | ^ did you mean `S`? + | ^ help: a tuple struct with a similar name exists: `S` | = note: can't use a type alias as a constructor @@ -10,7 +10,7 @@ error[E0532]: expected tuple struct/variant, found type alias `A` --> $DIR/tuple-struct-alias.rs:7:9 | LL | A(..) => {} //~ ERROR expected tuple struct/variant - | ^ did you mean `S`? + | ^ help: a tuple struct with a similar name exists: `S` | = note: can't use a type alias as a constructor |
