@@ -29,22 +29,21 @@ Rust book) to the `nested_borrow_mut` and `borrow_mut` functions. In both cases
2929the input is a reference to ` self ` , so the compiler attempts to assign the
3030the same lifetime to the input and output.
3131
32- Looking specifically at ` nested_borrow_mut ` ,
33- we see that there are three object references to keep track of,
34- along with their associated lifetimes:
32+ Looking specifically at ` nested_borrow_mut ` , we see that there are three object
33+ references to keep track of, along with their associated lifetimes:
3534- ` self ` (which is a ` &mut T ` )
3635- ` u_ref ` (which is a ` &mut U ` )
3736- ` v_ref ` (which is a ` &mut V ` )
3837
3938The ` borrow_mut() ` method implicitly requires that that the input and output
40- have the same lifetime bounds. Thus:
39+ have the same lifetime bounds. Thus the lines :
4140
4241``` rust
4342 let u_ref = self . borrow_mut ();
4443 let v_ref = u_ref . borrow_mut ();
4544```
4645
47- Imply that ` u_ref ` and ` self ` must share a lifetime bound, and also that
46+ imply that ` u_ref ` and ` self ` must share a lifetime bound, and also that
4847` v_ref ` and ` u_ref ` share a lifetime bound. The problem is that the function
4948signature for ` nested_borrow_mut ` only gives the compiler information about the
5049lifetimes of ` self ` and ` v_ref ` -- nothing about ` u_ref ` .
0 commit comments