blob: 0c5bcdd6ac111669fc07673ca4a3ce07365b5921 [file]
// xfail-test
// xfail-fast
#[legacy_modes];
fn impure(_i: int) {}
// check that unchecked alone does not override borrowck:
fn foo(v: &const Option<int>) {
match *v {
Some(ref i) => {
//~^ ERROR illegal borrow unless pure
unsafe {
impure(*i); //~ NOTE impure due to access to impure function
}
}
None => {
}
}
}
fn bar(v: &const Option<int>) {
match *v {
Some(ref i) => {
unsafe {
impure(*i);
}
}
None => {
}
}
}
fn main() {
}