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.
11 lines
212 B
Rust
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
|
|
}
|