rust/src/librustc_mir
Ralf Jung f32f56969c
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.
2019-12-02 09:34:10 +01:00
..
borrow_check Rollup merge of #66789 - eddyb:mir-source-scope-local-data, r=oli-obk 2019-12-02 04:09:00 +01:00
build Rollup merge of #66789 - eddyb:mir-source-scope-local-data, r=oli-obk 2019-12-02 04:09:00 +01:00
dataflow Track pointers to statics in MIR 2019-11-21 20:55:17 +00:00
hair Rollup merge of #66612 - Nadrieril:or-patterns-initial, r=varkor 2019-11-30 16:56:45 +01:00
interpret Rollup merge of #66789 - eddyb:mir-source-scope-local-data, r=oli-obk 2019-12-02 04:09:00 +01:00
monomorphize Aggregation of drive-by cosmetic changes. 2019-11-21 18:50:38 +00:00
transform Rollup merge of #66654 - ecstatic-morse:check-consts-ref, r=eddyb,matthewjasper 2019-12-02 09:34:10 +01:00
util rustc: move debug info from LocalDecl and UpvarDecl into a dedicated VarDebugInfo. 2019-11-27 19:22:03 +02:00
Cargo.toml Introduce MIR optimizations for simplifying x? on Results. 2019-11-21 20:05:16 +01:00
const_eval.rs Auto merge of #66294 - davidhewitt:const_fn_memoization, r=oli-obk 2019-11-28 07:06:40 +00:00
lib.rs Add #![feature(matches_macro)] 2019-11-27 13:07:19 -08:00
lints.rs
shim.rs rustc: move mir::SourceScopeLocalData to a field of SourceScopeData. 2019-11-30 01:37:42 +02:00