Code
fn main() {
foo(1, 2.);
}
fn foo<T>(a: T, b: T) {}
Current output
error[E0308]: mismatched types
--> src/main.rs:2:12
|
2 | foo(1, 2.);
| --- ^^ expected integer, found floating-point number
| |
| arguments to this function are incorrect
|
note: function defined here
--> src/main.rs:4:4
|
4 | fn foo<T>(a: T, b: T) {}
| ^^^ ----
Desired output
error[E0308]: mismatched types
--> src/main.rs:2:12
|
2 | foo(1, 2.);
| --- - ^^ expected integer, found floating-point number
| | |
| | expected because that argument needs to match the integer type of this parameter
| |
| arguments to this function are incorrect
|
note: function defined here
--> src/main.rs:4:4
|
4 | fn foo<T>(a: T, b: T) {}
| ^^^ - ---- ----
| | | |
| | | this parameter needs to match the type of `a`
| | `b` needs to match the type of this parameter
| `a` and `b` both reference type parameter `T`
Rationale and extra context
No response
Other cases
No response
Anything else?
No response
Code
Current output
Desired output
Rationale and extra context
No response
Other cases
No response
Anything else?
No response