diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2014-02-20 23:22:45 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2014-02-20 23:29:57 +1100 |
| commit | 5ec118383b39f00589dc72d01a0f510c1ed0511f (patch) | |
| tree | fab65b654aad77c9601f05e3d6c4359af54cc5d7 /src/rustllvm/ExecutionEngineWrapper.cpp | |
| parent | c4afcf44d2c70b2c176bdf283082a7bdd4be5826 (diff) | |
| download | rust-5ec118383b39f00589dc72d01a0f510c1ed0511f.tar.gz rust-5ec118383b39f00589dc72d01a0f510c1ed0511f.zip | |
rustc: avoid compiler generated `unsafe` blocks leaking.
Previously an `unsafe` block created by the compiler (like those in the
formatting macros) would be "ignored" if surrounded by `unsafe`, that
is, the internal unsafety would be being legitimised by the external
block:
unsafe { println!("...") } =(expansion)=> unsafe { ... unsafe { ... } }
And the code in the inner block would be using the outer block, making
it considered used (and the inner one considered unused).
This patch forces the compiler to create a new unsafe context for
compiler generated blocks, so that their internal unsafety doesn't
escape to external blocks.
Fixes #12418.
Diffstat (limited to 'src/rustllvm/ExecutionEngineWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
