diff options
Diffstat (limited to 'tests/ui/borrowck/two-phase-multi-mut.rs')
-rw-r--r-- | tests/ui/borrowck/two-phase-multi-mut.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/borrowck/two-phase-multi-mut.rs b/tests/ui/borrowck/two-phase-multi-mut.rs new file mode 100644 index 000000000..bb646d7ca --- /dev/null +++ b/tests/ui/borrowck/two-phase-multi-mut.rs @@ -0,0 +1,14 @@ +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 +} |