diff options
| author | Matthew Kelly <matthew.kelly2@gmail.com> | 2022-08-24 20:50:02 -0400 |
|---|---|---|
| committer | Matthew Kelly <matthew.kelly2@gmail.com> | 2022-08-24 20:51:48 -0400 |
| commit | fc02eee8f6b433c8485086d3e97ae499b53b240b (patch) | |
| tree | 4f705b3bf910889ff8fe401ebed7ecac64f25e0b /compiler/rustc_error_codes | |
| parent | dd7c48e52937dade956379f3faf7a1bff1b95a5f (diff) | |
| download | rust-fc02eee8f6b433c8485086d3e97ae499b53b240b.tar.gz rust-fc02eee8f6b433c8485086d3e97ae499b53b240b.zip | |
fix wrapping
Diffstat (limited to 'compiler/rustc_error_codes')
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0311.md | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0311.md b/compiler/rustc_error_codes/src/error_codes/E0311.md index a9d44dcdcee..9521adc2522 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0311.md +++ b/compiler/rustc_error_codes/src/error_codes/E0311.md @@ -29,22 +29,21 @@ Rust book) to the `nested_borrow_mut` and `borrow_mut` functions. In both cases the input is a reference to `self`, so the compiler attempts to assign the the same lifetime to the input and output. -Looking specifically at `nested_borrow_mut`, -we see that there are three object references to keep track of, -along with their associated lifetimes: +Looking specifically at `nested_borrow_mut`, we see that there are three object +references to keep track of, along with their associated lifetimes: - `self` (which is a `&mut T`) - `u_ref` (which is a `&mut U`) - `v_ref` (which is a `&mut V`) The `borrow_mut()` method implicitly requires that that the input and output -have the same lifetime bounds. Thus: +have the same lifetime bounds. Thus the lines: ```rust let u_ref = self.borrow_mut(); let v_ref = u_ref.borrow_mut(); ``` -Imply that `u_ref` and `self` must share a lifetime bound, and also that +imply that `u_ref` and `self` must share a lifetime bound, and also that `v_ref` and `u_ref` share a lifetime bound. The problem is that the function signature for `nested_borrow_mut` only gives the compiler information about the lifetimes of `self` and `v_ref` -- nothing about `u_ref`. |
