You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0308]: mismatched types
--> src/main.rs:4:26
|
4 |let b: fn() -> u32 = bar;
| ----------- ^^^ expected fn pointer, found fn item
||| expected due to this
|
= note: expected fn pointer `fn() -> u32` found fn item `fn() {bar}`
Desired output
error[E0308]: mismatched types
--> src/main.rs:4:26
|
4 |let b: fn() -> u32 = bar;
| ----------- ^^^ `fn`return types do not match, expected `fn() -> u32`, found `fn() -> ()`||| expected due to this
Rationale and extra context
The current version is not wrong, but it is a bit confusing when one does not know the way rustc handles fn stuff.
I think that leading with what is not matching up would make it easier to see one's error. Especially in context for example of RA, where in-line errors only show the 'main' message.
Other cases
No response
Rust Version
Playground, Stable 1.79.0
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Rollup merge of rust-lang#127417 - chenyukang:yukang-method-output-diff, r=oli-obk
Show fnsig's unit output explicitly when there is output diff in diagnostics
Fixesrust-lang#127263
Code
Current output
Desired output
Rationale and extra context
The current version is not wrong, but it is a bit confusing when one does not know the way rustc handles
fn
stuff.I think that leading with what is not matching up would make it easier to see one's error. Especially in context for example of RA, where in-line errors only show the 'main' message.
Other cases
No response
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: