rust-typed-builder
rust-typed-builder copied to clipboard
#[builder(default = ...)] for generic field got error "expected type parameter, found concrete type"
#[derive(TypedBuilder)]
struct Foo<T> {
#[builder(default = 12)]
x: T,
}
error[E0308]: mismatched types
--> tests/tests.rs:60:29
|
59 | struct Foo<T> {
| - this type parameter
60 | #[builder(default = 12)]
| ^^ expected type parameter `T`, found integer
|
= note: expected type parameter `T`
found type `{integer}`