@@ -261,12 +261,11 @@ that will go into the final loan. We'll discuss in more detail below.
261
261
## Checking mutability
262
262
263
263
Checking mutability is fairly straightforward. We just want to prevent
264
- immutable data from being borrowed as mutable. Note that it is ok to
265
- borrow mutable data as immutable, since that is simply a
266
- freeze. Formally we define a predicate ` MUTABLE(LV, MQ) ` which, if
267
- defined, means that "borrowing ` LV ` with mutability ` MQ ` is ok. The
268
- Rust code corresponding to this predicate is the function
269
- ` check_mutability ` in ` middle::borrowck::gather_loans ` .
264
+ immutable data from being borrowed as mutable. Note that it is ok to borrow
265
+ mutable data as immutable, since that is simply a freeze. The judgement
266
+ ` MUTABILITY(LV, MQ) ` means the mutability of ` LV ` is compatible with a borrow
267
+ of mutability ` MQ ` . The Rust code corresponding to this predicate is the
268
+ function ` check_mutability ` in ` middle::borrowck::gather_loans ` .
270
269
271
270
### Checking mutability of variables
272
271
@@ -321,12 +320,11 @@ MUTABILITY(*LV, MQ) // M-Deref-Borrowed-Mut
321
320
322
321
## Checking aliasability
323
322
324
- The goal of the aliasability check is to ensure that we never permit
325
- ` &mut ` borrows of aliasable data. Formally we define a predicate
326
- ` ALIASABLE(LV, MQ) ` which if defined means that
327
- "borrowing ` LV ` with mutability ` MQ ` is ok". The
328
- Rust code corresponding to this predicate is the function
329
- ` check_aliasability() ` in ` middle::borrowck::gather_loans ` .
323
+ The goal of the aliasability check is to ensure that we never permit ` &mut `
324
+ borrows of aliasable data. The judgement ` ALIASABLE(LV, MQ) ` means the
325
+ aliasability of ` LV ` is compatible with a borrow of mutability ` MQ ` . The Rust
326
+ code corresponding to this predicate is the function ` check_aliasability() ` in
327
+ ` middle::borrowck::gather_loans ` .
330
328
331
329
### Checking aliasability of variables
332
330
0 commit comments