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.
20 lines
347 B
Rust
20 lines
347 B
Rust
enum Foo {
|
|
Bar(i32),
|
|
Baz
|
|
}
|
|
|
|
struct S;
|
|
|
|
fn main() {
|
|
match Foo::Baz {
|
|
Foo::Bar => {}
|
|
//~^ ERROR expected unit struct, unit variant or constant, found tuple variant `Foo::Bar`
|
|
_ => {}
|
|
}
|
|
|
|
match S {
|
|
S(()) => {}
|
|
//~^ ERROR expected tuple struct or tuple variant, found unit struct `S`
|
|
}
|
|
}
|