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

13 lines
329 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);
2012-05-10 21:58:23 -05:00
//!^ 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-23 00:50:12 -05:00
}