Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ch17-02: Mmonomorphization applies to generics in general #3367

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

bravequickcleverfibreyarn
Copy link
Contributor

@bravequickcleverfibreyarn bravequickcleverfibreyarn commented Oct 1, 2022

  • 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.

@carols10cents
Copy link
Member

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 carols10cents added this to the ch17 milestone Oct 20, 2022
`Vec<T>` denotes generic type. As this chapter kindly describes Rust generics cannot hold 2 or more struct kinds.
Beside trait bounds are discussed in 10.2 not in 10.1, _monomorphization_ relates to generics in general not only those bound by/to trait.
@bravequickcleverfibreyarn
Copy link
Contributor Author

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

@bravequickcleverfibreyarn bravequickcleverfibreyarn changed the title Type parameter removal Mmonomorphization applies to generics in general Oct 22, 2022
@bravequickcleverfibreyarn bravequickcleverfibreyarn changed the title Mmonomorphization applies to generics in general ch17-02: Mmonomorphization applies to generics in general Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants