File tree 1 file changed +3
-3
lines changed
src/librustc_borrowck/borrowck 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -347,7 +347,7 @@ ALIASABLE(*LV, MQ) // M-Deref-Unique
347
347
ALIASABLE(LV, MQ)
348
348
```
349
349
350
- ### Checking mutability of immutable pointer types
350
+ ### Checking aliasability of immutable pointer types
351
351
352
352
Immutable pointer types like ` &T ` are aliasable, and hence can only be
353
353
borrowed immutably:
@@ -357,7 +357,7 @@ ALIASABLE(*LV, imm) // M-Deref-Borrowed-Imm
357
357
TYPE(LV) = &Ty
358
358
```
359
359
360
- ### Checking mutability of mutable pointer types
360
+ ### Checking aliasability of mutable pointer types
361
361
362
362
` &mut T ` can be frozen, so it is acceptable to borrow it as either imm or mut:
363
363
@@ -633,7 +633,7 @@ Here is a concrete example of a bug this rule prevents:
633
633
634
634
``` rust
635
635
// Test region-reborrow-from-shorter-mut-ref.rs:
636
- fn copy_pointer <'a ,'b ,T >(x : & 'a mut & 'b mut T ) -> & 'b mut T {
636
+ fn copy_borrowed_ptr <'a ,'b ,T >(x : & 'a mut & 'b mut T ) -> & 'b mut T {
637
637
& mut * * p // ERROR due to clause (1)
638
638
}
639
639
fn main () {
You can’t perform that action at this time.
0 commit comments