diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2013-04-22 13:01:32 -0400 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2013-04-22 13:01:32 -0400 |
| commit | c99409b332a2bee95e1139c6786c99a06cca9d3b (patch) | |
| tree | 79bca5400a8bd628054813ae4c9929cbb2f2ce48 /src/rt/rust_run_program.cpp | |
| parent | d0451eebc41d4eaddcc299c868b5ad983e8c8eb9 (diff) | |
| download | rust-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
