-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suggest correct enum variant on typo
- Loading branch information
Showing
5 changed files
with
68 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
error[E0223]: ambiguous associated type | ||
error: no variant `B` on enum `S` | ||
--> $DIR/issue-34209.rs:17:9 | ||
| | ||
LL | S::B{ } => { }, | ||
| ^^^^ help: use fully-qualified syntax: `<S as Trait>::B` | ||
LL | S::B { } => { }, | ||
| ^^^^ help: did you mean: `S::A` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0223`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#[derive(Debug)] | ||
enum Shape { | ||
Square { size: i32 }, | ||
Circle { radius: i32 }, | ||
} | ||
|
||
struct S { | ||
x: usize, | ||
} | ||
|
||
fn main() { | ||
println!("My shape is {:?}", Shape::Squareee { size: 5}); | ||
println!("My shape is {:?}", Shape::Circl { size: 5}); | ||
println!("My shape is {:?}", Shape::Rombus{ size: 5}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error: no variant `Squareee` on enum `Shape` | ||
--> $DIR/suggest-variants.rs:12:34 | ||
| | ||
LL | println!("My shape is {:?}", Shape::Squareee { size: 5}); | ||
| ^^^^^^^^^^^^^^^ help: did you mean: `Shape::Square` | ||
|
||
error: no variant `Circl` on enum `Shape` | ||
--> $DIR/suggest-variants.rs:13:34 | ||
| | ||
LL | println!("My shape is {:?}", Shape::Circl { size: 5}); | ||
| ^^^^^^^^^^^^ help: did you mean: `Shape::Circle` | ||
|
||
error: no variant `Rombus` on enum `Shape` | ||
--> $DIR/suggest-variants.rs:14:34 | ||
| | ||
LL | println!("My shape is {:?}", Shape::Rombus{ size: 5}); | ||
| ^^^^^^^^^^^^^ unknown variant | ||
|
||
error: aborting due to 3 previous errors | ||
|