Hi,
I just started using Rust this week. I'm coming from C++ and C# and Rust seems to do so many things better.
I tried to compile this program, but I get an error saying it can't infer the type:
use std::ops::*;
fn asd<T, T2 = f32>(x: T, y: T) -> T::Output
where T : Add
{
x + y
}
fn main()
{
asd(1, 2);
}
src/main.rs:15:5: 15:8 error: unable to infer enough type information about `_`; type annotations or generic parameter binding required [E0282]
src/main.rs:15 asd(1, 2);
^~~
I've specified the default for T2, so I think it should compile fine.
What am I doing wrong?