2017-10-29 10:44:05 +11:00
|
|
|
error[E0308]: mismatched types
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/issue-35241.rs:3:20
|
2017-10-29 10:44:05 +11:00
|
|
|
|
|
2019-08-06 22:29:10 -07: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 21:07:59 +03:00
|
|
|
LL |
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | fn test() -> Foo { Foo }
|
2023-01-02 18:00:33 -08:00
|
|
|
| --- ^^^ expected `Foo`, found struct constructor
|
2020-03-11 20:38:21 -07:00
|
|
|
| |
|
2017-10-29 10:44:05 +11: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-11 20:38:21 -07:00
|
|
|
|
|
2022-08-28 01:22:51 +00:00
|
|
|
LL | fn test() -> Foo { Foo(/* u32 */) }
|
|
|
|
|
| +++++++++++
|
2017-10-29 10:44:05 +11:00
|
|
|
|
2023-11-21 15:44:16 +00:00
|
|
|
error: aborting due to 1 previous error
|
2017-10-29 10:44:05 +11:00
|
|
|
|
2018-03-03 15:59:40 +01:00
|
|
|
For more information about this error, try `rustc --explain E0308`.
|