diff options
| author | Ralf Jung <post@ralfj.de> | 2019-12-02 09:34:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-12-02 09:34:10 +0100 |
| commit | f32f56969c6c0e4d43b2ca9a6d5254c64ae1cd91 (patch) | |
| tree | 765362e41b1528b687e4e87efd72f2a761e67a7c /src/test/codegen | |
| parent | 8438770e1fc647bc06745cfafc4da32dcc5b85b2 (diff) | |
| parent | ccb4eed3529eaf610f476dd6d78ecd159a897b64 (diff) | |
| download | rust-f32f56969c6c0e4d43b2ca9a6d5254c64ae1cd91.tar.gz rust-f32f56969c6c0e4d43b2ca9a6d5254c64ae1cd91.zip | |
Rollup merge of #66654 - ecstatic-morse:check-consts-ref, r=eddyb,matthewjasper
Handle const-checks for `&mut` outside of `HasMutInterior` Addresses [this comment](https://github.com/rust-lang/rust/pull/64470#discussion_r328200508). Const-checking relied on `HasMutInterior` to forbid `&mut` in a const context. This was strange because all we needed to do was look for an `Rvalue::Ref` with a certain `BorrowKind`, whereas the `Qualif` traits are specifically meant to get the qualifs for a *value*. This PR removes that logic from `HasMutInterior` and moves it into `check_consts::Validator`. As a result, we can now properly handle qualifications for `static`s, which had to be ignored previously since you can e.g. borrow a static `Cell` from another `static`. We also remove the `derived_from_illegal_borrow` logic, since it is no longer necessary; we give good errors for subsequent reborrows/borrows of illegal borrows.
Diffstat (limited to 'src/test/codegen')
0 files changed, 0 insertions, 0 deletions
