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

13 lines
329 B
Rust
Raw Normal View History

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