diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-11-22 19:57:49 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-22 19:57:49 +0100 |
| commit | 3031720d8fe850073ff3cf9509ae22eb2d2a3978 (patch) | |
| tree | fb0ef7a3a051598c54d5eed9e7b90ee1e3f9e8b6 /src/test/debuginfo/enum-thinlto.rs | |
| parent | c66b508137c296699bae56fb40bc180c61dfa175 (diff) | |
| parent | bccc59a8e6e25c2b63308e77f853c6f23782e631 (diff) | |
| download | rust-3031720d8fe850073ff3cf9509ae22eb2d2a3978.tar.gz rust-3031720d8fe850073ff3cf9509ae22eb2d2a3978.zip | |
Rollup merge of #66587 - matthewjasper:handle-static-as-const, r=oli-obk
Handle statics in MIR as const pointers
This is the first PR towards the goal of removing `PlaceBase::Static`. In this PR:
* Statics are lowered to dereferencing a const pointer.
* The temporaries holding such pointers are tracked in MIR, for the most part this is only used for diagnostics. There are two exceptions:
* The borrow checker has some checks for thread-locals that directly use this data.
* Const checking will suppress "cannot dereference raw pointer" diagnostics for pointers to `static mut`/`extern static`. This is to maintain the current behaviour (12 tests fail otherwise).
The following are left to future PRs (I think that @spastorino will be working on the first 3):
* Applying the same treatments to promoted statics.
* Removing `PlaceBase::Static`.
* Replacing `PlaceBase` with `Local`.
* Moving the ever growing collection of metadata that we have for diagnostics in MIR passes somewhere more appropriate.
r? @oli-obk
Diffstat (limited to 'src/test/debuginfo/enum-thinlto.rs')
0 files changed, 0 insertions, 0 deletions
