about summary refs log tree commit diff
path: root/src/rt/rust_run_program.cpp
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2013-04-22 13:01:32 -0400
committerDaniel Micay <danielmicay@gmail.com>2013-04-22 13:01:32 -0400
commitc99409b332a2bee95e1139c6786c99a06cca9d3b (patch)
tree79bca5400a8bd628054813ae4c9929cbb2f2ce48 /src/rt/rust_run_program.cpp
parentd0451eebc41d4eaddcc299c868b5ad983e8c8eb9 (diff)
downloadrust-c99409b332a2bee95e1139c6786c99a06cca9d3b.tar.gz
rust-c99409b332a2bee95e1139c6786c99a06cca9d3b.zip
cell: public field is unsafe
use core::cell;

fn main() {
    let x = cell::Cell(Some(~"foo"));
    let y = x.value.get_ref().get_ref();
    do x.with_mut_ref |z| { *z = None; }
    println(*y) // boom!
}
Diffstat (limited to 'src/rt/rust_run_program.cpp')
0 files changed, 0 insertions, 0 deletions