Skip to content

Commit

Permalink
Rollup merge of rust-lang#40797 - GAJaloyan:patch-1, r=arielb1
Browse files Browse the repository at this point in the history
Correcting mistakes in the README.md

Correcting the two mistakes in the README.md (issue rust-lang#40793)
  • Loading branch information
frewsxcv authored Apr 7, 2017
2 parents 4c59c92 + c80868e commit d860b1c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/librustc_borrowck/borrowck/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ ALIASABLE(*LV, MQ) // M-Deref-Unique
ALIASABLE(LV, MQ)
```

### Checking mutability of immutable pointer types
### Checking aliasability of immutable pointer types

Immutable pointer types like `&T` are aliasable, and hence can only be
borrowed immutably:
Expand All @@ -357,7 +357,7 @@ ALIASABLE(*LV, imm) // M-Deref-Borrowed-Imm
TYPE(LV) = &Ty
```

### Checking mutability of mutable pointer types
### Checking aliasability of mutable pointer types

`&mut T` can be frozen, so it is acceptable to borrow it as either imm or mut:

Expand Down Expand Up @@ -633,7 +633,7 @@ Here is a concrete example of a bug this rule prevents:

```rust
// Test region-reborrow-from-shorter-mut-ref.rs:
fn copy_pointer<'a,'b,T>(x: &'a mut &'b mut T) -> &'b mut T {
fn copy_borrowed_ptr<'a,'b,T>(x: &'a mut &'b mut T) -> &'b mut T {
&mut **p // ERROR due to clause (1)
}
fn main() {
Expand Down

0 comments on commit d860b1c

Please sign in to comment.