explaine.rs icon indicating copy to clipboard operation
explaine.rs copied to clipboard

missing hint for default generic type parameter

Open phrohdoh opened this issue 5 years ago • 0 comments

What I expected

Please see https://users.rust-lang.org/t/a-question-about-syntax/52790/2 & https://doc.rust-lang.org/stable/book/ch19-03-advanced-traits.html#default-generic-type-parameters-and-operator-overloading.

Source code

 0 | struct Foo<T = String>(T);
   |              ↑
 1 | 
 2 | fn main() {
 3 |   let x: Foo = Foo(String::from("thunk"));
 4 |   let y: Foo<i32> = Foo(17);
 5 | }

Location: line 0, column 13

phrohdoh avatar Dec 15 '20 12:12 phrohdoh