rust/src/test/ui/resolve/tuple-struct-alias.stderr
Esteban Küber b26ddb8af3 Point at local similarly named element and tweak references to variants
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.
2019-10-27 11:50:43 -07:00

26 lines
908 B
Text

error[E0423]: expected function, tuple struct or tuple variant, found type alias `A`
--> $DIR/tuple-struct-alias.rs:5:13
|
LL | struct S(u8, u16);
| ------------------ similarly named tuple struct `S` defined here
...
LL | let s = A(0, 1);
| ^ help: a tuple struct with a similar name exists: `S`
|
= note: can't use a type alias as a constructor
error[E0532]: expected tuple struct or tuple variant, found type alias `A`
--> $DIR/tuple-struct-alias.rs:7:9
|
LL | struct S(u8, u16);
| ------------------ similarly named tuple struct `S` defined here
...
LL | A(..) => {}
| ^ help: a tuple struct with a similar name exists: `S`
|
= note: can't use a type alias as a constructor
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0423, E0532.
For more information about an error, try `rustc --explain E0423`.