diff options
Diffstat (limited to 'src/doc/book/redirects/unsized-types.md')
-rw-r--r-- | src/doc/book/redirects/unsized-types.md | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/doc/book/redirects/unsized-types.md b/src/doc/book/redirects/unsized-types.md new file mode 100644 index 000000000..bd9582cba --- /dev/null +++ b/src/doc/book/redirects/unsized-types.md @@ -0,0 +1,18 @@ +% Unsized Types + +<small>There is a new edition of the book and this is an old link.</small> + +> Sometimes referred to as ‘DSTs’ or ‘unsized types’, these types let us talk about types whose size we can only know at runtime. +> The `Sized` trait is automatically implemented for everything the compiler knows the size of at compile time. +> A trait bound on `?Sized` is the opposite of a trait bound on `Sized`; that is, we would read this as “`T` may or may not be `Sized`”. + +```rust,ignore +fn generic<T: ?Sized>(t: &T) { + // ...snip... +} +``` + +--- + +You can find the latest version of this information +[here](ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait).
\ No newline at end of file |