mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Rollup merge of #30689 - Manishearth:lifetime-bound, r=steveklabnik
We should have stuff on this in the book somewhere too r? @steveklabnik
This commit is contained in:
commit
b29628ac91
@ -132,7 +132,8 @@
|
||||
<!-- Constraints -->
|
||||
|
||||
* `T: U`: generic parameter `T` constrained to types that implement `U`. See [Traits].
|
||||
* `T: 'a`: generic type `T` must outlive lifetime `'a`.
|
||||
* `T: 'a`: generic type `T` must outlive lifetime `'a`. When we say that a type 'outlives' the lifetime, we mean that it cannot transitively contain any references with lifetimes shorter than `'a`.
|
||||
* `T : 'static`: The generic type `T` contains no borrowed references other than `'static` ones.
|
||||
* `'b: 'a`: generic lifetime `'b` must outlive lifetime `'a`.
|
||||
* `T: ?Sized`: allow generic type parameter to be a dynamically-sized type. See [Unsized Types (`?Sized`)].
|
||||
* `'a + trait`, `trait + trait`: compound type constraint. See [Traits (Multiple Trait Bounds)].
|
||||
|
Loading…
Reference in New Issue
Block a user