Files
rust/tests/ui/structs
Esteban Küber 2e4a420db0 Explain that default field values aren't compatible with type parameters unless going through the type parameter
```
error[E0308]: mismatched types
  --> $DIR/struct-type-parameter-with-default.rs:5:12
   |
LL | struct Foo<T = String> {
   |            ---------- expected this type parameter
LL |     x: T = String::new(),
   |            ^^^^^^^^^^^^^ expected type parameter `T`, found `String`
   |
   = note: expected type parameter `T`
                      found struct `String`
   = note: the type of default fields referencing type parameters can't be assumed inside the struct defining them
```
2026-03-14 20:13:43 +00:00
..
2025-08-27 15:06:05 -04:00
2025-06-30 11:50:19 +05:00
2025-08-27 15:06:05 -04:00
2025-07-25 20:38:54 +05:00