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