book icon indicating copy to clipboard operation
book copied to clipboard

ch17-02: Mmonomorphization applies to generics in general

Open deep-outcome opened this issue 3 years ago • 2 comments
trafficstars

  • ~Vec<T> denotes generic type with unconstrained T type parameter. As this chapter kindly describes Rust generics cannot hold 2 or more struct kinds. Vec is sufficient and proper at this place.~
  • Beside trait bounds are discussed later in 10.2 not in 10.1, monomorphization relates to generics in general not only those bound by/to trait.

deep-outcome avatar Oct 01 '22 19:10 deep-outcome

There is no Vec defined in the standard library, only Vec<T>. In this case, T becomes Box<dyn Draw>, it doesn't get rid of T.

If you remove that change, I'll consider merging the other change. Thanks!

carols10cents avatar Oct 20 '22 21:10 carols10cents

I acknowledge my error. It is just type name, not any kind of declaration.

deep-outcome avatar Oct 21 '22 19:10 deep-outcome