diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2015-08-05 13:45:38 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2015-08-05 13:45:38 +0530 |
| commit | a497c6722ec31960fdbf2b6f49b2ba8a398a40ea (patch) | |
| tree | 8bf1fecb69078107e942939d668e32833e9e3f4e | |
| parent | 05083299fae33f44506bd40e17283433b66417a5 (diff) | |
| parent | 67455e29a1d611a71a3a528544649b1b3ac4df16 (diff) | |
| download | rust-a497c6722ec31960fdbf2b6f49b2ba8a398a40ea.tar.gz rust-a497c6722ec31960fdbf2b6f49b2ba8a398a40ea.zip | |
Rollup merge of #27525 - Gankro:nomvar, r=aturon
I thought this was actually a huge error and I'd have to rewrite a bunch but it looks like everything else was correct. Closes #27457 r? @aturon
| -rw-r--r-- | src/doc/nomicon/subtyping.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/doc/nomicon/subtyping.md b/src/doc/nomicon/subtyping.md index 3c57297f323..65dcb6a94e1 100644 --- a/src/doc/nomicon/subtyping.md +++ b/src/doc/nomicon/subtyping.md @@ -93,8 +93,8 @@ fn main() { The signature of `overwrite` is clearly valid: it takes mutable references to two values of the same type, and overwrites one with the other. If `&mut T` was -variant over T, then `&mut &'a str` would be a subtype of `&mut &'static str`, -since `&'a str` is a subtype of `&'static str`. Therefore the lifetime of +variant over T, then `&mut &'static str` would be a subtype of `&mut &'a str`, +since `&'static str` is a subtype of `&'a str`. Therefore the lifetime of `forever_str` would successfully be "shrunk" down to the shorter lifetime of `string`, and `overwrite` would be called successfully. `string` would subsequently be dropped, and `forever_str` would point to freed memory when we |
