b26ddb8af3
Point at the span for the definition of ADTs internal to the current crate. Look at the leading char of the ident to determine whether we're expecting a likely fn or any of a fn, a tuple struct or a tuple variant. Turn fn `add_typo_suggestion` into a `Resolver` method.
15 lines
331 B
Rust
15 lines
331 B
Rust
enum Enum {
|
|
Foo { a: usize, b: usize },
|
|
Bar(usize, usize),
|
|
}
|
|
|
|
fn main() {
|
|
let x = Enum::Foo(a: 3, b: 4);
|
|
//~^ ERROR expected type, found `3`
|
|
match x {
|
|
Enum::Foo(a, b) => {}
|
|
//~^ ERROR expected tuple struct or tuple variant, found struct variant `Enum::Foo`
|
|
Enum::Bar(a, b) => {}
|
|
}
|
|
}
|