-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints
Description
Steps to reproduce:
- Have a function that takes a reference
- Call that function passing an expression using
? - Forget an
&
Output:
error[E0308]: try expression alternatives have incompatible types
--> src/main.rs:5:9
|
5 | foo(bar()?);
| ^^^^^^
| |
| expected &i32, found i32
| help: try wrapping with a success variant: `Ok(bar()?)`
|
= note: expected type `&i32`
found type `i32`
Expected output:
error[E0308]: mismatched types
--> src/main.rs:5:9
|
5 | foo(bar()?);
| ^^^^^^
| |
| expected &i32, found i32
| help: consider borrowing here: `&bar()?`
|
= note: expected type `&i32`
found type `i32`
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints