-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[compiler v2] Fix equalities, FreezeRef conversion (#12162)
* [compiler-v2] Refactoring of ability instrumentation and checking This refactors instrumentation of copy and drop instructions, and checking of abilities in general, closing #11223, which lead us to generate unnecessary copies. Copy instrumentation is now moved after reference safety as borrow information is needed to compute it. The existing ability checking and explicit drop processors have been marged into a new `ability_processor` which deals with instrumenting copies and drops as well as checking ability conformance. * Addresssing reviewer comments * Addressing reviewer comments * Fixing #11924, addressing reviewer comments. * [compiler v2] Fix equalities, FreezeRef conversion This enables the comparison of references with mixed mutability (`&x == &mut y`), and introduces generation of the `FreezeRef` operation when an argument is widned from mutable to immutable references. The later applies for any kind of function call, not only equalities. Without freeze, certain scenarios produce borrow errors in reference safety and/or the bytecode verifier. Note that this PR is intended to work together with the new reference safety analysis, so some tests do not yet work without it. Fixes #12151 Fixes #11738 Fixes #11434 * Rebasing * Adapting freeze to new analysis, fixing a bug in reference analysis * Removing left-over move inference from reference analysis
- Loading branch information
Showing
38 changed files
with
534 additions
and
809 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.