about summary refs log tree commit diff
path: root/src/test/codegen/stack-alloc-string-slice.rs
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2014-02-20 23:22:45 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2014-02-20 23:29:57 +1100
commit5ec118383b39f00589dc72d01a0f510c1ed0511f (patch)
treefab65b654aad77c9601f05e3d6c4359af54cc5d7 /src/test/codegen/stack-alloc-string-slice.rs
parentc4afcf44d2c70b2c176bdf283082a7bdd4be5826 (diff)
downloadrust-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/test/codegen/stack-alloc-string-slice.rs')
0 files changed, 0 insertions, 0 deletions