Skip to content
Snippets Groups Projects
Commit efb231cc authored by Per Lindgren's avatar Per Lindgren
Browse files

borrow check, wip4

parent d3e09690
Branches
Tags
No related merge requests found
fn f(a: &i32, b: &mut i32) {} fn f(a: &i32, b: &mut i32) {}
fn main() { fn main() {
let mut a = 1; let mut a = 1;
f(&a, &mut a) f(&mut a, &mut a)
} }
fn f(a: &i32, b: &mut i32) {}
fn main() {
let mut a = 1;
let b = &mut a;
let c = &mut a;
let d = *b + *c;
}
...@@ -180,3 +180,8 @@ fn borrow() { ...@@ -180,3 +180,8 @@ fn borrow() {
fn borrow2() { fn borrow2() {
check(&read_file::parse("examples/borrow2.rs")).unwrap(); check(&read_file::parse("examples/borrow2.rs")).unwrap();
} }
#[test]
fn borrow3() {
check(&read_file::parse("examples/borrow3.rs")).unwrap();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment