diff options
| author | bors <bors@rust-lang.org> | 2020-02-18 17:51:29 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-02-18 17:51:29 +0000 |
| commit | e620d0f337d0643c757bab791fc7d88d63217704 (patch) | |
| tree | d818d3abfb3a7a894dd5d497f9d3e00c15eb29c8 /src/librustc_error_codes/error_codes | |
| parent | b0d5813fd7fe4696b6eb61acf473a7f7a5f9b5a0 (diff) | |
| parent | 210b18118e3e59ed84b87de4716b98dc4cc393bd (diff) | |
| download | rust-e620d0f337d0643c757bab791fc7d88d63217704.tar.gz rust-e620d0f337d0643c757bab791fc7d88d63217704.zip | |
Auto merge of #69262 - Dylan-DPC:rollup-m6dt9cn, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - #69181 (Change const eval to just return the value ) - #69192 (Add more regression tests) - #69200 (Fix printing of `Yield` terminator) - #69205 (Allow whitespaces in revision flags) - #69233 (Clean up E0310 explanation) Failed merges: r? @ghost
Diffstat (limited to 'src/librustc_error_codes/error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0310.md | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/librustc_error_codes/error_codes/E0310.md b/src/librustc_error_codes/error_codes/E0310.md index be87ccb114a..8d4311d018b 100644 --- a/src/librustc_error_codes/error_codes/E0310.md +++ b/src/librustc_error_codes/error_codes/E0310.md @@ -1,7 +1,7 @@ -Types in type definitions have lifetimes associated with them that represent -how long the data stored within them is guaranteed to be live. This lifetime -must be as long as the data needs to be alive, and missing the constraint that -denotes this will cause this error. +A parameter type is missing a lifetime constraint or has a lifetime that +does not live long enough. + +Erroneous code example: ```compile_fail,E0310 // This won't compile because T is not constrained to the static lifetime @@ -11,6 +11,11 @@ struct Foo<T> { } ``` +Type parameters in type definitions have lifetimes associated with them that +represent how long the data stored within them is guaranteed to live. This +lifetime must be as long as the data needs to be alive, and missing the +constraint that denotes this will cause this error. + This will compile, because it has the constraint on the type parameter: ``` |
