The confusion about the deep access to a path that has a loan for the path

The rule defined in 2094-nll - The Rust RFC Book says:

For deep accesses to the path lvalue, we consider borrows relevant if they meet one of the following criteria:

  • there is a loan for the path lvalue;

Consider this example

fn main(){
   let mut i = 0;
   let rf = &i;
   let mut b = 0;
   b = i; // #1 deep read
   println!("{rf}");
}

#1 is a deep read to i and is ok, however, there is a loan for path i. Is the bullet too brief to be not good enough to cover all the cases?

It seems to make sense to talk about what kind of loans are for different kinds of deep access.

  1. For deep read to the path lvalue, there is a mutable loan for the path lvalue
  2. For deep write to the path lvalue, there is a loan for the path lvalue

I suppose we should also have a case-by-case discussion for the rule:

there is a loan for some prefix of the path lvalue;

Is something I misunderstand?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.