Rollup merge of #71438 - estebank:resolve-sugg-tiny, r=petrochenkov
Tweak some suggestions in `rustc_resolve`
This commit is contained in:
commit
ac62dcef05
7 changed files with 56 additions and 25 deletions
|
|
@ -4,7 +4,11 @@ error[E0404]: expected trait, found type alias `Bar`
|
|||
LL | impl Bar for Baz { }
|
||||
| ^^^ type aliases cannot be used as traits
|
||||
|
|
||||
= note: did you mean to use a trait alias?
|
||||
help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
|
||||
--> $DIR/two_files_data.rs:5:1
|
||||
|
|
||||
LL | type Bar = dyn Foo;
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -45,9 +45,12 @@ error[E0423]: expected value, found struct `T`
|
|||
--> $DIR/E0423.rs:14:8
|
||||
|
|
||||
LL | if T {} == T {} { println!("Ok"); }
|
||||
| ^---
|
||||
| |
|
||||
| help: surround the struct literal with parenthesis: `(T {})`
|
||||
| ^
|
||||
|
|
||||
help: surround the struct literal with parentheses
|
||||
|
|
||||
LL | if (T {}) == T {} { println!("Ok"); }
|
||||
| ^ ^
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,11 @@ error[E0404]: expected trait, found type alias `Foo`
|
|||
LL | impl Foo for S {
|
||||
| ^^^ type aliases cannot be used as traits
|
||||
|
|
||||
= note: did you mean to use a trait alias?
|
||||
help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
|
||||
--> $DIR/issue-3907.rs:5:1
|
||||
|
|
||||
LL | type Foo = dyn issue_3907::Foo;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
help: possible better candidate is found in another module, you can import it into scope
|
||||
|
|
||||
LL | use issue_3907::Foo;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,11 @@ LL | impl K for isize {}
|
|||
| 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?
|
||||
help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
|
||||
--> $DIR/issue-5035.rs:2:1
|
||||
|
|
||||
LL | type K = dyn I;
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,11 @@ error[E0404]: expected trait, found type alias `Typedef`
|
|||
LL | fn g<F:Typedef(isize) -> isize>(x: F) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ type aliases cannot be used as traits
|
||||
|
|
||||
= note: did you mean to use a trait alias?
|
||||
help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
|
||||
--> $DIR/unboxed-closure-sugar-nonexistent-trait.rs:4:1
|
||||
|
|
||||
LL | type Typedef = isize;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -46,9 +46,12 @@ error[E0423]: expected value, found struct variant `E::V`
|
|||
--> $DIR/struct-literal-variant-in-if.rs:10:13
|
||||
|
|
||||
LL | if x == E::V { field } {}
|
||||
| ^^^^----------
|
||||
| |
|
||||
| help: surround the struct literal with parenthesis: `(E::V { field })`
|
||||
| ^^^^
|
||||
|
|
||||
help: surround the struct literal with parentheses
|
||||
|
|
||||
LL | if x == (E::V { field }) {}
|
||||
| ^ ^
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/struct-literal-variant-in-if.rs:10:20
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue