fn main() {
let i = Default::default();
println!("i = {}", i); // i = 0
}
As-Is:
error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
--> src/main.rs:2:13
|
2 | let i = Default::default();
| ^^^^^^^^^^^^^^^^^^ cannot call associated function of trait
|
help: use a fully-qualified path to a specific available implementation
|
2 | let i = </* self type */ as Default>::default();
| +++++++++++++++++++ +
Should-Be:
I am expecting error message something along the lines "explicit type expected / provide type information for variable i".