Move deref-lval test
This commit is contained in:
parent
949c96660c
commit
ed52c7bb75
@ -49,3 +49,12 @@ fn box_clone_from_ptr_stability() {
|
|||||||
assert_eq!(copy.as_ptr() as usize, copy_raw);
|
assert_eq!(copy.as_ptr() as usize, copy_raw);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn box_deref_lval() {
|
||||||
|
use std::cell::Cell;
|
||||||
|
|
||||||
|
let x = Box::new(Cell::new(5));
|
||||||
|
x.set(1000);
|
||||||
|
assert_eq!(x.get(), 1000);
|
||||||
|
}
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
// run-pass
|
|
||||||
|
|
||||||
#![feature(box_syntax)]
|
|
||||||
|
|
||||||
use std::cell::Cell;
|
|
||||||
|
|
||||||
pub fn main() {
|
|
||||||
let x: Box<_> = box Cell::new(5);
|
|
||||||
x.set(1000);
|
|
||||||
println!("{}", x.get());
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user