diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-04-07 09:20:03 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-07 09:20:03 -0400 |
| commit | d860b1c0039eca3f013362a6f59b59d27c3e51dc (patch) | |
| tree | e0262a0c46af0ba912614c38b53c90ed6543083b /src | |
| parent | 4c59c92bc4d4d6e5b2b66c4cc08dd1a058283a0d (diff) | |
| parent | c80868e3b348f00d316ca411f9f3f2f3feb7e6a9 (diff) | |
Rollup merge of #40797 - GAJaloyan:patch-1, r=arielb1
Correcting mistakes in the README.md Correcting the two mistakes in the README.md (issue #40793)
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_borrowck/borrowck/README.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_borrowck/borrowck/README.md b/src/librustc_borrowck/borrowck/README.md index 5cfbd59d333..034b7cbadd9 100644 --- a/src/librustc_borrowck/borrowck/README.md +++ b/src/librustc_borrowck/borrowck/README.md @@ -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: @@ -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: @@ -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() { |
