rust/src/test/compile-fail/issue-511.rs

12 lines
261 B
Rust
Raw Normal View History

2011-09-23 00:50:12 -05:00
use std;
import option;
2011-09-23 00:50:12 -05:00
fn f<T>(&o: option<T>) {
2011-09-23 00:50:12 -05:00
assert o == option::none;
}
fn main() {
f::<int>(option::none);
//~^ ERROR taking mut reference to static item
//~^^ ERROR illegal borrow: creating mutable alias to aliasable, immutable memory
2011-09-23 00:50:12 -05:00
}