-
Notifications
You must be signed in to change notification settings - Fork 13.4k
TRPL: type aliases and unsized types #24675
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
Conversation
} | ||
``` | ||
|
||
This compiles without error. `Num` types are the same as `i32`s, in every way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this means "values of type Num
"? It's a bit confusing as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noted, and updated
Nicely written. Could you perhaps add a more motivating example for |
@killercup ahh yes, good call 👍 |
The type Result<T> = result::Result<T, ConcreteError>; (e.g. |
} | ||
``` | ||
|
||
This `?` means that this bound is special: it lets us match more kinds, not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this could mention something like "?Sized
is normally read as 'maybe not sized'"? I guess just getting the phrase "maybe unsized" may help a bit.
I think the unsized type section may also want some motivating examples as well. For example it enables |
7799a79
to
defdc44
Compare
Updated! |
🙀 |
…lexcrichton Two more chapters of TRPL. The `type` one is pretty straightforward, but I wasn't really sure what to put for unsized types. I just explained the very basics, and the special bounds syntax. Thoughts on what else should go here? r? @alexcrichton
Two more chapters of TRPL. The
type
one is pretty straightforward, but I wasn't really sure what to put for unsized types. I just explained the very basics, and the special bounds syntax. Thoughts on what else should go here?r? @alexcrichton