rust/tests/ui/borrowck/two-phase-multi-mut.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
283 B
Rust
Raw Normal View History

2018-04-06 14:00:45 -05:00
struct Foo {
}
impl Foo {
fn method(&mut self, foo: &mut Foo) {
}
}
fn main() {
let mut foo = Foo { };
foo.method(&mut foo);
//~^ cannot borrow `foo` as mutable more than once at a time
//~^^ cannot borrow `foo` as mutable more than once at a time
}