rust/src/test/compile-fail/issue-511.rs
Tim Chevalier e16dbb7888 Demode some code using by-mutbl-ref; warn about by-mutbl-ref
The parser now warns about use of mutbl-ref mode, though it's kind
of a lie since this commit doesn't remove support for the mode.

Changed move_val_init to have stage0 and stage1/2 versions, the latter of
which is demoded.

Changed the type that the typechecker expects the move_val_init
intrinsic to have. After this is pushed, I can make a new snapshot,
which will remove the need for the stage0 versions.
2012-10-05 15:37:01 -07:00

11 lines
212 B
Rust

extern mod std;
use cmp::Eq;
fn f<T:Eq>(o: &mut Option<T>) {
assert *o == option::None;
}
fn main() {
f::<int>(&mut option::None);
//~^ ERROR illegal borrow: creating mutable alias to static item
}