2017-10-28 18:44:05 -05:00
|
|
|
error[E0308]: mismatched types
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/issue-35241.rs:3:20
|
2017-10-28 18:44:05 -05:00
|
|
|
|
|
2019-08-07 00:29:10 -05:00
|
|
|
LL | struct Foo(u32);
|
2023-01-05 21:33:57 -06:00
|
|
|
| ---------- `Foo` defines a struct constructor here, which should be called
|
2022-06-08 13:07:59 -05:00
|
|
|
LL |
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | fn test() -> Foo { Foo }
|
2023-01-02 20:00:33 -06:00
|
|
|
| --- ^^^ expected `Foo`, found struct constructor
|
2020-03-11 22:38:21 -05:00
|
|
|
| |
|
2017-10-28 18:44:05 -05:00
|
|
|
| expected `Foo` because of return type
|
|
|
|
|
|
2023-01-05 21:09:14 -06:00
|
|
|
= note: expected struct `Foo`
|
|
|
|
found struct constructor `fn(u32) -> Foo {Foo}`
|
2022-10-18 21:53:47 -05:00
|
|
|
help: use parentheses to construct this tuple struct
|
2020-03-11 22:38:21 -05:00
|
|
|
|
|
2022-08-27 20:22:51 -05:00
|
|
|
LL | fn test() -> Foo { Foo(/* u32 */) }
|
|
|
|
| +++++++++++
|
2017-10-28 18:44:05 -05:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
2018-03-03 08:59:40 -06:00
|
|
|
For more information about this error, try `rustc --explain E0308`.
|