mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Updated UI test output to remove test annotations for revisions
This commit is contained in:
parent
9eb2de4b75
commit
faed3a2b19
@ -6,7 +6,7 @@ LL | let bar = || {
|
||||
LL | inside_closure(a)
|
||||
| - first borrow occurs due to use of `a` in closure
|
||||
LL | };
|
||||
LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
|
||||
LL | outside_closure_1(a);
|
||||
| ^ second borrow occurs here
|
||||
...
|
||||
LL | drop(bar);
|
||||
@ -20,7 +20,7 @@ LL | let bar = || {
|
||||
LL | inside_closure(a)
|
||||
| - first borrow occurs due to use of `a` in closure
|
||||
...
|
||||
LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
|
||||
LL | outside_closure_2(a);
|
||||
| ^ second borrow occurs here
|
||||
...
|
||||
LL | drop(bar);
|
||||
|
@ -6,7 +6,7 @@ LL | let bar = || {
|
||||
LL | inside_closure(a)
|
||||
| - previous borrow occurs due to use of `a` in closure
|
||||
LL | };
|
||||
LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
|
||||
LL | outside_closure_1(a);
|
||||
| ^ borrow occurs here
|
||||
...
|
||||
LL | }
|
||||
@ -20,7 +20,7 @@ LL | let bar = || {
|
||||
LL | inside_closure(a)
|
||||
| - previous borrow occurs due to use of `a` in closure
|
||||
...
|
||||
LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
|
||||
LL | outside_closure_2(a);
|
||||
| ^ borrow occurs here
|
||||
...
|
||||
LL | }
|
||||
|
@ -6,7 +6,7 @@ LL | let bar = || {
|
||||
LL | inside_closure(a)
|
||||
| - first borrow occurs due to use of `a` in closure
|
||||
LL | };
|
||||
LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
|
||||
LL | outside_closure_1(a);
|
||||
| ^ second borrow occurs here
|
||||
...
|
||||
LL | drop(bar);
|
||||
@ -20,7 +20,7 @@ LL | let bar = || {
|
||||
LL | inside_closure(a)
|
||||
| - first borrow occurs due to use of `a` in closure
|
||||
...
|
||||
LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
|
||||
LL | outside_closure_2(a);
|
||||
| ^ second borrow occurs here
|
||||
...
|
||||
LL | drop(bar);
|
||||
|
@ -3,7 +3,7 @@ error[E0506]: cannot assign to `fancy_num` because it is borrowed
|
||||
|
|
||||
LL | let fancy_ref = &fancy_num;
|
||||
| ---------- borrow of `fancy_num` occurs here
|
||||
LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506
|
||||
LL | fancy_num = FancyNum { num: 6 };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here
|
||||
...
|
||||
LL | println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num);
|
||||
|
@ -3,7 +3,7 @@ error[E0506]: cannot assign to `fancy_num` because it is borrowed
|
||||
|
|
||||
LL | let fancy_ref = &fancy_num;
|
||||
| --------- borrow of `fancy_num` occurs here
|
||||
LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506
|
||||
LL | fancy_num = FancyNum { num: 6 };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -3,7 +3,7 @@ error[E0506]: cannot assign to `fancy_num` because it is borrowed
|
||||
|
|
||||
LL | let fancy_ref = &fancy_num;
|
||||
| ---------- borrow of `fancy_num` occurs here
|
||||
LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506
|
||||
LL | fancy_num = FancyNum { num: 6 };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here
|
||||
...
|
||||
LL | println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num);
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
|
||||
--> $DIR/E0508-fail.rs:8:18
|
||||
|
|
||||
LL | let _value = array[0]; //[ast]~ ERROR [E0508]
|
||||
LL | let _value = array[0];
|
||||
| ^^^^^^^^
|
||||
| |
|
||||
| cannot move out of here
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
|
||||
--> $DIR/E0508-fail.rs:8:18
|
||||
|
|
||||
LL | let _value = array[0]; //[ast]~ ERROR [E0508]
|
||||
LL | let _value = array[0];
|
||||
| ^^^^^^^^
|
||||
| |
|
||||
| cannot move out of here
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
|
||||
--> $DIR/E0508-fail.rs:8:18
|
||||
|
|
||||
LL | let _value = array[0]; //[ast]~ ERROR [E0508]
|
||||
LL | let _value = array[0];
|
||||
| ^^^^^^^^
|
||||
| |
|
||||
| cannot move out of here
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
|
||||
--> $DIR/E0508.rs:18:18
|
||||
|
|
||||
LL | let _value = array[0]; //[ast]~ ERROR [E0508]
|
||||
LL | let _value = array[0];
|
||||
| ^^^^^^^^
|
||||
| |
|
||||
| cannot move out of here
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
|
||||
--> $DIR/E0508.rs:18:18
|
||||
|
|
||||
LL | let _value = array[0]; //[ast]~ ERROR [E0508]
|
||||
LL | let _value = array[0];
|
||||
| ^^^^^^^^
|
||||
| |
|
||||
| cannot move out of here
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0594]: cannot assign to immutable static item `NUM`
|
||||
--> $DIR/E0594.rs:7:5
|
||||
|
|
||||
LL | NUM = 20; //[ast]~ ERROR E0594
|
||||
LL | NUM = 20;
|
||||
| ^^^^^^^^ cannot assign
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0594]: cannot assign to immutable static item
|
||||
--> $DIR/E0594.rs:7:5
|
||||
|
|
||||
LL | NUM = 20; //[ast]~ ERROR E0594
|
||||
LL | NUM = 20;
|
||||
| ^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0594]: cannot assign to immutable static item `NUM`
|
||||
--> $DIR/E0594.rs:7:5
|
||||
|
|
||||
LL | NUM = 20; //[ast]~ ERROR E0594
|
||||
LL | NUM = 20;
|
||||
| ^^^^^^^^ cannot assign
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -3,7 +3,7 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
|
||||
|
|
||||
LL | let x = 1;
|
||||
| - help: consider changing this to be mutable: `mut x`
|
||||
LL | let y = &mut x; //[ast]~ ERROR [E0596]
|
||||
LL | let y = &mut x;
|
||||
| ^^^^^^ cannot borrow as mutable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -3,7 +3,7 @@ error[E0596]: cannot borrow immutable local variable `x` as mutable
|
||||
|
|
||||
LL | let x = 1;
|
||||
| - help: make this binding mutable: `mut x`
|
||||
LL | let y = &mut x; //[ast]~ ERROR [E0596]
|
||||
LL | let y = &mut x;
|
||||
| ^ cannot borrow mutably
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -3,7 +3,7 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
|
||||
|
|
||||
LL | let x = 1;
|
||||
| - help: consider changing this to be mutable: `mut x`
|
||||
LL | let y = &mut x; //[ast]~ ERROR [E0596]
|
||||
LL | let y = &mut x;
|
||||
| ^^^^^^ cannot borrow as mutable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -4,10 +4,10 @@ error[E0384]: cannot assign twice to immutable variable `v`
|
||||
LL | let v: isize;
|
||||
| - help: make this binding mutable: `mut v`
|
||||
...
|
||||
LL | v = 1; //[ast]~ NOTE first assignment
|
||||
LL | v = 1;
|
||||
| ----- first assignment to `v`
|
||||
...
|
||||
LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable
|
||||
LL | v = 2;
|
||||
| ^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,10 +1,10 @@
|
||||
error[E0384]: cannot assign twice to immutable variable `v`
|
||||
--> $DIR/assign-imm-local-twice.rs:11:5
|
||||
|
|
||||
LL | v = 1; //[ast]~ NOTE first assignment
|
||||
LL | v = 1;
|
||||
| ----- first assignment to `v`
|
||||
...
|
||||
LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable
|
||||
LL | v = 2;
|
||||
| ^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -4,10 +4,10 @@ error[E0384]: cannot assign twice to immutable variable `v`
|
||||
LL | let v: isize;
|
||||
| - help: make this binding mutable: `mut v`
|
||||
...
|
||||
LL | v = 1; //[ast]~ NOTE first assignment
|
||||
LL | v = 1;
|
||||
| ----- first assignment to `v`
|
||||
...
|
||||
LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable
|
||||
LL | v = 2;
|
||||
| ^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,7 +1,7 @@
|
||||
error: compilation successful
|
||||
--> $DIR/bound-lifetime-in-binding-only.rs:71:1
|
||||
|
|
||||
LL | fn main() { } //[ok]~ ERROR compilation successful
|
||||
LL | fn main() { }
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,7 +1,7 @@
|
||||
error: compilation successful
|
||||
--> $DIR/bound-lifetime-in-return-only.rs:49:1
|
||||
|
|
||||
LL | fn main() { } //[ok]~ ERROR compilation successful
|
||||
LL | fn main() { }
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -6,7 +6,7 @@ LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
...
|
||||
LL | (a, b) //[krisskross]~ ERROR lifetime mismatch [E0623]
|
||||
LL | (a, b)
|
||||
| ^ ...but data from `y` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
@ -17,7 +17,7 @@ LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
...
|
||||
LL | (a, b) //[krisskross]~ ERROR lifetime mismatch [E0623]
|
||||
LL | (a, b)
|
||||
| ^ ...but data from `x` is returned here
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
|
||||
--> $DIR/project-fn-ret-contravariant.rs:38:8
|
||||
|
|
||||
LL | bar(foo, x) //[transmute]~ ERROR E0495
|
||||
LL | bar(foo, x)
|
||||
| ^^^
|
||||
|
|
||||
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 37:8...
|
||||
@ -12,13 +12,13 @@ LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 {
|
||||
note: ...so that reference does not outlive borrowed content
|
||||
--> $DIR/project-fn-ret-contravariant.rs:38:13
|
||||
|
|
||||
LL | bar(foo, x) //[transmute]~ ERROR E0495
|
||||
LL | bar(foo, x)
|
||||
| ^
|
||||
= note: but, the lifetime must be valid for the static lifetime...
|
||||
note: ...so that reference does not outlive borrowed content
|
||||
--> $DIR/project-fn-ret-contravariant.rs:38:4
|
||||
|
|
||||
LL | bar(foo, x) //[transmute]~ ERROR E0495
|
||||
LL | bar(foo, x)
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -5,7 +5,7 @@ LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
|
||||
| -------- --------------------
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | let a = bar(foo, y); //[krisskross]~ ERROR E0623
|
||||
LL | let a = bar(foo, y);
|
||||
| ^ ...but data from `x` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
@ -15,8 +15,8 @@ LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
|
||||
| -------- --------------------
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | let a = bar(foo, y); //[krisskross]~ ERROR E0623
|
||||
LL | let b = bar(foo, x); //[krisskross]~ ERROR E0623
|
||||
LL | let a = bar(foo, y);
|
||||
LL | let b = bar(foo, x);
|
||||
| ^ ...but data from `y` is returned here
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
@ -6,7 +6,7 @@ LL | fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
...
|
||||
LL | let b = bar(f, y); //[oneuse]~ ERROR lifetime mismatch [E0623]
|
||||
LL | let b = bar(f, y);
|
||||
| ^ ...but data from `x` is returned here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
|
||||
--> $DIR/project-fn-ret-invariant.rs:48:8
|
||||
|
|
||||
LL | bar(foo, x) //[transmute]~ ERROR E0495
|
||||
LL | bar(foo, x)
|
||||
| ^^^
|
||||
|
|
||||
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 44:8...
|
||||
|
@ -1,9 +1,9 @@
|
||||
error: compilation successful
|
||||
--> $DIR/higher-ranked-projection.rs:24:1
|
||||
|
|
||||
LL | / fn main() { //[good]~ ERROR compilation successful
|
||||
LL | / fn main() {
|
||||
LL | | foo(());
|
||||
LL | | //[bad]~^ ERROR type mismatch
|
||||
LL | |
|
||||
LL | | }
|
||||
| |_^
|
||||
|
||||
|
@ -4,13 +4,13 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
|
||||
LL | let x = 1;
|
||||
| - help: consider changing this to be mutable: `mut x`
|
||||
...
|
||||
LL | let _y1 = &mut x; //[ast]~ ERROR [E0596]
|
||||
LL | let _y1 = &mut x;
|
||||
| ^^^^^^ cannot borrow as mutable
|
||||
|
||||
error[E0596]: cannot borrow immutable static item `static_x` as mutable
|
||||
--> $DIR/borrowck-access-permissions.rs:18:19
|
||||
|
|
||||
LL | let _y1 = &mut static_x; //[ast]~ ERROR [E0596]
|
||||
LL | let _y1 = &mut static_x;
|
||||
| ^^^^^^^^^^^^^ cannot borrow as mutable
|
||||
|
||||
error[E0596]: cannot borrow `*box_x` as mutable, as `box_x` is not declared as mutable
|
||||
@ -19,7 +19,7 @@ error[E0596]: cannot borrow `*box_x` as mutable, as `box_x` is not declared as m
|
||||
LL | let box_x = Box::new(1);
|
||||
| ----- help: consider changing this to be mutable: `mut box_x`
|
||||
...
|
||||
LL | let _y1 = &mut *box_x; //[ast]~ ERROR [E0596]
|
||||
LL | let _y1 = &mut *box_x;
|
||||
| ^^^^^^^^^^^ cannot borrow as mutable
|
||||
|
||||
error[E0596]: cannot borrow `*ref_x` as mutable, as it is behind a `&` reference
|
||||
@ -28,7 +28,7 @@ error[E0596]: cannot borrow `*ref_x` as mutable, as it is behind a `&` reference
|
||||
LL | let ref_x = &x;
|
||||
| -- help: consider changing this to be a mutable reference: `&mut x`
|
||||
...
|
||||
LL | let _y1 = &mut *ref_x; //[ast]~ ERROR [E0596]
|
||||
LL | let _y1 = &mut *ref_x;
|
||||
| ^^^^^^^^^^^ `ref_x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
||||
|
||||
error[E0596]: cannot borrow `*ptr_x` as mutable, as it is behind a `*const` pointer
|
||||
@ -37,7 +37,7 @@ error[E0596]: cannot borrow `*ptr_x` as mutable, as it is behind a `*const` poin
|
||||
LL | let ptr_x : *const _ = &x;
|
||||
| -- help: consider changing this to be a mutable pointer: `&mut x`
|
||||
...
|
||||
LL | let _y1 = &mut *ptr_x; //[ast]~ ERROR [E0596]
|
||||
LL | let _y1 = &mut *ptr_x;
|
||||
| ^^^^^^^^^^^ `ptr_x` is a `*const` pointer, so the data it refers to cannot be borrowed as mutable
|
||||
|
||||
error[E0596]: cannot borrow `*foo_ref.f` as mutable, as it is behind a `&` reference
|
||||
@ -45,7 +45,7 @@ error[E0596]: cannot borrow `*foo_ref.f` as mutable, as it is behind a `&` refer
|
||||
|
|
||||
LL | let foo_ref = &foo;
|
||||
| ---- help: consider changing this to be a mutable reference: `&mut foo`
|
||||
LL | let _y = &mut *foo_ref.f; //[ast]~ ERROR [E0389]
|
||||
LL | let _y = &mut *foo_ref.f;
|
||||
| ^^^^^^^^^^^^^^^ `foo_ref` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
@ -4,13 +4,13 @@ error[E0596]: cannot borrow immutable local variable `x` as mutable
|
||||
LL | let x = 1;
|
||||
| - help: make this binding mutable: `mut x`
|
||||
...
|
||||
LL | let _y1 = &mut x; //[ast]~ ERROR [E0596]
|
||||
LL | let _y1 = &mut x;
|
||||
| ^ cannot borrow mutably
|
||||
|
||||
error[E0596]: cannot borrow immutable static item as mutable
|
||||
--> $DIR/borrowck-access-permissions.rs:18:24
|
||||
|
|
||||
LL | let _y1 = &mut static_x; //[ast]~ ERROR [E0596]
|
||||
LL | let _y1 = &mut static_x;
|
||||
| ^^^^^^^^
|
||||
|
||||
error[E0596]: cannot borrow immutable `Box` content `*box_x` as mutable
|
||||
@ -19,25 +19,25 @@ error[E0596]: cannot borrow immutable `Box` content `*box_x` as mutable
|
||||
LL | let box_x = Box::new(1);
|
||||
| ----- help: make this binding mutable: `mut box_x`
|
||||
...
|
||||
LL | let _y1 = &mut *box_x; //[ast]~ ERROR [E0596]
|
||||
LL | let _y1 = &mut *box_x;
|
||||
| ^^^^^^ cannot borrow as mutable
|
||||
|
||||
error[E0596]: cannot borrow immutable borrowed content `*ref_x` as mutable
|
||||
--> $DIR/borrowck-access-permissions.rs:36:24
|
||||
|
|
||||
LL | let _y1 = &mut *ref_x; //[ast]~ ERROR [E0596]
|
||||
LL | let _y1 = &mut *ref_x;
|
||||
| ^^^^^^ cannot borrow as mutable
|
||||
|
||||
error[E0596]: cannot borrow immutable dereference of raw pointer `*ptr_x` as mutable
|
||||
--> $DIR/borrowck-access-permissions.rs:46:28
|
||||
|
|
||||
LL | let _y1 = &mut *ptr_x; //[ast]~ ERROR [E0596]
|
||||
LL | let _y1 = &mut *ptr_x;
|
||||
| ^^^^^^ cannot borrow as mutable
|
||||
|
||||
error[E0389]: cannot borrow data mutably in a `&` reference
|
||||
--> $DIR/borrowck-access-permissions.rs:56:23
|
||||
|
|
||||
LL | let _y = &mut *foo_ref.f; //[ast]~ ERROR [E0389]
|
||||
LL | let _y = &mut *foo_ref.f;
|
||||
| ^^^^^^^^^^ assignment into an immutable reference
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
@ -4,13 +4,13 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
|
||||
LL | let x = 1;
|
||||
| - help: consider changing this to be mutable: `mut x`
|
||||
...
|
||||
LL | let _y1 = &mut x; //[ast]~ ERROR [E0596]
|
||||
LL | let _y1 = &mut x;
|
||||
| ^^^^^^ cannot borrow as mutable
|
||||
|
||||
error[E0596]: cannot borrow immutable static item `static_x` as mutable
|
||||
--> $DIR/borrowck-access-permissions.rs:18:19
|
||||
|
|
||||
LL | let _y1 = &mut static_x; //[ast]~ ERROR [E0596]
|
||||
LL | let _y1 = &mut static_x;
|
||||
| ^^^^^^^^^^^^^ cannot borrow as mutable
|
||||
|
||||
error[E0596]: cannot borrow `*box_x` as mutable, as `box_x` is not declared as mutable
|
||||
@ -19,7 +19,7 @@ error[E0596]: cannot borrow `*box_x` as mutable, as `box_x` is not declared as m
|
||||
LL | let box_x = Box::new(1);
|
||||
| ----- help: consider changing this to be mutable: `mut box_x`
|
||||
...
|
||||
LL | let _y1 = &mut *box_x; //[ast]~ ERROR [E0596]
|
||||
LL | let _y1 = &mut *box_x;
|
||||
| ^^^^^^^^^^^ cannot borrow as mutable
|
||||
|
||||
error[E0596]: cannot borrow `*ref_x` as mutable, as it is behind a `&` reference
|
||||
@ -28,7 +28,7 @@ error[E0596]: cannot borrow `*ref_x` as mutable, as it is behind a `&` reference
|
||||
LL | let ref_x = &x;
|
||||
| -- help: consider changing this to be a mutable reference: `&mut x`
|
||||
...
|
||||
LL | let _y1 = &mut *ref_x; //[ast]~ ERROR [E0596]
|
||||
LL | let _y1 = &mut *ref_x;
|
||||
| ^^^^^^^^^^^ `ref_x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
||||
|
||||
error[E0596]: cannot borrow `*ptr_x` as mutable, as it is behind a `*const` pointer
|
||||
@ -37,7 +37,7 @@ error[E0596]: cannot borrow `*ptr_x` as mutable, as it is behind a `*const` poin
|
||||
LL | let ptr_x : *const _ = &x;
|
||||
| -- help: consider changing this to be a mutable pointer: `&mut x`
|
||||
...
|
||||
LL | let _y1 = &mut *ptr_x; //[ast]~ ERROR [E0596]
|
||||
LL | let _y1 = &mut *ptr_x;
|
||||
| ^^^^^^^^^^^ `ptr_x` is a `*const` pointer, so the data it refers to cannot be borrowed as mutable
|
||||
|
||||
error[E0596]: cannot borrow `*foo_ref.f` as mutable, as it is behind a `&` reference
|
||||
@ -45,7 +45,7 @@ error[E0596]: cannot borrow `*foo_ref.f` as mutable, as it is behind a `&` refer
|
||||
|
|
||||
LL | let foo_ref = &foo;
|
||||
| ---- help: consider changing this to be a mutable reference: `&mut foo`
|
||||
LL | let _y = &mut *foo_ref.f; //[ast]~ ERROR [E0389]
|
||||
LL | let _y = &mut *foo_ref.f;
|
||||
| ^^^^^^^^^^^^^^^ `foo_ref` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
@ -7,7 +7,7 @@ LL | unsafe {
|
||||
LL | asm!("nop" : : "r"(x));
|
||||
| - value moved here
|
||||
LL | }
|
||||
LL | let z = x; //[ast]~ ERROR use of moved value: `x`
|
||||
LL | let z = x;
|
||||
| ^ value used here after move
|
||||
|
||||
error[E0503]: cannot use `x` because it was mutably borrowed
|
||||
@ -16,7 +16,7 @@ error[E0503]: cannot use `x` because it was mutably borrowed
|
||||
LL | let y = &mut x;
|
||||
| ------ borrow of `x` occurs here
|
||||
LL | unsafe {
|
||||
LL | asm!("nop" : : "r"(x)); //[ast]~ ERROR cannot use
|
||||
LL | asm!("nop" : : "r"(x));
|
||||
| ^ use of borrowed `x`
|
||||
...
|
||||
LL | let z = y;
|
||||
@ -31,7 +31,7 @@ LL | let x = 3;
|
||||
| first assignment to `x`
|
||||
| help: make this binding mutable: `mut x`
|
||||
LL | unsafe {
|
||||
LL | asm!("nop" : "=r"(x)); //[ast]~ ERROR cannot assign twice
|
||||
LL | asm!("nop" : "=r"(x));
|
||||
| ^ cannot assign twice to immutable variable
|
||||
|
||||
error[E0384]: cannot assign twice to immutable variable `x`
|
||||
@ -43,13 +43,13 @@ LL | let x = 3;
|
||||
| first assignment to `x`
|
||||
| help: make this binding mutable: `mut x`
|
||||
LL | unsafe {
|
||||
LL | asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign twice
|
||||
LL | asm!("nop" : "+r"(x));
|
||||
| ^ cannot assign twice to immutable variable
|
||||
|
||||
error[E0381]: use of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-asm.rs:68:32
|
||||
|
|
||||
LL | asm!("nop" : "=*r"(x)); //[ast]~ ERROR use of possibly uninitialized variable
|
||||
LL | asm!("nop" : "=*r"(x));
|
||||
| ^ use of possibly uninitialized `x`
|
||||
|
||||
error[E0506]: cannot assign to `x` because it is borrowed
|
||||
@ -58,7 +58,7 @@ error[E0506]: cannot assign to `x` because it is borrowed
|
||||
LL | let y = &*x;
|
||||
| --- borrow of `x` occurs here
|
||||
LL | unsafe {
|
||||
LL | asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign to `x` because it is borrowed
|
||||
LL | asm!("nop" : "+r"(x));
|
||||
| ^ assignment to borrowed `x` occurs here
|
||||
...
|
||||
LL | let z = y;
|
||||
@ -70,7 +70,7 @@ error[E0382]: use of moved value: `x`
|
||||
LL | let x = &mut 2;
|
||||
| - move occurs because `x` has type `&mut i32`, which does not implement the `Copy` trait
|
||||
LL | unsafe {
|
||||
LL | asm!("nop" : : "r"(x), "r"(x) ); //[ast]~ ERROR use of moved value
|
||||
LL | asm!("nop" : : "r"(x), "r"(x) );
|
||||
| - ^ value used here after move
|
||||
| |
|
||||
| value moved here
|
||||
|
@ -4,7 +4,7 @@ error[E0382]: use of moved value: `x`
|
||||
LL | asm!("nop" : : "r"(x));
|
||||
| - value moved here
|
||||
LL | }
|
||||
LL | let z = x; //[ast]~ ERROR use of moved value: `x`
|
||||
LL | let z = x;
|
||||
| ^ value used here after move
|
||||
|
|
||||
= note: move occurs because `x` has type `&mut isize`, which does not implement the `Copy` trait
|
||||
@ -15,7 +15,7 @@ error[E0503]: cannot use `x` because it was mutably borrowed
|
||||
LL | let y = &mut x;
|
||||
| - borrow of `x` occurs here
|
||||
LL | unsafe {
|
||||
LL | asm!("nop" : : "r"(x)); //[ast]~ ERROR cannot use
|
||||
LL | asm!("nop" : : "r"(x));
|
||||
| ^ use of borrowed `x`
|
||||
|
||||
error[E0384]: cannot assign twice to immutable variable `x`
|
||||
@ -24,7 +24,7 @@ error[E0384]: cannot assign twice to immutable variable `x`
|
||||
LL | let x = 3;
|
||||
| - first assignment to `x`
|
||||
LL | unsafe {
|
||||
LL | asm!("nop" : "=r"(x)); //[ast]~ ERROR cannot assign twice
|
||||
LL | asm!("nop" : "=r"(x));
|
||||
| ^ cannot assign twice to immutable variable
|
||||
|
||||
error[E0506]: cannot assign to `a` because it is borrowed
|
||||
@ -33,7 +33,7 @@ error[E0506]: cannot assign to `a` because it is borrowed
|
||||
LL | let b = &*a;
|
||||
| -- borrow of `a` occurs here
|
||||
LL | unsafe {
|
||||
LL | asm!("nop" : "=r"(a)); //[ast]~ ERROR cannot assign to `a` because it is borrowed
|
||||
LL | asm!("nop" : "=r"(a));
|
||||
| ^ assignment to borrowed `a` occurs here
|
||||
|
||||
error[E0384]: cannot assign twice to immutable variable `x`
|
||||
@ -42,13 +42,13 @@ error[E0384]: cannot assign twice to immutable variable `x`
|
||||
LL | let x = 3;
|
||||
| - first assignment to `x`
|
||||
LL | unsafe {
|
||||
LL | asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign twice
|
||||
LL | asm!("nop" : "+r"(x));
|
||||
| ^ cannot assign twice to immutable variable
|
||||
|
||||
error[E0381]: use of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-asm.rs:68:32
|
||||
|
|
||||
LL | asm!("nop" : "=*r"(x)); //[ast]~ ERROR use of possibly uninitialized variable
|
||||
LL | asm!("nop" : "=*r"(x));
|
||||
| ^ use of possibly uninitialized `x`
|
||||
|
||||
error[E0506]: cannot assign to `x` because it is borrowed
|
||||
@ -57,13 +57,13 @@ error[E0506]: cannot assign to `x` because it is borrowed
|
||||
LL | let y = &*x;
|
||||
| -- borrow of `x` occurs here
|
||||
LL | unsafe {
|
||||
LL | asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign to `x` because it is borrowed
|
||||
LL | asm!("nop" : "+r"(x));
|
||||
| ^ assignment to borrowed `x` occurs here
|
||||
|
||||
error[E0382]: use of moved value: `x`
|
||||
--> $DIR/borrowck-asm.rs:86:40
|
||||
|
|
||||
LL | asm!("nop" : : "r"(x), "r"(x) ); //[ast]~ ERROR use of moved value
|
||||
LL | asm!("nop" : : "r"(x), "r"(x) );
|
||||
| - ^ value used here after move
|
||||
| |
|
||||
| value moved here
|
||||
|
@ -7,7 +7,7 @@ LL | unsafe {
|
||||
LL | asm!("nop" : : "r"(x));
|
||||
| - value moved here
|
||||
LL | }
|
||||
LL | let z = x; //[ast]~ ERROR use of moved value: `x`
|
||||
LL | let z = x;
|
||||
| ^ value used here after move
|
||||
|
||||
error[E0503]: cannot use `x` because it was mutably borrowed
|
||||
@ -16,7 +16,7 @@ error[E0503]: cannot use `x` because it was mutably borrowed
|
||||
LL | let y = &mut x;
|
||||
| ------ borrow of `x` occurs here
|
||||
LL | unsafe {
|
||||
LL | asm!("nop" : : "r"(x)); //[ast]~ ERROR cannot use
|
||||
LL | asm!("nop" : : "r"(x));
|
||||
| ^ use of borrowed `x`
|
||||
...
|
||||
LL | let z = y;
|
||||
@ -31,7 +31,7 @@ LL | let x = 3;
|
||||
| first assignment to `x`
|
||||
| help: make this binding mutable: `mut x`
|
||||
LL | unsafe {
|
||||
LL | asm!("nop" : "=r"(x)); //[ast]~ ERROR cannot assign twice
|
||||
LL | asm!("nop" : "=r"(x));
|
||||
| ^ cannot assign twice to immutable variable
|
||||
|
||||
error[E0384]: cannot assign twice to immutable variable `x`
|
||||
@ -43,13 +43,13 @@ LL | let x = 3;
|
||||
| first assignment to `x`
|
||||
| help: make this binding mutable: `mut x`
|
||||
LL | unsafe {
|
||||
LL | asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign twice
|
||||
LL | asm!("nop" : "+r"(x));
|
||||
| ^ cannot assign twice to immutable variable
|
||||
|
||||
error[E0381]: use of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-asm.rs:68:32
|
||||
|
|
||||
LL | asm!("nop" : "=*r"(x)); //[ast]~ ERROR use of possibly uninitialized variable
|
||||
LL | asm!("nop" : "=*r"(x));
|
||||
| ^ use of possibly uninitialized `x`
|
||||
|
||||
error[E0506]: cannot assign to `x` because it is borrowed
|
||||
@ -58,7 +58,7 @@ error[E0506]: cannot assign to `x` because it is borrowed
|
||||
LL | let y = &*x;
|
||||
| --- borrow of `x` occurs here
|
||||
LL | unsafe {
|
||||
LL | asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign to `x` because it is borrowed
|
||||
LL | asm!("nop" : "+r"(x));
|
||||
| ^ assignment to borrowed `x` occurs here
|
||||
...
|
||||
LL | let z = y;
|
||||
@ -70,7 +70,7 @@ error[E0382]: use of moved value: `x`
|
||||
LL | let x = &mut 2;
|
||||
| - move occurs because `x` has type `&mut i32`, which does not implement the `Copy` trait
|
||||
LL | unsafe {
|
||||
LL | asm!("nop" : : "r"(x), "r"(x) ); //[ast]~ ERROR use of moved value
|
||||
LL | asm!("nop" : : "r"(x), "r"(x) );
|
||||
| - ^ value used here after move
|
||||
| |
|
||||
| value moved here
|
||||
|
@ -4,9 +4,9 @@ error[E0506]: cannot assign to `p.x` because it is borrowed
|
||||
LL | let q = &p;
|
||||
| -- borrow of `p.x` occurs here
|
||||
...
|
||||
LL | p.x = 5; //[ast]~ ERROR cannot assign to `p.x`
|
||||
LL | p.x = 5;
|
||||
| ^^^^^^^ assignment to borrowed `p.x` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `p.x` because it is borrowed
|
||||
LL |
|
||||
LL | q.x;
|
||||
| --- borrow later used here
|
||||
|
||||
@ -15,7 +15,7 @@ error[E0506]: cannot assign to `p` because it is borrowed
|
||||
|
|
||||
LL | let q = &p.y;
|
||||
| ---- borrow of `p` occurs here
|
||||
LL | p = Point {x: 5, y: 7};//[ast]~ ERROR cannot assign to `p`
|
||||
LL | p = Point {x: 5, y: 7};
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `p` occurs here
|
||||
...
|
||||
LL | *q; // stretch loan
|
||||
@ -26,9 +26,9 @@ error[E0506]: cannot assign to `p.y` because it is borrowed
|
||||
|
|
||||
LL | let q = &p.y;
|
||||
| ---- borrow of `p.y` occurs here
|
||||
LL | p.y = 5; //[ast]~ ERROR cannot assign to `p.y`
|
||||
LL | p.y = 5;
|
||||
| ^^^^^^^ assignment to borrowed `p.y` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `p.y` because it is borrowed
|
||||
LL |
|
||||
LL | *q;
|
||||
| -- borrow later used here
|
||||
|
||||
|
@ -4,7 +4,7 @@ error[E0506]: cannot assign to `p.x` because it is borrowed
|
||||
LL | let q = &p;
|
||||
| - borrow of `p.x` occurs here
|
||||
...
|
||||
LL | p.x = 5; //[ast]~ ERROR cannot assign to `p.x`
|
||||
LL | p.x = 5;
|
||||
| ^^^^^^^ assignment to borrowed `p.x` occurs here
|
||||
|
||||
error[E0506]: cannot assign to `p` because it is borrowed
|
||||
@ -12,7 +12,7 @@ error[E0506]: cannot assign to `p` because it is borrowed
|
||||
|
|
||||
LL | let q = &p.y;
|
||||
| --- borrow of `p` occurs here
|
||||
LL | p = Point {x: 5, y: 7};//[ast]~ ERROR cannot assign to `p`
|
||||
LL | p = Point {x: 5, y: 7};
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `p` occurs here
|
||||
|
||||
error[E0506]: cannot assign to `p.y` because it is borrowed
|
||||
@ -20,7 +20,7 @@ error[E0506]: cannot assign to `p.y` because it is borrowed
|
||||
|
|
||||
LL | let q = &p.y;
|
||||
| --- borrow of `p.y` occurs here
|
||||
LL | p.y = 5; //[ast]~ ERROR cannot assign to `p.y`
|
||||
LL | p.y = 5;
|
||||
| ^^^^^^^ assignment to borrowed `p.y` occurs here
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
@ -4,9 +4,9 @@ error[E0506]: cannot assign to `p.x` because it is borrowed
|
||||
LL | let q = &p;
|
||||
| -- borrow of `p.x` occurs here
|
||||
...
|
||||
LL | p.x = 5; //[ast]~ ERROR cannot assign to `p.x`
|
||||
LL | p.x = 5;
|
||||
| ^^^^^^^ assignment to borrowed `p.x` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `p.x` because it is borrowed
|
||||
LL |
|
||||
LL | q.x;
|
||||
| --- borrow later used here
|
||||
|
||||
@ -15,7 +15,7 @@ error[E0506]: cannot assign to `p` because it is borrowed
|
||||
|
|
||||
LL | let q = &p.y;
|
||||
| ---- borrow of `p` occurs here
|
||||
LL | p = Point {x: 5, y: 7};//[ast]~ ERROR cannot assign to `p`
|
||||
LL | p = Point {x: 5, y: 7};
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `p` occurs here
|
||||
...
|
||||
LL | *q; // stretch loan
|
||||
@ -26,9 +26,9 @@ error[E0506]: cannot assign to `p.y` because it is borrowed
|
||||
|
|
||||
LL | let q = &p.y;
|
||||
| ---- borrow of `p.y` occurs here
|
||||
LL | p.y = 5; //[ast]~ ERROR cannot assign to `p.y`
|
||||
LL | p.y = 5;
|
||||
| ^^^^^^^ assignment to borrowed `p.y` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `p.y` because it is borrowed
|
||||
LL |
|
||||
LL | *q;
|
||||
| -- borrow later used here
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0594]: cannot assign to immutable static item `foo`
|
||||
--> $DIR/borrowck-assign-to-constants.rs:8:5
|
||||
|
|
||||
LL | foo = 6; //[ast]~ ERROR cannot assign to immutable static item
|
||||
LL | foo = 6;
|
||||
| ^^^^^^^ cannot assign
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0594]: cannot assign to immutable static item
|
||||
--> $DIR/borrowck-assign-to-constants.rs:8:5
|
||||
|
|
||||
LL | foo = 6; //[ast]~ ERROR cannot assign to immutable static item
|
||||
LL | foo = 6;
|
||||
| ^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0594]: cannot assign to immutable static item `foo`
|
||||
--> $DIR/borrowck-assign-to-constants.rs:8:5
|
||||
|
|
||||
LL | foo = 6; //[ast]~ ERROR cannot assign to immutable static item
|
||||
LL | foo = 6;
|
||||
| ^^^^^^^ cannot assign
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -3,8 +3,8 @@ error[E0382]: use of moved value: `a`
|
||||
|
|
||||
LL | let _x = a.x;
|
||||
| -- value moved here
|
||||
LL | //[ast]~^ value moved here
|
||||
LL | let _y = a.y; //[ast]~ ERROR use of moved
|
||||
LL |
|
||||
LL | let _y = a.y;
|
||||
| ^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||
@ -14,8 +14,8 @@ error[E0382]: use of moved value: `a`
|
||||
|
|
||||
LL | let _x = a.x;
|
||||
| -- value moved here
|
||||
LL | //[ast]~^ value moved here
|
||||
LL | let _y = a.y; //[ast]~ ERROR use of moved
|
||||
LL |
|
||||
LL | let _y = a.y;
|
||||
| ^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||
@ -25,8 +25,8 @@ error[E0382]: use of moved value: `a`
|
||||
|
|
||||
LL | let _x = a.x;
|
||||
| -- value moved here
|
||||
LL | //[ast]~^ value moved here
|
||||
LL | let _y = &a.y; //[ast]~ ERROR use of moved
|
||||
LL |
|
||||
LL | let _y = &a.y;
|
||||
| ^^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||
@ -44,7 +44,7 @@ error[E0503]: cannot use `a.y` because it was mutably borrowed
|
||||
|
|
||||
LL | let _x = &mut a.x;
|
||||
| --- borrow of `a.x` occurs here
|
||||
LL | let _y = a.y; //[ast]~ ERROR cannot use
|
||||
LL | let _y = a.y;
|
||||
| ^^ use of borrowed `a.x`
|
||||
|
||||
error[E0505]: cannot move out of `a.y` because it is borrowed
|
||||
@ -60,7 +60,7 @@ error[E0502]: cannot borrow `a` (via `a.y`) as immutable because `a` is also bor
|
||||
|
|
||||
LL | let _x = &mut a.x;
|
||||
| --- mutable borrow occurs here (via `a.x`)
|
||||
LL | let _y = &a.y; //[ast]~ ERROR cannot borrow
|
||||
LL | let _y = &a.y;
|
||||
| ^^^ immutable borrow of `a.y` -- which overlaps with `a.x` -- occurs here
|
||||
...
|
||||
LL | }
|
||||
@ -71,7 +71,7 @@ error[E0502]: cannot borrow `a` (via `a.y`) as mutable because `a` is also borro
|
||||
|
|
||||
LL | let _x = &a.x;
|
||||
| --- immutable borrow occurs here (via `a.x`)
|
||||
LL | let _y = &mut a.y; //[ast]~ ERROR cannot borrow
|
||||
LL | let _y = &mut a.y;
|
||||
| ^^^ mutable borrow of `a.y` -- which overlaps with `a.x` -- occurs here
|
||||
...
|
||||
LL | }
|
||||
@ -82,8 +82,8 @@ error[E0382]: use of collaterally moved value: `a.y`
|
||||
|
|
||||
LL | let _x = a.x.x;
|
||||
| -- value moved here
|
||||
LL | //[ast]~^ value moved here
|
||||
LL | let _y = a.y; //[ast]~ ERROR use of collaterally moved
|
||||
LL |
|
||||
LL | let _y = a.y;
|
||||
| ^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||
@ -93,8 +93,8 @@ error[E0382]: use of collaterally moved value: `a.y`
|
||||
|
|
||||
LL | let _x = a.x.x;
|
||||
| -- value moved here
|
||||
LL | //[ast]~^ value moved here
|
||||
LL | let _y = a.y; //[ast]~ ERROR use of collaterally moved
|
||||
LL |
|
||||
LL | let _y = a.y;
|
||||
| ^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||
@ -104,8 +104,8 @@ error[E0382]: use of collaterally moved value: `a.y`
|
||||
|
|
||||
LL | let _x = a.x.x;
|
||||
| -- value moved here
|
||||
LL | //[ast]~^ value moved here
|
||||
LL | let _y = &a.y; //[ast]~ ERROR use of collaterally moved
|
||||
LL |
|
||||
LL | let _y = &a.y;
|
||||
| ^^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||
@ -115,7 +115,7 @@ error[E0505]: cannot move out of `a.y` because it is borrowed
|
||||
|
|
||||
LL | let _x = &a.x.x;
|
||||
| ----- borrow of `a.x.x` occurs here
|
||||
LL | //[ast]~^ borrow of `a.x.x` occurs here
|
||||
LL |
|
||||
LL | let _y = a.y;
|
||||
| ^^ move out of `a.y` occurs here
|
||||
|
||||
@ -124,7 +124,7 @@ error[E0503]: cannot use `a.y` because it was mutably borrowed
|
||||
|
|
||||
LL | let _x = &mut a.x.x;
|
||||
| ----- borrow of `a.x.x` occurs here
|
||||
LL | let _y = a.y; //[ast]~ ERROR cannot use
|
||||
LL | let _y = a.y;
|
||||
| ^^ use of borrowed `a.x.x`
|
||||
|
||||
error[E0505]: cannot move out of `a.y` because it is borrowed
|
||||
@ -140,8 +140,8 @@ error[E0502]: cannot borrow `a.y` as immutable because `a.x.x` is also borrowed
|
||||
|
|
||||
LL | let _x = &mut a.x.x;
|
||||
| ----- mutable borrow occurs here
|
||||
LL | //[ast]~^ mutable borrow occurs here
|
||||
LL | let _y = &a.y; //[ast]~ ERROR cannot borrow
|
||||
LL |
|
||||
LL | let _y = &a.y;
|
||||
| ^^^ immutable borrow occurs here
|
||||
...
|
||||
LL | }
|
||||
@ -152,8 +152,8 @@ error[E0502]: cannot borrow `a.y` as mutable because `a.x.x` is also borrowed as
|
||||
|
|
||||
LL | let _x = &a.x.x;
|
||||
| ----- immutable borrow occurs here
|
||||
LL | //[ast]~^ immutable borrow occurs here
|
||||
LL | let _y = &mut a.y; //[ast]~ ERROR cannot borrow
|
||||
LL |
|
||||
LL | let _y = &mut a.y;
|
||||
| ^^^ mutable borrow occurs here
|
||||
...
|
||||
LL | }
|
||||
|
@ -1,7 +1,7 @@
|
||||
error: compilation successful
|
||||
--> $DIR/borrowck-box-insensitivity.rs:160:1
|
||||
|
|
||||
LL | / fn main() { //[mir]~ ERROR compilation successful
|
||||
LL | / fn main() {
|
||||
LL | | copy_after_move();
|
||||
LL | | move_after_move();
|
||||
LL | | borrow_after_move();
|
||||
|
@ -5,11 +5,11 @@ LL | let c1 = || x = 4;
|
||||
| -- - first borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| mutable borrow occurs here
|
||||
LL | let c2 = || x * 5; //[ast]~ ERROR cannot borrow `x`
|
||||
LL | let c2 = || x * 5;
|
||||
| ^^ - second borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| immutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable
|
||||
LL |
|
||||
LL | drop(c1);
|
||||
| -- mutable borrow later used here
|
||||
|
||||
@ -20,11 +20,11 @@ LL | let c1 = || set(&mut x);
|
||||
| -- - first borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| mutable borrow occurs here
|
||||
LL | let c2 = || get(&x); //[ast]~ ERROR cannot borrow `x`
|
||||
LL | let c2 = || get(&x);
|
||||
| ^^ - second borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| immutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable
|
||||
LL |
|
||||
LL | drop(c1);
|
||||
| -- mutable borrow later used here
|
||||
|
||||
@ -35,11 +35,11 @@ LL | let c1 = || set(&mut x);
|
||||
| -- - first borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| mutable borrow occurs here
|
||||
LL | let c2 = || x * 5; //[ast]~ ERROR cannot borrow `x`
|
||||
LL | let c2 = || x * 5;
|
||||
| ^^ - second borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| immutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable
|
||||
LL |
|
||||
LL | drop(c1);
|
||||
| -- mutable borrow later used here
|
||||
|
||||
@ -50,9 +50,9 @@ LL | let c2 = || x * 5;
|
||||
| -- - borrow occurs due to use in closure
|
||||
| |
|
||||
| borrow of `x` occurs here
|
||||
LL | x = 5; //[ast]~ ERROR cannot assign
|
||||
LL | x = 5;
|
||||
| ^^^^^ assignment to borrowed `x` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed
|
||||
LL |
|
||||
LL | drop(c2);
|
||||
| -- borrow later used here
|
||||
|
||||
@ -63,9 +63,9 @@ LL | let c1 = || get(&x);
|
||||
| -- - borrow occurs due to use in closure
|
||||
| |
|
||||
| borrow of `x` occurs here
|
||||
LL | x = 5; //[ast]~ ERROR cannot assign
|
||||
LL | x = 5;
|
||||
| ^^^^^ assignment to borrowed `x` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed
|
||||
LL |
|
||||
LL | drop(c1);
|
||||
| -- borrow later used here
|
||||
|
||||
@ -76,9 +76,9 @@ LL | let c1 = || get(&*x);
|
||||
| -- - borrow occurs due to use in closure
|
||||
| |
|
||||
| borrow of `*x` occurs here
|
||||
LL | *x = 5; //[ast]~ ERROR cannot assign to `*x`
|
||||
LL | *x = 5;
|
||||
| ^^^^^^ assignment to borrowed `*x` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `*x` because it is borrowed
|
||||
LL |
|
||||
LL | drop(c1);
|
||||
| -- borrow later used here
|
||||
|
||||
@ -89,9 +89,9 @@ LL | let c1 = || get(&*x.f);
|
||||
| -- - borrow occurs due to use in closure
|
||||
| |
|
||||
| borrow of `*x.f` occurs here
|
||||
LL | *x.f = 5; //[ast]~ ERROR cannot assign to `*x.f`
|
||||
LL | *x.f = 5;
|
||||
| ^^^^^^^^ assignment to borrowed `*x.f` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `*x.f` because it is borrowed
|
||||
LL |
|
||||
LL | drop(c1);
|
||||
| -- borrow later used here
|
||||
|
||||
@ -102,11 +102,11 @@ LL | let c1 = || get(&*x.f);
|
||||
| -- - first borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| immutable borrow occurs here
|
||||
LL | let c2 = || *x.f = 5; //[ast]~ ERROR cannot borrow `x` as mutable
|
||||
LL | let c2 = || *x.f = 5;
|
||||
| ^^ - second borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| mutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR cannot borrow `x` as mutable because it is also borrowed as immutable
|
||||
LL |
|
||||
LL | drop(c1);
|
||||
| -- immutable borrow later used here
|
||||
|
||||
|
@ -5,7 +5,7 @@ LL | let c1 = || x = 4;
|
||||
| -- - previous borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| mutable borrow occurs here
|
||||
LL | let c2 = || x * 5; //[ast]~ ERROR cannot borrow `x`
|
||||
LL | let c2 = || x * 5;
|
||||
| ^^ - borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| immutable borrow occurs here
|
||||
@ -20,7 +20,7 @@ LL | let c1 = || set(&mut x);
|
||||
| -- - previous borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| mutable borrow occurs here
|
||||
LL | let c2 = || get(&x); //[ast]~ ERROR cannot borrow `x`
|
||||
LL | let c2 = || get(&x);
|
||||
| ^^ - borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| immutable borrow occurs here
|
||||
@ -35,7 +35,7 @@ LL | let c1 = || set(&mut x);
|
||||
| -- - previous borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| mutable borrow occurs here
|
||||
LL | let c2 = || x * 5; //[ast]~ ERROR cannot borrow `x`
|
||||
LL | let c2 = || x * 5;
|
||||
| ^^ - borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| immutable borrow occurs here
|
||||
@ -48,7 +48,7 @@ error[E0506]: cannot assign to `x` because it is borrowed
|
||||
|
|
||||
LL | let c2 = || x * 5;
|
||||
| -- borrow of `x` occurs here
|
||||
LL | x = 5; //[ast]~ ERROR cannot assign
|
||||
LL | x = 5;
|
||||
| ^^^^^ assignment to borrowed `x` occurs here
|
||||
|
||||
error[E0506]: cannot assign to `x` because it is borrowed
|
||||
@ -56,7 +56,7 @@ error[E0506]: cannot assign to `x` because it is borrowed
|
||||
|
|
||||
LL | let c1 = || get(&x);
|
||||
| -- borrow of `x` occurs here
|
||||
LL | x = 5; //[ast]~ ERROR cannot assign
|
||||
LL | x = 5;
|
||||
| ^^^^^ assignment to borrowed `x` occurs here
|
||||
|
||||
error[E0506]: cannot assign to `*x` because it is borrowed
|
||||
@ -64,7 +64,7 @@ error[E0506]: cannot assign to `*x` because it is borrowed
|
||||
|
|
||||
LL | let c1 = || get(&*x);
|
||||
| -- borrow of `*x` occurs here
|
||||
LL | *x = 5; //[ast]~ ERROR cannot assign to `*x`
|
||||
LL | *x = 5;
|
||||
| ^^^^^^ assignment to borrowed `*x` occurs here
|
||||
|
||||
error[E0506]: cannot assign to `*x.f` because it is borrowed
|
||||
@ -72,7 +72,7 @@ error[E0506]: cannot assign to `*x.f` because it is borrowed
|
||||
|
|
||||
LL | let c1 = || get(&*x.f);
|
||||
| -- borrow of `*x.f` occurs here
|
||||
LL | *x.f = 5; //[ast]~ ERROR cannot assign to `*x.f`
|
||||
LL | *x.f = 5;
|
||||
| ^^^^^^^^ assignment to borrowed `*x.f` occurs here
|
||||
|
||||
error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
|
||||
@ -82,7 +82,7 @@ LL | let c1 = || get(&*x.f);
|
||||
| -- - previous borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| immutable borrow occurs here
|
||||
LL | let c2 = || *x.f = 5; //[ast]~ ERROR cannot borrow `x` as mutable
|
||||
LL | let c2 = || *x.f = 5;
|
||||
| ^^ - borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| mutable borrow occurs here
|
||||
|
@ -5,11 +5,11 @@ LL | let c1 = || x = 4;
|
||||
| -- - first borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| mutable borrow occurs here
|
||||
LL | let c2 = || x * 5; //[ast]~ ERROR cannot borrow `x`
|
||||
LL | let c2 = || x * 5;
|
||||
| ^^ - second borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| immutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable
|
||||
LL |
|
||||
LL | drop(c1);
|
||||
| -- mutable borrow later used here
|
||||
|
||||
@ -20,11 +20,11 @@ LL | let c1 = || set(&mut x);
|
||||
| -- - first borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| mutable borrow occurs here
|
||||
LL | let c2 = || get(&x); //[ast]~ ERROR cannot borrow `x`
|
||||
LL | let c2 = || get(&x);
|
||||
| ^^ - second borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| immutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable
|
||||
LL |
|
||||
LL | drop(c1);
|
||||
| -- mutable borrow later used here
|
||||
|
||||
@ -35,11 +35,11 @@ LL | let c1 = || set(&mut x);
|
||||
| -- - first borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| mutable borrow occurs here
|
||||
LL | let c2 = || x * 5; //[ast]~ ERROR cannot borrow `x`
|
||||
LL | let c2 = || x * 5;
|
||||
| ^^ - second borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| immutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable
|
||||
LL |
|
||||
LL | drop(c1);
|
||||
| -- mutable borrow later used here
|
||||
|
||||
@ -50,9 +50,9 @@ LL | let c2 = || x * 5;
|
||||
| -- - borrow occurs due to use in closure
|
||||
| |
|
||||
| borrow of `x` occurs here
|
||||
LL | x = 5; //[ast]~ ERROR cannot assign
|
||||
LL | x = 5;
|
||||
| ^^^^^ assignment to borrowed `x` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed
|
||||
LL |
|
||||
LL | drop(c2);
|
||||
| -- borrow later used here
|
||||
|
||||
@ -63,9 +63,9 @@ LL | let c1 = || get(&x);
|
||||
| -- - borrow occurs due to use in closure
|
||||
| |
|
||||
| borrow of `x` occurs here
|
||||
LL | x = 5; //[ast]~ ERROR cannot assign
|
||||
LL | x = 5;
|
||||
| ^^^^^ assignment to borrowed `x` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed
|
||||
LL |
|
||||
LL | drop(c1);
|
||||
| -- borrow later used here
|
||||
|
||||
@ -76,9 +76,9 @@ LL | let c1 = || get(&*x);
|
||||
| -- - borrow occurs due to use in closure
|
||||
| |
|
||||
| borrow of `*x` occurs here
|
||||
LL | *x = 5; //[ast]~ ERROR cannot assign to `*x`
|
||||
LL | *x = 5;
|
||||
| ^^^^^^ assignment to borrowed `*x` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `*x` because it is borrowed
|
||||
LL |
|
||||
LL | drop(c1);
|
||||
| -- borrow later used here
|
||||
|
||||
@ -89,9 +89,9 @@ LL | let c1 = || get(&*x.f);
|
||||
| -- - borrow occurs due to use in closure
|
||||
| |
|
||||
| borrow of `*x.f` occurs here
|
||||
LL | *x.f = 5; //[ast]~ ERROR cannot assign to `*x.f`
|
||||
LL | *x.f = 5;
|
||||
| ^^^^^^^^ assignment to borrowed `*x.f` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `*x.f` because it is borrowed
|
||||
LL |
|
||||
LL | drop(c1);
|
||||
| -- borrow later used here
|
||||
|
||||
@ -102,11 +102,11 @@ LL | let c1 = || get(&*x.f);
|
||||
| -- - first borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| immutable borrow occurs here
|
||||
LL | let c2 = || *x.f = 5; //[ast]~ ERROR cannot borrow `x` as mutable
|
||||
LL | let c2 = || *x.f = 5;
|
||||
| ^^ - second borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| mutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR cannot borrow `x` as mutable because it is also borrowed as immutable
|
||||
LL |
|
||||
LL | drop(c1);
|
||||
| -- immutable borrow later used here
|
||||
|
||||
|
@ -3,9 +3,9 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time
|
||||
|
|
||||
LL | let y = &mut x;
|
||||
| ------ first mutable borrow occurs here
|
||||
LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time
|
||||
LL | &mut x;
|
||||
| ^^^^^^ second mutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time
|
||||
LL |
|
||||
LL | *y = 1;
|
||||
| ------ first borrow later used here
|
||||
|
||||
@ -14,9 +14,9 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time
|
||||
|
|
||||
LL | let y = &mut x;
|
||||
| ------ first mutable borrow occurs here
|
||||
LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time
|
||||
LL | &mut x;
|
||||
| ^^^^^^ second mutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time
|
||||
LL |
|
||||
LL | *y = 1;
|
||||
| ------ first borrow later used here
|
||||
|
||||
@ -25,10 +25,10 @@ error: captured variable cannot escape `FnMut` closure body
|
||||
|
|
||||
LL | || {
|
||||
| - inferred to be a `FnMut` closure
|
||||
LL | / || { //[mir]~ ERROR captured variable cannot escape `FnMut` closure body
|
||||
LL | / || {
|
||||
LL | | let y = &mut x;
|
||||
LL | | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time
|
||||
LL | | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time
|
||||
LL | | &mut x;
|
||||
LL | |
|
||||
LL | | *y = 1;
|
||||
LL | | drop(y);
|
||||
LL | | }
|
||||
@ -42,9 +42,9 @@ error[E0503]: cannot use `f.x` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = f.x();
|
||||
| - borrow of `f` occurs here
|
||||
LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed
|
||||
LL | f.x;
|
||||
| ^^^ use of borrowed `f`
|
||||
LL | //[mir]~^ ERROR cannot use `f.x` because it was mutably borrowed
|
||||
LL |
|
||||
LL | drop(x);
|
||||
| - borrow later used here
|
||||
|
||||
@ -53,9 +53,9 @@ error[E0503]: cannot use `g.0` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = g.x();
|
||||
| - borrow of `g` occurs here
|
||||
LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed
|
||||
LL | g.0;
|
||||
| ^^^ use of borrowed `g`
|
||||
LL | //[mir]~^ ERROR cannot use `g.0` because it was mutably borrowed
|
||||
LL |
|
||||
LL | drop(x);
|
||||
| - borrow later used here
|
||||
|
||||
@ -64,9 +64,9 @@ error[E0503]: cannot use `h.0` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = &mut h.0;
|
||||
| -------- borrow of `h.0` occurs here
|
||||
LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed
|
||||
LL | h.0;
|
||||
| ^^^ use of borrowed `h.0`
|
||||
LL | //[mir]~^ ERROR cannot use `h.0` because it was mutably borrowed
|
||||
LL |
|
||||
LL | drop(x);
|
||||
| - borrow later used here
|
||||
|
||||
@ -87,9 +87,9 @@ error[E0503]: cannot use `u.a` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = &mut u.a;
|
||||
| -------- borrow of `u.a` occurs here
|
||||
LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed
|
||||
LL | u.a;
|
||||
| ^^^ use of borrowed `u.a`
|
||||
LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed
|
||||
LL |
|
||||
LL | drop(x);
|
||||
| - borrow later used here
|
||||
|
||||
@ -98,9 +98,9 @@ error[E0503]: cannot use `f.x` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = f.x();
|
||||
| - borrow of `*f` occurs here
|
||||
LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed
|
||||
LL | f.x;
|
||||
| ^^^ use of borrowed `*f`
|
||||
LL | //[mir]~^ ERROR cannot use `f.x` because it was mutably borrowed
|
||||
LL |
|
||||
LL | drop(x);
|
||||
| - borrow later used here
|
||||
|
||||
@ -109,9 +109,9 @@ error[E0503]: cannot use `g.0` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = g.x();
|
||||
| - borrow of `*g` occurs here
|
||||
LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed
|
||||
LL | g.0;
|
||||
| ^^^ use of borrowed `*g`
|
||||
LL | //[mir]~^ ERROR cannot use `g.0` because it was mutably borrowed
|
||||
LL |
|
||||
LL | drop(x);
|
||||
| - borrow later used here
|
||||
|
||||
@ -120,9 +120,9 @@ error[E0503]: cannot use `h.0` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = &mut h.0;
|
||||
| -------- borrow of `h.0` occurs here
|
||||
LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed
|
||||
LL | h.0;
|
||||
| ^^^ use of borrowed `h.0`
|
||||
LL | //[mir]~^ ERROR cannot use `h.0` because it was mutably borrowed
|
||||
LL |
|
||||
LL | drop(x);
|
||||
| - borrow later used here
|
||||
|
||||
@ -143,9 +143,9 @@ error[E0503]: cannot use `u.a` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = &mut u.a;
|
||||
| -------- borrow of `u.a` occurs here
|
||||
LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed
|
||||
LL | u.a;
|
||||
| ^^^ use of borrowed `u.a`
|
||||
LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed
|
||||
LL |
|
||||
LL | drop(x);
|
||||
| - borrow later used here
|
||||
|
||||
@ -372,7 +372,7 @@ error[E0382]: use of moved value: `x`
|
||||
|
|
||||
LL | drop(x);
|
||||
| - value moved here
|
||||
LL | drop(x); //[ast]~ ERROR use of moved value: `x`
|
||||
LL | drop(x);
|
||||
| ^ value used here after move
|
||||
|
|
||||
= note: move occurs because `x` has type `std::vec::Vec<i32>`, which does not implement the `Copy` trait
|
||||
|
@ -3,7 +3,7 @@ error[E0503]: cannot use `f.x` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = f.x();
|
||||
| - borrow of `f` occurs here
|
||||
LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed
|
||||
LL | f.x;
|
||||
| ^^^ use of borrowed `f`
|
||||
|
||||
error[E0503]: cannot use `g.0` because it was mutably borrowed
|
||||
@ -11,7 +11,7 @@ error[E0503]: cannot use `g.0` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = g.x();
|
||||
| - borrow of `g` occurs here
|
||||
LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed
|
||||
LL | g.0;
|
||||
| ^^^ use of borrowed `g`
|
||||
|
||||
error[E0503]: cannot use `h.0` because it was mutably borrowed
|
||||
@ -19,7 +19,7 @@ error[E0503]: cannot use `h.0` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = &mut h.0;
|
||||
| --- borrow of `h.0` occurs here
|
||||
LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed
|
||||
LL | h.0;
|
||||
| ^^^ use of borrowed `h.0`
|
||||
|
||||
error[E0503]: cannot use `e.0` because it was mutably borrowed
|
||||
@ -36,7 +36,7 @@ error[E0503]: cannot use `u.a` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = &mut u.a;
|
||||
| --- borrow of `u.a` occurs here
|
||||
LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed
|
||||
LL | u.a;
|
||||
| ^^^ use of borrowed `u.a`
|
||||
|
||||
error[E0503]: cannot use `f.x` because it was mutably borrowed
|
||||
@ -44,7 +44,7 @@ error[E0503]: cannot use `f.x` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = f.x();
|
||||
| - borrow of `*f` occurs here
|
||||
LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed
|
||||
LL | f.x;
|
||||
| ^^^ use of borrowed `*f`
|
||||
|
||||
error[E0503]: cannot use `g.0` because it was mutably borrowed
|
||||
@ -52,7 +52,7 @@ error[E0503]: cannot use `g.0` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = g.x();
|
||||
| - borrow of `*g` occurs here
|
||||
LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed
|
||||
LL | g.0;
|
||||
| ^^^ use of borrowed `*g`
|
||||
|
||||
error[E0503]: cannot use `h.0` because it was mutably borrowed
|
||||
@ -60,7 +60,7 @@ error[E0503]: cannot use `h.0` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = &mut h.0;
|
||||
| --- borrow of `h.0` occurs here
|
||||
LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed
|
||||
LL | h.0;
|
||||
| ^^^ use of borrowed `h.0`
|
||||
|
||||
error[E0503]: cannot use `e.0` because it was mutably borrowed
|
||||
@ -77,7 +77,7 @@ error[E0503]: cannot use `u.a` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = &mut u.a;
|
||||
| --- borrow of `u.a` occurs here
|
||||
LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed
|
||||
LL | u.a;
|
||||
| ^^^ use of borrowed `u.a`
|
||||
|
||||
error[E0503]: cannot use `v[..]` because it was mutably borrowed
|
||||
@ -213,7 +213,7 @@ error[E0499]: cannot borrow `**x` as mutable more than once at a time
|
||||
|
|
||||
LL | let y = &mut x;
|
||||
| - first mutable borrow occurs here
|
||||
LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time
|
||||
LL | &mut x;
|
||||
| ^ second mutable borrow occurs here
|
||||
...
|
||||
LL | };
|
||||
@ -224,7 +224,7 @@ error[E0499]: cannot borrow `**x` as mutable more than once at a time
|
||||
|
|
||||
LL | let y = &mut x;
|
||||
| - first mutable borrow occurs here
|
||||
LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time
|
||||
LL | &mut x;
|
||||
| ^ second mutable borrow occurs here
|
||||
...
|
||||
LL | }
|
||||
@ -235,7 +235,7 @@ error[E0382]: use of moved value: `x`
|
||||
|
|
||||
LL | drop(x);
|
||||
| - value moved here
|
||||
LL | drop(x); //[ast]~ ERROR use of moved value: `x`
|
||||
LL | drop(x);
|
||||
| ^ value used here after move
|
||||
|
|
||||
= note: move occurs because `x` has type `std::vec::Vec<i32>`, which does not implement the `Copy` trait
|
||||
|
@ -3,9 +3,9 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time
|
||||
|
|
||||
LL | let y = &mut x;
|
||||
| ------ first mutable borrow occurs here
|
||||
LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time
|
||||
LL | &mut x;
|
||||
| ^^^^^^ second mutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time
|
||||
LL |
|
||||
LL | *y = 1;
|
||||
| ------ first borrow later used here
|
||||
|
||||
@ -14,9 +14,9 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time
|
||||
|
|
||||
LL | let y = &mut x;
|
||||
| ------ first mutable borrow occurs here
|
||||
LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time
|
||||
LL | &mut x;
|
||||
| ^^^^^^ second mutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time
|
||||
LL |
|
||||
LL | *y = 1;
|
||||
| ------ first borrow later used here
|
||||
|
||||
@ -25,10 +25,10 @@ error: captured variable cannot escape `FnMut` closure body
|
||||
|
|
||||
LL | || {
|
||||
| - inferred to be a `FnMut` closure
|
||||
LL | / || { //[mir]~ ERROR captured variable cannot escape `FnMut` closure body
|
||||
LL | / || {
|
||||
LL | | let y = &mut x;
|
||||
LL | | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time
|
||||
LL | | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time
|
||||
LL | | &mut x;
|
||||
LL | |
|
||||
LL | | *y = 1;
|
||||
LL | | drop(y);
|
||||
LL | | }
|
||||
@ -42,9 +42,9 @@ error[E0503]: cannot use `f.x` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = f.x();
|
||||
| - borrow of `f` occurs here
|
||||
LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed
|
||||
LL | f.x;
|
||||
| ^^^ use of borrowed `f`
|
||||
LL | //[mir]~^ ERROR cannot use `f.x` because it was mutably borrowed
|
||||
LL |
|
||||
LL | drop(x);
|
||||
| - borrow later used here
|
||||
|
||||
@ -53,9 +53,9 @@ error[E0503]: cannot use `g.0` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = g.x();
|
||||
| - borrow of `g` occurs here
|
||||
LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed
|
||||
LL | g.0;
|
||||
| ^^^ use of borrowed `g`
|
||||
LL | //[mir]~^ ERROR cannot use `g.0` because it was mutably borrowed
|
||||
LL |
|
||||
LL | drop(x);
|
||||
| - borrow later used here
|
||||
|
||||
@ -64,9 +64,9 @@ error[E0503]: cannot use `h.0` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = &mut h.0;
|
||||
| -------- borrow of `h.0` occurs here
|
||||
LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed
|
||||
LL | h.0;
|
||||
| ^^^ use of borrowed `h.0`
|
||||
LL | //[mir]~^ ERROR cannot use `h.0` because it was mutably borrowed
|
||||
LL |
|
||||
LL | drop(x);
|
||||
| - borrow later used here
|
||||
|
||||
@ -87,9 +87,9 @@ error[E0503]: cannot use `u.a` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = &mut u.a;
|
||||
| -------- borrow of `u.a` occurs here
|
||||
LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed
|
||||
LL | u.a;
|
||||
| ^^^ use of borrowed `u.a`
|
||||
LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed
|
||||
LL |
|
||||
LL | drop(x);
|
||||
| - borrow later used here
|
||||
|
||||
@ -98,9 +98,9 @@ error[E0503]: cannot use `f.x` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = f.x();
|
||||
| - borrow of `*f` occurs here
|
||||
LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed
|
||||
LL | f.x;
|
||||
| ^^^ use of borrowed `*f`
|
||||
LL | //[mir]~^ ERROR cannot use `f.x` because it was mutably borrowed
|
||||
LL |
|
||||
LL | drop(x);
|
||||
| - borrow later used here
|
||||
|
||||
@ -109,9 +109,9 @@ error[E0503]: cannot use `g.0` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = g.x();
|
||||
| - borrow of `*g` occurs here
|
||||
LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed
|
||||
LL | g.0;
|
||||
| ^^^ use of borrowed `*g`
|
||||
LL | //[mir]~^ ERROR cannot use `g.0` because it was mutably borrowed
|
||||
LL |
|
||||
LL | drop(x);
|
||||
| - borrow later used here
|
||||
|
||||
@ -120,9 +120,9 @@ error[E0503]: cannot use `h.0` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = &mut h.0;
|
||||
| -------- borrow of `h.0` occurs here
|
||||
LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed
|
||||
LL | h.0;
|
||||
| ^^^ use of borrowed `h.0`
|
||||
LL | //[mir]~^ ERROR cannot use `h.0` because it was mutably borrowed
|
||||
LL |
|
||||
LL | drop(x);
|
||||
| - borrow later used here
|
||||
|
||||
@ -143,9 +143,9 @@ error[E0503]: cannot use `u.a` because it was mutably borrowed
|
||||
|
|
||||
LL | let x = &mut u.a;
|
||||
| -------- borrow of `u.a` occurs here
|
||||
LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed
|
||||
LL | u.a;
|
||||
| ^^^ use of borrowed `u.a`
|
||||
LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed
|
||||
LL |
|
||||
LL | drop(x);
|
||||
| - borrow later used here
|
||||
|
||||
@ -366,7 +366,7 @@ error[E0382]: use of moved value: `x`
|
||||
|
|
||||
LL | drop(x);
|
||||
| - value moved here
|
||||
LL | drop(x); //[ast]~ ERROR use of moved value: `x`
|
||||
LL | drop(x);
|
||||
| ^ value used here after move
|
||||
|
|
||||
= note: move occurs because `x` has type `std::vec::Vec<i32>`, which does not implement the `Copy` trait
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0507]: cannot move out of borrowed content
|
||||
--> $DIR/borrowck-fn-in-const-a.rs:9:16
|
||||
|
|
||||
LL | return *x //[ast]~ ERROR cannot move out of borrowed content [E0507]
|
||||
LL | return *x
|
||||
| ^^ cannot move out of borrowed content
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0507]: cannot move out of borrowed content
|
||||
--> $DIR/borrowck-fn-in-const-a.rs:9:16
|
||||
|
|
||||
LL | return *x //[ast]~ ERROR cannot move out of borrowed content [E0507]
|
||||
LL | return *x
|
||||
| ^^ cannot move out of borrowed content
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -4,7 +4,7 @@ error[E0506]: cannot assign to `_a` because it is borrowed
|
||||
LL | let b = &mut _a;
|
||||
| ------- borrow of `_a` occurs here
|
||||
...
|
||||
LL | _a = 4; //[ast]~ ERROR cannot assign to `_a`
|
||||
LL | _a = 4;
|
||||
| ^^^^^^ assignment to borrowed `_a` occurs here
|
||||
...
|
||||
LL | drop(b);
|
||||
|
@ -4,7 +4,7 @@ error[E0506]: cannot assign to `_a` because it is borrowed
|
||||
LL | let b = &mut _a;
|
||||
| -- borrow of `_a` occurs here
|
||||
...
|
||||
LL | _a = 4; //[ast]~ ERROR cannot assign to `_a`
|
||||
LL | _a = 4;
|
||||
| ^^^^^^ assignment to borrowed `_a` occurs here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -4,7 +4,7 @@ error[E0506]: cannot assign to `_a` because it is borrowed
|
||||
LL | let b = &mut _a;
|
||||
| ------- borrow of `_a` occurs here
|
||||
...
|
||||
LL | _a = 4; //[ast]~ ERROR cannot assign to `_a`
|
||||
LL | _a = 4;
|
||||
| ^^^^^^ assignment to borrowed `_a` occurs here
|
||||
...
|
||||
LL | drop(b);
|
||||
|
@ -3,7 +3,7 @@ error[E0594]: cannot assign to `***p` which is behind a `&` reference
|
||||
|
|
||||
LL | let p = &y;
|
||||
| -- help: consider changing this to be a mutable reference: `&mut y`
|
||||
LL | ***p = 2; //[ast]~ ERROR cannot assign to data in a `&` reference
|
||||
LL | ***p = 2;
|
||||
| ^^^^^^^^ `p` is a `&` reference, so the data it refers to cannot be written
|
||||
|
||||
error[E0506]: cannot assign to `**y` because it is borrowed
|
||||
@ -12,9 +12,9 @@ error[E0506]: cannot assign to `**y` because it is borrowed
|
||||
LL | let p = &y;
|
||||
| -- borrow of `**y` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed
|
||||
LL | **y = 2;
|
||||
| ^^^^^^^ assignment to borrowed `**y` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed
|
||||
LL |
|
||||
LL | drop(p);
|
||||
| - borrow later used here
|
||||
|
||||
@ -24,9 +24,9 @@ error[E0506]: cannot assign to `**y` because it is borrowed
|
||||
LL | let p = &y;
|
||||
| -- borrow of `**y` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed
|
||||
LL | **y = 2;
|
||||
| ^^^^^^^ assignment to borrowed `**y` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed
|
||||
LL |
|
||||
LL | drop(p);
|
||||
| - borrow later used here
|
||||
|
||||
@ -36,9 +36,9 @@ error[E0506]: cannot assign to `**y` because it is borrowed
|
||||
LL | let p = &y;
|
||||
| -- borrow of `**y` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed
|
||||
LL | **y = 2;
|
||||
| ^^^^^^^ assignment to borrowed `**y` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed
|
||||
LL |
|
||||
LL | drop(p);
|
||||
| - borrow later used here
|
||||
|
||||
@ -48,9 +48,9 @@ error[E0506]: cannot assign to `**y` because it is borrowed
|
||||
LL | let p = &y;
|
||||
| -- borrow of `**y` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed
|
||||
LL | **y = 2;
|
||||
| ^^^^^^^ assignment to borrowed `**y` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed
|
||||
LL |
|
||||
LL | drop(p);
|
||||
| - borrow later used here
|
||||
|
||||
@ -60,9 +60,9 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed
|
||||
LL | let p = &y.a;
|
||||
| ---- borrow of `**y.a` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
LL | **y.a = 2;
|
||||
| ^^^^^^^^^ assignment to borrowed `**y.a` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
LL |
|
||||
LL | drop(p);
|
||||
| - borrow later used here
|
||||
|
||||
@ -72,9 +72,9 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed
|
||||
LL | let p = &y.a;
|
||||
| ---- borrow of `**y.a` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
LL | **y.a = 2;
|
||||
| ^^^^^^^^^ assignment to borrowed `**y.a` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
LL |
|
||||
LL | drop(p);
|
||||
| - borrow later used here
|
||||
|
||||
@ -84,9 +84,9 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed
|
||||
LL | let p = &y.a;
|
||||
| ---- borrow of `**y.a` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
LL | **y.a = 2;
|
||||
| ^^^^^^^^^ assignment to borrowed `**y.a` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
LL |
|
||||
LL | drop(p);
|
||||
| - borrow later used here
|
||||
|
||||
@ -96,9 +96,9 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed
|
||||
LL | let p = &y.a;
|
||||
| ---- borrow of `**y.a` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
LL | **y.a = 2;
|
||||
| ^^^^^^^^^ assignment to borrowed `**y.a` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
LL |
|
||||
LL | drop(p);
|
||||
| - borrow later used here
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0389]: cannot assign to data in a `&` reference
|
||||
--> $DIR/borrowck-issue-14498.rs:19:5
|
||||
|
|
||||
LL | ***p = 2; //[ast]~ ERROR cannot assign to data in a `&` reference
|
||||
LL | ***p = 2;
|
||||
| ^^^^^^^^ assignment into an immutable reference
|
||||
|
||||
error[E0506]: cannot assign to `**y` because it is borrowed
|
||||
@ -10,7 +10,7 @@ error[E0506]: cannot assign to `**y` because it is borrowed
|
||||
LL | let p = &y;
|
||||
| - borrow of `**y` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed
|
||||
LL | **y = 2;
|
||||
| ^^^^^^^ assignment to borrowed `**y` occurs here
|
||||
|
||||
error[E0506]: cannot assign to `**y` because it is borrowed
|
||||
@ -19,7 +19,7 @@ error[E0506]: cannot assign to `**y` because it is borrowed
|
||||
LL | let p = &y;
|
||||
| - borrow of `**y` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed
|
||||
LL | **y = 2;
|
||||
| ^^^^^^^ assignment to borrowed `**y` occurs here
|
||||
|
||||
error[E0506]: cannot assign to `**y` because it is borrowed
|
||||
@ -28,7 +28,7 @@ error[E0506]: cannot assign to `**y` because it is borrowed
|
||||
LL | let p = &y;
|
||||
| - borrow of `**y` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed
|
||||
LL | **y = 2;
|
||||
| ^^^^^^^ assignment to borrowed `**y` occurs here
|
||||
|
||||
error[E0506]: cannot assign to `**y` because it is borrowed
|
||||
@ -37,7 +37,7 @@ error[E0506]: cannot assign to `**y` because it is borrowed
|
||||
LL | let p = &y;
|
||||
| - borrow of `**y` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed
|
||||
LL | **y = 2;
|
||||
| ^^^^^^^ assignment to borrowed `**y` occurs here
|
||||
|
||||
error[E0506]: cannot assign to `**y.a` because it is borrowed
|
||||
@ -46,7 +46,7 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed
|
||||
LL | let p = &y.a;
|
||||
| --- borrow of `**y.a` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
LL | **y.a = 2;
|
||||
| ^^^^^^^^^ assignment to borrowed `**y.a` occurs here
|
||||
|
||||
error[E0506]: cannot assign to `**y.a` because it is borrowed
|
||||
@ -55,7 +55,7 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed
|
||||
LL | let p = &y.a;
|
||||
| --- borrow of `**y.a` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
LL | **y.a = 2;
|
||||
| ^^^^^^^^^ assignment to borrowed `**y.a` occurs here
|
||||
|
||||
error[E0506]: cannot assign to `**y.a` because it is borrowed
|
||||
@ -64,7 +64,7 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed
|
||||
LL | let p = &y.a;
|
||||
| --- borrow of `**y.a` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
LL | **y.a = 2;
|
||||
| ^^^^^^^^^ assignment to borrowed `**y.a` occurs here
|
||||
|
||||
error[E0506]: cannot assign to `**y.a` because it is borrowed
|
||||
@ -73,7 +73,7 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed
|
||||
LL | let p = &y.a;
|
||||
| --- borrow of `**y.a` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
LL | **y.a = 2;
|
||||
| ^^^^^^^^^ assignment to borrowed `**y.a` occurs here
|
||||
|
||||
error: aborting due to 9 previous errors
|
||||
|
@ -3,7 +3,7 @@ error[E0594]: cannot assign to `***p` which is behind a `&` reference
|
||||
|
|
||||
LL | let p = &y;
|
||||
| -- help: consider changing this to be a mutable reference: `&mut y`
|
||||
LL | ***p = 2; //[ast]~ ERROR cannot assign to data in a `&` reference
|
||||
LL | ***p = 2;
|
||||
| ^^^^^^^^ `p` is a `&` reference, so the data it refers to cannot be written
|
||||
|
||||
error[E0506]: cannot assign to `**y` because it is borrowed
|
||||
@ -12,9 +12,9 @@ error[E0506]: cannot assign to `**y` because it is borrowed
|
||||
LL | let p = &y;
|
||||
| -- borrow of `**y` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed
|
||||
LL | **y = 2;
|
||||
| ^^^^^^^ assignment to borrowed `**y` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed
|
||||
LL |
|
||||
LL | drop(p);
|
||||
| - borrow later used here
|
||||
|
||||
@ -24,9 +24,9 @@ error[E0506]: cannot assign to `**y` because it is borrowed
|
||||
LL | let p = &y;
|
||||
| -- borrow of `**y` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed
|
||||
LL | **y = 2;
|
||||
| ^^^^^^^ assignment to borrowed `**y` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed
|
||||
LL |
|
||||
LL | drop(p);
|
||||
| - borrow later used here
|
||||
|
||||
@ -36,9 +36,9 @@ error[E0506]: cannot assign to `**y` because it is borrowed
|
||||
LL | let p = &y;
|
||||
| -- borrow of `**y` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed
|
||||
LL | **y = 2;
|
||||
| ^^^^^^^ assignment to borrowed `**y` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed
|
||||
LL |
|
||||
LL | drop(p);
|
||||
| - borrow later used here
|
||||
|
||||
@ -48,9 +48,9 @@ error[E0506]: cannot assign to `**y` because it is borrowed
|
||||
LL | let p = &y;
|
||||
| -- borrow of `**y` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed
|
||||
LL | **y = 2;
|
||||
| ^^^^^^^ assignment to borrowed `**y` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed
|
||||
LL |
|
||||
LL | drop(p);
|
||||
| - borrow later used here
|
||||
|
||||
@ -60,9 +60,9 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed
|
||||
LL | let p = &y.a;
|
||||
| ---- borrow of `**y.a` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
LL | **y.a = 2;
|
||||
| ^^^^^^^^^ assignment to borrowed `**y.a` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
LL |
|
||||
LL | drop(p);
|
||||
| - borrow later used here
|
||||
|
||||
@ -72,9 +72,9 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed
|
||||
LL | let p = &y.a;
|
||||
| ---- borrow of `**y.a` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
LL | **y.a = 2;
|
||||
| ^^^^^^^^^ assignment to borrowed `**y.a` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
LL |
|
||||
LL | drop(p);
|
||||
| - borrow later used here
|
||||
|
||||
@ -84,9 +84,9 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed
|
||||
LL | let p = &y.a;
|
||||
| ---- borrow of `**y.a` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
LL | **y.a = 2;
|
||||
| ^^^^^^^^^ assignment to borrowed `**y.a` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
LL |
|
||||
LL | drop(p);
|
||||
| - borrow later used here
|
||||
|
||||
@ -96,9 +96,9 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed
|
||||
LL | let p = &y.a;
|
||||
| ---- borrow of `**y.a` occurs here
|
||||
LL | let q = &***p;
|
||||
LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
LL | **y.a = 2;
|
||||
| ^^^^^^^^^ assignment to borrowed `**y.a` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed
|
||||
LL |
|
||||
LL | drop(p);
|
||||
| - borrow later used here
|
||||
|
||||
|
@ -4,7 +4,7 @@ error[E0502]: cannot borrow `*v` as immutable because `v` is also borrowed as mu
|
||||
LL | let mut x = &mut v;
|
||||
| - mutable borrow occurs here
|
||||
...
|
||||
LL | borrow(&*v); //[ast]~ ERROR cannot borrow
|
||||
LL | borrow(&*v);
|
||||
| ^^ immutable borrow occurs here
|
||||
LL | }
|
||||
LL | }
|
||||
@ -16,7 +16,7 @@ error[E0502]: cannot borrow `*v` as immutable because `v` is also borrowed as mu
|
||||
LL | let mut x = &mut v;
|
||||
| - mutable borrow occurs here
|
||||
LL | for _ in 0..3 {
|
||||
LL | borrow(&*v); //[ast]~ ERROR cannot borrow
|
||||
LL | borrow(&*v);
|
||||
| ^^ immutable borrow occurs here
|
||||
...
|
||||
LL | }
|
||||
@ -25,7 +25,7 @@ LL | }
|
||||
error[E0502]: cannot borrow `*v` as mutable because `v` is also borrowed as immutable
|
||||
--> $DIR/borrowck-lend-flow-loop.rs:57:25
|
||||
|
|
||||
LL | borrow_mut(&mut *v); //[ast]~ ERROR cannot borrow
|
||||
LL | borrow_mut(&mut *v);
|
||||
| ^^ mutable borrow occurs here
|
||||
LL | _x = &v;
|
||||
| - immutable borrow occurs here
|
||||
@ -36,7 +36,7 @@ LL | }
|
||||
error[E0502]: cannot borrow `*v` as mutable because `v` is also borrowed as immutable
|
||||
--> $DIR/borrowck-lend-flow-loop.rs:69:25
|
||||
|
|
||||
LL | borrow_mut(&mut *v); //[ast]~ ERROR cannot borrow
|
||||
LL | borrow_mut(&mut *v);
|
||||
| ^^ mutable borrow occurs here
|
||||
LL | _x = &v;
|
||||
| - immutable borrow occurs here
|
||||
@ -50,7 +50,7 @@ error[E0502]: cannot borrow `*v` as mutable because `v` is also borrowed as immu
|
||||
LL | _x = &v;
|
||||
| - immutable borrow occurs here
|
||||
...
|
||||
LL | borrow_mut(&mut *v); //[ast]~ ERROR cannot borrow
|
||||
LL | borrow_mut(&mut *v);
|
||||
| ^^ mutable borrow occurs here
|
||||
LL | }
|
||||
| - immutable borrow ends here
|
||||
@ -61,7 +61,7 @@ error[E0502]: cannot borrow `*v` as mutable because `v` is also borrowed as immu
|
||||
LL | _x = &v;
|
||||
| - immutable borrow occurs here
|
||||
...
|
||||
LL | borrow_mut(&mut *v); //[ast]~ ERROR cannot borrow
|
||||
LL | borrow_mut(&mut *v);
|
||||
| ^^ mutable borrow occurs here
|
||||
LL | }
|
||||
| - immutable borrow ends here
|
||||
@ -69,10 +69,10 @@ LL | }
|
||||
error[E0502]: cannot borrow `*v` as immutable because `v` is also borrowed as mutable
|
||||
--> $DIR/borrowck-lend-flow-loop.rs:109:17
|
||||
|
|
||||
LL | borrow(&*v); //[ast]~ ERROR cannot borrow
|
||||
LL | borrow(&*v);
|
||||
| ^^ immutable borrow occurs here
|
||||
...
|
||||
LL | x = &mut v; //[ast]~ ERROR cannot borrow
|
||||
LL | x = &mut v;
|
||||
| - mutable borrow occurs here
|
||||
...
|
||||
LL | }
|
||||
@ -81,7 +81,7 @@ LL | }
|
||||
error[E0499]: cannot borrow `v` as mutable more than once at a time
|
||||
--> $DIR/borrowck-lend-flow-loop.rs:112:22
|
||||
|
|
||||
LL | x = &mut v; //[ast]~ ERROR cannot borrow
|
||||
LL | x = &mut v;
|
||||
| ^ mutable borrow starts here in previous iteration of loop
|
||||
...
|
||||
LL | }
|
||||
|
@ -4,7 +4,7 @@ error[E0502]: cannot borrow `*v` as immutable because it is also borrowed as mut
|
||||
LL | let mut x = &mut v;
|
||||
| ------ mutable borrow occurs here
|
||||
LL | for _ in 0..3 {
|
||||
LL | borrow(&*v); //[ast]~ ERROR cannot borrow
|
||||
LL | borrow(&*v);
|
||||
| ^^^ immutable borrow occurs here
|
||||
...
|
||||
LL | *x = box 5;
|
||||
@ -15,10 +15,10 @@ error[E0502]: cannot borrow `*v` as immutable because it is also borrowed as mut
|
||||
|
|
||||
LL | **x += 1;
|
||||
| -------- mutable borrow later used here
|
||||
LL | borrow(&*v); //[ast]~ ERROR cannot borrow
|
||||
LL | borrow(&*v);
|
||||
| ^^^ immutable borrow occurs here
|
||||
...
|
||||
LL | x = &mut v; //[ast]~ ERROR cannot borrow
|
||||
LL | x = &mut v;
|
||||
| ------ mutable borrow occurs here
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
@ -3,9 +3,9 @@ error[E0506]: cannot assign to `x` because it is borrowed
|
||||
|
|
||||
LL | Some(ref r) => {
|
||||
| ----- borrow of `x` occurs here
|
||||
LL | x = Some(1); //[ast]~ ERROR cannot assign
|
||||
LL | x = Some(1);
|
||||
| ^^^^^^^^^^^ assignment to borrowed `x` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed
|
||||
LL |
|
||||
LL | drop(r);
|
||||
| - borrow later used here
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0506]: cannot assign to `x` because it is borrowed
|
||||
|
|
||||
LL | Some(ref r) => {
|
||||
| ----- borrow of `x` occurs here
|
||||
LL | x = Some(1); //[ast]~ ERROR cannot assign
|
||||
LL | x = Some(1);
|
||||
| ^^^^^^^^^^^ assignment to borrowed `x` occurs here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -3,9 +3,9 @@ error[E0506]: cannot assign to `x` because it is borrowed
|
||||
|
|
||||
LL | Some(ref r) => {
|
||||
| ----- borrow of `x` occurs here
|
||||
LL | x = Some(1); //[ast]~ ERROR cannot assign
|
||||
LL | x = Some(1);
|
||||
| ^^^^^^^^^^^ assignment to borrowed `x` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed
|
||||
LL |
|
||||
LL | drop(r);
|
||||
| - borrow later used here
|
||||
|
||||
|
@ -4,7 +4,7 @@ error[E0503]: cannot use `foo` because it was mutably borrowed
|
||||
LL | let p = &mut foo;
|
||||
| -------- borrow of `foo` occurs here
|
||||
LL | let _ = match foo {
|
||||
LL | Foo::B => 1, //[mir]~ ERROR [E0503]
|
||||
LL | Foo::B => 1,
|
||||
| ^^^^^^ use of borrowed `foo`
|
||||
...
|
||||
LL | drop(p);
|
||||
@ -16,7 +16,7 @@ error[E0503]: cannot use `foo.0` because it was mutably borrowed
|
||||
LL | let p = &mut foo;
|
||||
| -------- borrow of `foo` occurs here
|
||||
...
|
||||
LL | Foo::A(x) => x //[ast]~ ERROR [E0503]
|
||||
LL | Foo::A(x) => x
|
||||
| ^ use of borrowed `foo`
|
||||
...
|
||||
LL | drop(p);
|
||||
@ -28,7 +28,7 @@ error[E0503]: cannot use `x` because it was mutably borrowed
|
||||
LL | let r = &mut x;
|
||||
| ------ borrow of `x` occurs here
|
||||
LL | let _ = match x {
|
||||
LL | x => x + 1, //[ast]~ ERROR [E0503]
|
||||
LL | x => x + 1,
|
||||
| ^ use of borrowed `x`
|
||||
...
|
||||
LL | drop(r);
|
||||
@ -40,7 +40,7 @@ error[E0503]: cannot use `x` because it was mutably borrowed
|
||||
LL | let r = &mut x;
|
||||
| ------ borrow of `x` occurs here
|
||||
...
|
||||
LL | y => y + 2, //[ast]~ ERROR [E0503]
|
||||
LL | y => y + 2,
|
||||
| ^ use of borrowed `x`
|
||||
...
|
||||
LL | drop(r);
|
||||
|
@ -4,7 +4,7 @@ error[E0503]: cannot use `(foo as Foo::A).0` because it was mutably borrowed
|
||||
LL | let p = &mut foo;
|
||||
| --- borrow of `foo` occurs here
|
||||
...
|
||||
LL | Foo::A(x) => x //[ast]~ ERROR [E0503]
|
||||
LL | Foo::A(x) => x
|
||||
| ^ use of borrowed `foo`
|
||||
|
||||
error[E0503]: cannot use `x` because it was mutably borrowed
|
||||
@ -13,7 +13,7 @@ error[E0503]: cannot use `x` because it was mutably borrowed
|
||||
LL | let r = &mut x;
|
||||
| - borrow of `x` occurs here
|
||||
LL | let _ = match x {
|
||||
LL | x => x + 1, //[ast]~ ERROR [E0503]
|
||||
LL | x => x + 1,
|
||||
| ^ use of borrowed `x`
|
||||
|
||||
error[E0503]: cannot use `x` because it was mutably borrowed
|
||||
@ -22,7 +22,7 @@ error[E0503]: cannot use `x` because it was mutably borrowed
|
||||
LL | let r = &mut x;
|
||||
| - borrow of `x` occurs here
|
||||
...
|
||||
LL | y => y + 2, //[ast]~ ERROR [E0503]
|
||||
LL | y => y + 2,
|
||||
| ^ use of borrowed `x`
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
@ -4,7 +4,7 @@ error[E0503]: cannot use `foo` because it was mutably borrowed
|
||||
LL | let p = &mut foo;
|
||||
| -------- borrow of `foo` occurs here
|
||||
LL | let _ = match foo {
|
||||
LL | Foo::B => 1, //[mir]~ ERROR [E0503]
|
||||
LL | Foo::B => 1,
|
||||
| ^^^^^^ use of borrowed `foo`
|
||||
...
|
||||
LL | drop(p);
|
||||
@ -16,7 +16,7 @@ error[E0503]: cannot use `foo.0` because it was mutably borrowed
|
||||
LL | let p = &mut foo;
|
||||
| -------- borrow of `foo` occurs here
|
||||
...
|
||||
LL | Foo::A(x) => x //[ast]~ ERROR [E0503]
|
||||
LL | Foo::A(x) => x
|
||||
| ^ use of borrowed `foo`
|
||||
...
|
||||
LL | drop(p);
|
||||
@ -28,7 +28,7 @@ error[E0503]: cannot use `x` because it was mutably borrowed
|
||||
LL | let r = &mut x;
|
||||
| ------ borrow of `x` occurs here
|
||||
LL | let _ = match x {
|
||||
LL | x => x + 1, //[ast]~ ERROR [E0503]
|
||||
LL | x => x + 1,
|
||||
| ^ use of borrowed `x`
|
||||
...
|
||||
LL | drop(r);
|
||||
@ -40,7 +40,7 @@ error[E0503]: cannot use `x` because it was mutably borrowed
|
||||
LL | let r = &mut x;
|
||||
| ------ borrow of `x` occurs here
|
||||
...
|
||||
LL | y => y + 2, //[ast]~ ERROR [E0503]
|
||||
LL | y => y + 2,
|
||||
| ^ use of borrowed `x`
|
||||
...
|
||||
LL | drop(r);
|
||||
|
@ -6,7 +6,7 @@ LL | x => {
|
||||
| |
|
||||
| first assignment to `x`
|
||||
| help: make this binding mutable: `mut x`
|
||||
LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x`
|
||||
LL | x += 1;
|
||||
| ^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error[E0384]: cannot assign twice to immutable variable `x`
|
||||
@ -17,7 +17,7 @@ LL | E::Foo(x) => {
|
||||
| |
|
||||
| first assignment to `x`
|
||||
| help: make this binding mutable: `mut x`
|
||||
LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x`
|
||||
LL | x += 1;
|
||||
| ^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error[E0384]: cannot assign twice to immutable variable `x`
|
||||
@ -28,7 +28,7 @@ LL | S { bar: x } => {
|
||||
| |
|
||||
| first assignment to `x`
|
||||
| help: make this binding mutable: `mut x`
|
||||
LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x`
|
||||
LL | x += 1;
|
||||
| ^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error[E0384]: cannot assign twice to immutable variable `x`
|
||||
@ -39,7 +39,7 @@ LL | (x,) => {
|
||||
| |
|
||||
| first assignment to `x`
|
||||
| help: make this binding mutable: `mut x`
|
||||
LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x`
|
||||
LL | x += 1;
|
||||
| ^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error[E0384]: cannot assign twice to immutable variable `x`
|
||||
@ -50,7 +50,7 @@ LL | [x,_,_] => {
|
||||
| |
|
||||
| first assignment to `x`
|
||||
| help: make this binding mutable: `mut x`
|
||||
LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x`
|
||||
LL | x += 1;
|
||||
| ^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
@ -3,7 +3,7 @@ error[E0384]: cannot assign twice to immutable variable `x`
|
||||
|
|
||||
LL | x => {
|
||||
| - first assignment to `x`
|
||||
LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x`
|
||||
LL | x += 1;
|
||||
| ^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error[E0384]: cannot assign twice to immutable variable `x`
|
||||
@ -11,7 +11,7 @@ error[E0384]: cannot assign twice to immutable variable `x`
|
||||
|
|
||||
LL | E::Foo(x) => {
|
||||
| - first assignment to `x`
|
||||
LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x`
|
||||
LL | x += 1;
|
||||
| ^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error[E0384]: cannot assign twice to immutable variable `x`
|
||||
@ -19,7 +19,7 @@ error[E0384]: cannot assign twice to immutable variable `x`
|
||||
|
|
||||
LL | S { bar: x } => {
|
||||
| - first assignment to `x`
|
||||
LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x`
|
||||
LL | x += 1;
|
||||
| ^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error[E0384]: cannot assign twice to immutable variable `x`
|
||||
@ -27,7 +27,7 @@ error[E0384]: cannot assign twice to immutable variable `x`
|
||||
|
|
||||
LL | (x,) => {
|
||||
| - first assignment to `x`
|
||||
LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x`
|
||||
LL | x += 1;
|
||||
| ^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error[E0384]: cannot assign twice to immutable variable `x`
|
||||
@ -35,7 +35,7 @@ error[E0384]: cannot assign twice to immutable variable `x`
|
||||
|
|
||||
LL | [x,_,_] => {
|
||||
| - first assignment to `x`
|
||||
LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x`
|
||||
LL | x += 1;
|
||||
| ^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
@ -6,7 +6,7 @@ LL | x => {
|
||||
| |
|
||||
| first assignment to `x`
|
||||
| help: make this binding mutable: `mut x`
|
||||
LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x`
|
||||
LL | x += 1;
|
||||
| ^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error[E0384]: cannot assign twice to immutable variable `x`
|
||||
@ -17,7 +17,7 @@ LL | E::Foo(x) => {
|
||||
| |
|
||||
| first assignment to `x`
|
||||
| help: make this binding mutable: `mut x`
|
||||
LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x`
|
||||
LL | x += 1;
|
||||
| ^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error[E0384]: cannot assign twice to immutable variable `x`
|
||||
@ -28,7 +28,7 @@ LL | S { bar: x } => {
|
||||
| |
|
||||
| first assignment to `x`
|
||||
| help: make this binding mutable: `mut x`
|
||||
LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x`
|
||||
LL | x += 1;
|
||||
| ^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error[E0384]: cannot assign twice to immutable variable `x`
|
||||
@ -39,7 +39,7 @@ LL | (x,) => {
|
||||
| |
|
||||
| first assignment to `x`
|
||||
| help: make this binding mutable: `mut x`
|
||||
LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x`
|
||||
LL | x += 1;
|
||||
| ^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error[E0384]: cannot assign twice to immutable variable `x`
|
||||
@ -50,7 +50,7 @@ LL | [x,_,_] => {
|
||||
| |
|
||||
| first assignment to `x`
|
||||
| help: make this binding mutable: `mut x`
|
||||
LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x`
|
||||
LL | x += 1;
|
||||
| ^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
@ -8,7 +8,7 @@ LL | call_f(move|| { *t + 1 });
|
||||
| ------ - variable moved due to use in closure
|
||||
| |
|
||||
| value moved into closure here
|
||||
LL | call_f(move|| { *t + 1 }); //[ast]~ ERROR capture of moved value
|
||||
LL | call_f(move|| { *t + 1 });
|
||||
| ^^^^^^ - use occurs due to use in closure
|
||||
| |
|
||||
| value used here after move
|
||||
|
@ -3,7 +3,7 @@ error[E0382]: capture of moved value: `t`
|
||||
|
|
||||
LL | call_f(move|| { *t + 1 });
|
||||
| ------ value moved (into closure) here
|
||||
LL | call_f(move|| { *t + 1 }); //[ast]~ ERROR capture of moved value
|
||||
LL | call_f(move|| { *t + 1 });
|
||||
| ^ value captured here after move
|
||||
|
|
||||
= note: move occurs because `t` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||
|
@ -8,7 +8,7 @@ LL | call_f(move|| { *t + 1 });
|
||||
| ------ - variable moved due to use in closure
|
||||
| |
|
||||
| value moved into closure here
|
||||
LL | call_f(move|| { *t + 1 }); //[ast]~ ERROR capture of moved value
|
||||
LL | call_f(move|| { *t + 1 });
|
||||
| ^^^^^^ - use occurs due to use in closure
|
||||
| |
|
||||
| value used here after move
|
||||
|
@ -3,7 +3,7 @@ error[E0382]: use of moved value: `a[..]`
|
||||
|
|
||||
LL | let [_, _x] = a;
|
||||
| -- value moved here
|
||||
LL | let [.., _y] = a; //[ast]~ ERROR [E0382]
|
||||
LL | let [.., _y] = a;
|
||||
| ^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `a[..]` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
|
||||
@ -13,7 +13,7 @@ error[E0382]: use of moved value: `a[..]`
|
||||
|
|
||||
LL | let [_x, _] = a;
|
||||
| -- value moved here
|
||||
LL | let [_y..] = a; //[ast]~ ERROR [E0382]
|
||||
LL | let [_y..] = a;
|
||||
| ^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `a[..]` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
|
||||
|
@ -3,7 +3,7 @@ error[E0382]: use of moved value: `a[..]`
|
||||
|
|
||||
LL | let [_, _x] = a;
|
||||
| -- value moved here
|
||||
LL | let [.., _y] = a; //[ast]~ ERROR [E0382]
|
||||
LL | let [.., _y] = a;
|
||||
| ^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `a[..]` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
|
||||
@ -13,7 +13,7 @@ error[E0382]: use of moved value: `a[..]`
|
||||
|
|
||||
LL | let [_x, _] = a;
|
||||
| -- value moved here
|
||||
LL | let [_y..] = a; //[ast]~ ERROR [E0382]
|
||||
LL | let [_y..] = a;
|
||||
| ^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `a[..]` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0507]: cannot move out of static item
|
||||
--> $DIR/borrowck-move-out-of-static-item.rs:18:10
|
||||
|
|
||||
LL | test(BAR); //[ast]~ ERROR cannot move out of static item [E0507]
|
||||
LL | test(BAR);
|
||||
| ^^^ cannot move out of static item
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0507]: cannot move out of static item
|
||||
--> $DIR/borrowck-move-out-of-static-item.rs:18:10
|
||||
|
|
||||
LL | test(BAR); //[ast]~ ERROR cannot move out of static item [E0507]
|
||||
LL | test(BAR);
|
||||
| ^^^ cannot move out of static item
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -3,7 +3,7 @@ error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
|
||||
|
|
||||
LL | match (S {f:"foo".to_string()}) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here
|
||||
LL | //[mir]~^ ERROR [E0509]
|
||||
LL |
|
||||
LL | S {f:_s} => {}
|
||||
| -- data moved here
|
||||
|
|
||||
|
@ -3,7 +3,7 @@ error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
|
||||
|
|
||||
LL | match (S {f:"foo".to_string()}) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here
|
||||
LL | //[mir]~^ ERROR [E0509]
|
||||
LL |
|
||||
LL | S {f:_s} => {}
|
||||
| -- data moved here
|
||||
|
|
||||
|
@ -1,30 +1,30 @@
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time
|
||||
--> $DIR/borrowck-mut-borrow-linear-errors.rs:13:30
|
||||
|
|
||||
LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
|
||||
LL | 1 => { addr.push(&mut x); }
|
||||
| ---- ^^^^^^ second mutable borrow occurs here
|
||||
| |
|
||||
| first borrow later used here
|
||||
...
|
||||
LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
|
||||
LL | _ => { addr.push(&mut x); }
|
||||
| ------ first mutable borrow occurs here
|
||||
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time
|
||||
--> $DIR/borrowck-mut-borrow-linear-errors.rs:15:30
|
||||
|
|
||||
LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
|
||||
LL | 1 => { addr.push(&mut x); }
|
||||
| ---- first borrow later used here
|
||||
LL | //[mir]~^ ERROR [E0499]
|
||||
LL | 2 => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
|
||||
LL |
|
||||
LL | 2 => { addr.push(&mut x); }
|
||||
| ^^^^^^ second mutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR [E0499]
|
||||
LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
|
||||
LL |
|
||||
LL | _ => { addr.push(&mut x); }
|
||||
| ------ first mutable borrow occurs here
|
||||
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time
|
||||
--> $DIR/borrowck-mut-borrow-linear-errors.rs:17:30
|
||||
|
|
||||
LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
|
||||
LL | _ => { addr.push(&mut x); }
|
||||
| ^^^^^^ mutable borrow starts here in previous iteration of loop
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time
|
||||
--> $DIR/borrowck-mut-borrow-linear-errors.rs:13:35
|
||||
|
|
||||
LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
|
||||
LL | 1 => { addr.push(&mut x); }
|
||||
| ^ mutable borrow starts here in previous iteration of loop
|
||||
...
|
||||
LL | }
|
||||
@ -10,10 +10,10 @@ LL | }
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time
|
||||
--> $DIR/borrowck-mut-borrow-linear-errors.rs:15:35
|
||||
|
|
||||
LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
|
||||
LL | 1 => { addr.push(&mut x); }
|
||||
| - first mutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR [E0499]
|
||||
LL | 2 => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
|
||||
LL |
|
||||
LL | 2 => { addr.push(&mut x); }
|
||||
| ^ second mutable borrow occurs here
|
||||
...
|
||||
LL | }
|
||||
@ -22,10 +22,10 @@ LL | }
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time
|
||||
--> $DIR/borrowck-mut-borrow-linear-errors.rs:17:35
|
||||
|
|
||||
LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
|
||||
LL | 1 => { addr.push(&mut x); }
|
||||
| - first mutable borrow occurs here
|
||||
...
|
||||
LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
|
||||
LL | _ => { addr.push(&mut x); }
|
||||
| ^ second mutable borrow occurs here
|
||||
...
|
||||
LL | }
|
||||
|
@ -1,30 +1,30 @@
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time
|
||||
--> $DIR/borrowck-mut-borrow-linear-errors.rs:13:30
|
||||
|
|
||||
LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
|
||||
LL | 1 => { addr.push(&mut x); }
|
||||
| ---- ^^^^^^ second mutable borrow occurs here
|
||||
| |
|
||||
| first borrow later used here
|
||||
...
|
||||
LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
|
||||
LL | _ => { addr.push(&mut x); }
|
||||
| ------ first mutable borrow occurs here
|
||||
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time
|
||||
--> $DIR/borrowck-mut-borrow-linear-errors.rs:15:30
|
||||
|
|
||||
LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
|
||||
LL | 1 => { addr.push(&mut x); }
|
||||
| ---- first borrow later used here
|
||||
LL | //[mir]~^ ERROR [E0499]
|
||||
LL | 2 => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
|
||||
LL |
|
||||
LL | 2 => { addr.push(&mut x); }
|
||||
| ^^^^^^ second mutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR [E0499]
|
||||
LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
|
||||
LL |
|
||||
LL | _ => { addr.push(&mut x); }
|
||||
| ------ first mutable borrow occurs here
|
||||
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time
|
||||
--> $DIR/borrowck-mut-borrow-linear-errors.rs:17:30
|
||||
|
|
||||
LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
|
||||
LL | _ => { addr.push(&mut x); }
|
||||
| ^^^^^^ mutable borrow starts here in previous iteration of loop
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
@ -4,9 +4,9 @@ error[E0506]: cannot assign to `x` because it is borrowed
|
||||
LL | Some(ref i) => {
|
||||
| ----- borrow of `x` occurs here
|
||||
LL | // But on this branch, `i` is an outstanding borrow
|
||||
LL | x = Some(*i+1); //[ast]~ ERROR cannot assign to `x`
|
||||
LL | x = Some(*i+1);
|
||||
| ^^^^^^^^^^^^^^ assignment to borrowed `x` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed
|
||||
LL |
|
||||
LL | drop(i);
|
||||
| - borrow later used here
|
||||
|
||||
|
@ -4,7 +4,7 @@ error[E0506]: cannot assign to `x` because it is borrowed
|
||||
LL | Some(ref i) => {
|
||||
| ----- borrow of `x` occurs here
|
||||
LL | // But on this branch, `i` is an outstanding borrow
|
||||
LL | x = Some(*i+1); //[ast]~ ERROR cannot assign to `x`
|
||||
LL | x = Some(*i+1);
|
||||
| ^^^^^^^^^^^^^^ assignment to borrowed `x` occurs here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -4,9 +4,9 @@ error[E0506]: cannot assign to `x` because it is borrowed
|
||||
LL | Some(ref i) => {
|
||||
| ----- borrow of `x` occurs here
|
||||
LL | // But on this branch, `i` is an outstanding borrow
|
||||
LL | x = Some(*i+1); //[ast]~ ERROR cannot assign to `x`
|
||||
LL | x = Some(*i+1);
|
||||
| ^^^^^^^^^^^^^^ assignment to borrowed `x` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed
|
||||
LL |
|
||||
LL | drop(i);
|
||||
| - borrow later used here
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
error[E0712]: thread-local variable borrowed past end of function
|
||||
--> $DIR/borrowck-thread-local-static-borrow-outlives-fn.rs:11:20
|
||||
|
|
||||
LL | assert_static(&FOO); //[ast]~ ERROR [E0597]
|
||||
LL | assert_static(&FOO);
|
||||
| ^^^^ thread-local variables cannot be borrowed beyond the end of the function
|
||||
LL | //[mir]~^ ERROR [E0712]
|
||||
LL |
|
||||
LL | }
|
||||
| - end of enclosing function is here
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0597]: borrowed value does not live long enough
|
||||
--> $DIR/borrowck-thread-local-static-borrow-outlives-fn.rs:11:21
|
||||
|
|
||||
LL | assert_static(&FOO); //[ast]~ ERROR [E0597]
|
||||
LL | assert_static(&FOO);
|
||||
| ^^^ - borrowed value only lives until here
|
||||
| |
|
||||
| borrowed value does not live long enough
|
||||
|
@ -1,9 +1,9 @@
|
||||
error[E0712]: thread-local variable borrowed past end of function
|
||||
--> $DIR/borrowck-thread-local-static-borrow-outlives-fn.rs:11:20
|
||||
|
|
||||
LL | assert_static(&FOO); //[ast]~ ERROR [E0597]
|
||||
LL | assert_static(&FOO);
|
||||
| ^^^^ thread-local variables cannot be borrowed beyond the end of the function
|
||||
LL | //[mir]~^ ERROR [E0712]
|
||||
LL |
|
||||
LL | }
|
||||
| - end of enclosing function is here
|
||||
|
||||
|
@ -3,9 +3,9 @@ error[E0505]: cannot move out of `x` because it is borrowed
|
||||
|
|
||||
LL | let y = &*x;
|
||||
| --- borrow of `*x` occurs here
|
||||
LL | free(x); //[ast]~ ERROR cannot move out of `x` because it is borrowed
|
||||
LL | free(x);
|
||||
| ^ move out of `x` occurs here
|
||||
LL | //[mir]~^ ERROR cannot move out of `x` because it is borrowed
|
||||
LL |
|
||||
LL | *y
|
||||
| -- borrow later used here
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0505]: cannot move out of `x` because it is borrowed
|
||||
|
|
||||
LL | let y = &*x;
|
||||
| -- borrow of `*x` occurs here
|
||||
LL | free(x); //[ast]~ ERROR cannot move out of `x` because it is borrowed
|
||||
LL | free(x);
|
||||
| ^ move out of `x` occurs here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -3,9 +3,9 @@ error[E0505]: cannot move out of `x` because it is borrowed
|
||||
|
|
||||
LL | let y = &*x;
|
||||
| --- borrow of `*x` occurs here
|
||||
LL | free(x); //[ast]~ ERROR cannot move out of `x` because it is borrowed
|
||||
LL | free(x);
|
||||
| ^ move out of `x` occurs here
|
||||
LL | //[mir]~^ ERROR cannot move out of `x` because it is borrowed
|
||||
LL |
|
||||
LL | *y
|
||||
| -- borrow later used here
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0381]: use of possibly uninitialized variable: `a`
|
||||
--> $DIR/borrowck-uninit-field-access.rs:24:13
|
||||
|
|
||||
LL | let _ = a.x + 1; //[ast]~ ERROR use of possibly uninitialized variable: `a.x`
|
||||
LL | let _ = a.x + 1;
|
||||
| ^^^ use of possibly uninitialized `a.x`
|
||||
|
||||
error[E0382]: use of moved value: `line1.origin`
|
||||
@ -9,7 +9,7 @@ error[E0382]: use of moved value: `line1.origin`
|
||||
|
|
||||
LL | let _moved = line1.origin;
|
||||
| ------------ value moved here
|
||||
LL | let _ = line1.origin.x + 1; //[ast]~ ERROR use of moved value: `line1.origin.x`
|
||||
LL | let _ = line1.origin.x + 1;
|
||||
| ^^^^^^^^^^^^^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `line1.origin` has type `Point`, which does not implement the `Copy` trait
|
||||
@ -19,7 +19,7 @@ error[E0382]: use of moved value: `line2`
|
||||
|
|
||||
LL | let _moved = (line2.origin, line2.middle);
|
||||
| ------------ value moved here
|
||||
LL | line2.consume(); //[ast]~ ERROR use of partially moved value: `line2` [E0382]
|
||||
LL | line2.consume();
|
||||
| ^^^^^ value used here after partial move
|
||||
|
|
||||
= note: move occurs because `line2.middle` has type `Point`, which does not implement the `Copy` trait
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0381]: use of possibly uninitialized variable: `a.x`
|
||||
--> $DIR/borrowck-uninit-field-access.rs:24:13
|
||||
|
|
||||
LL | let _ = a.x + 1; //[ast]~ ERROR use of possibly uninitialized variable: `a.x`
|
||||
LL | let _ = a.x + 1;
|
||||
| ^^^ use of possibly uninitialized `a.x`
|
||||
|
||||
error[E0382]: use of moved value: `line1.origin.x`
|
||||
@ -9,7 +9,7 @@ error[E0382]: use of moved value: `line1.origin.x`
|
||||
|
|
||||
LL | let _moved = line1.origin;
|
||||
| ------ value moved here
|
||||
LL | let _ = line1.origin.x + 1; //[ast]~ ERROR use of moved value: `line1.origin.x`
|
||||
LL | let _ = line1.origin.x + 1;
|
||||
| ^^^^^^^^^^^^^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `line1.origin` has type `Point`, which does not implement the `Copy` trait
|
||||
@ -19,7 +19,7 @@ error[E0382]: use of partially moved value: `line2`
|
||||
|
|
||||
LL | let _moved = (line2.origin, line2.middle);
|
||||
| ------------ value moved here
|
||||
LL | line2.consume(); //[ast]~ ERROR use of partially moved value: `line2` [E0382]
|
||||
LL | line2.consume();
|
||||
| ^^^^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `line2.origin` has type `Point`, which does not implement the `Copy` trait
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0381]: use of possibly uninitialized variable: `a`
|
||||
--> $DIR/borrowck-uninit-field-access.rs:24:13
|
||||
|
|
||||
LL | let _ = a.x + 1; //[ast]~ ERROR use of possibly uninitialized variable: `a.x`
|
||||
LL | let _ = a.x + 1;
|
||||
| ^^^ use of possibly uninitialized `a.x`
|
||||
|
||||
error[E0382]: use of moved value: `line1.origin`
|
||||
@ -9,7 +9,7 @@ error[E0382]: use of moved value: `line1.origin`
|
||||
|
|
||||
LL | let _moved = line1.origin;
|
||||
| ------------ value moved here
|
||||
LL | let _ = line1.origin.x + 1; //[ast]~ ERROR use of moved value: `line1.origin.x`
|
||||
LL | let _ = line1.origin.x + 1;
|
||||
| ^^^^^^^^^^^^^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `line1.origin` has type `Point`, which does not implement the `Copy` trait
|
||||
@ -19,7 +19,7 @@ error[E0382]: use of moved value: `line2`
|
||||
|
|
||||
LL | let _moved = (line2.origin, line2.middle);
|
||||
| ------------ value moved here
|
||||
LL | line2.consume(); //[ast]~ ERROR use of partially moved value: `line2` [E0382]
|
||||
LL | line2.consume();
|
||||
| ^^^^^ value used here after partial move
|
||||
|
|
||||
= note: move occurs because `line2.middle` has type `Point`, which does not implement the `Copy` trait
|
||||
|
@ -1,43 +1,43 @@
|
||||
error[E0381]: borrow of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:11:14
|
||||
|
|
||||
LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381]
|
||||
LL | let _y = &**x;
|
||||
| ^^^^ use of possibly uninitialized `**x`
|
||||
|
||||
error[E0381]: borrow of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:15:14
|
||||
|
|
||||
LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381]
|
||||
LL | let _y = &**x;
|
||||
| ^^^^ use of possibly uninitialized `**x`
|
||||
|
||||
error[E0381]: borrow of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:19:14
|
||||
|
|
||||
LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381]
|
||||
LL | let _y = &**x;
|
||||
| ^^^^ use of possibly uninitialized `**x`
|
||||
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `a`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:24:5
|
||||
|
|
||||
LL | a.x = 0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381]
|
||||
LL | a.x = 0;
|
||||
| ^^^^^^^ use of possibly uninitialized `a`
|
||||
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `a`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:29:5
|
||||
|
|
||||
LL | a.x = &&0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381]
|
||||
LL | a.x = &&0;
|
||||
| ^^^^^^^^^ use of possibly uninitialized `a`
|
||||
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `a`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:35:5
|
||||
|
|
||||
LL | a.x = 0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381]
|
||||
LL | a.x = 0;
|
||||
| ^^^^^^^ use of possibly uninitialized `a`
|
||||
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `a`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:40:5
|
||||
|
|
||||
LL | a.x = &&0; //[mir]~ assign to part of possibly uninitialized variable: `a` [E0381]
|
||||
LL | a.x = &&0;
|
||||
| ^^^^^^^^^ use of possibly uninitialized `a`
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
|
@ -1,43 +1,43 @@
|
||||
error[E0381]: use of possibly uninitialized variable: `**x`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:11:15
|
||||
|
|
||||
LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381]
|
||||
LL | let _y = &**x;
|
||||
| ^^^ use of possibly uninitialized `**x`
|
||||
|
||||
error[E0381]: use of possibly uninitialized variable: `**x`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:15:15
|
||||
|
|
||||
LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381]
|
||||
LL | let _y = &**x;
|
||||
| ^^^ use of possibly uninitialized `**x`
|
||||
|
||||
error[E0381]: use of possibly uninitialized variable: `**x`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:19:15
|
||||
|
|
||||
LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381]
|
||||
LL | let _y = &**x;
|
||||
| ^^^ use of possibly uninitialized `**x`
|
||||
|
||||
error[E0381]: use of possibly uninitialized variable: `a.x`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:25:15
|
||||
|
|
||||
LL | let _b = &a.x; //[ast]~ ERROR use of possibly uninitialized variable: `a.x` [E0381]
|
||||
LL | let _b = &a.x;
|
||||
| ^^^ use of possibly uninitialized `a.x`
|
||||
|
||||
error[E0381]: use of possibly uninitialized variable: `**a.x`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:30:15
|
||||
|
|
||||
LL | let _b = &**a.x; //[ast]~ ERROR use of possibly uninitialized variable: `**a.x` [E0381]
|
||||
LL | let _b = &**a.x;
|
||||
| ^^^^^ use of possibly uninitialized `**a.x`
|
||||
|
||||
error[E0381]: use of possibly uninitialized variable: `a.y`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:36:15
|
||||
|
|
||||
LL | let _b = &a.y; //[ast]~ ERROR use of possibly uninitialized variable: `a.y` [E0381]
|
||||
LL | let _b = &a.y;
|
||||
| ^^^ use of possibly uninitialized `a.y`
|
||||
|
||||
error[E0381]: use of possibly uninitialized variable: `**a.y`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:41:15
|
||||
|
|
||||
LL | let _b = &**a.y; //[ast]~ ERROR use of possibly uninitialized variable: `**a.y` [E0381]
|
||||
LL | let _b = &**a.y;
|
||||
| ^^^^^ use of possibly uninitialized `**a.y`
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
|
@ -1,43 +1,43 @@
|
||||
error[E0381]: borrow of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:11:14
|
||||
|
|
||||
LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381]
|
||||
LL | let _y = &**x;
|
||||
| ^^^^ use of possibly uninitialized `**x`
|
||||
|
||||
error[E0381]: borrow of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:15:14
|
||||
|
|
||||
LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381]
|
||||
LL | let _y = &**x;
|
||||
| ^^^^ use of possibly uninitialized `**x`
|
||||
|
||||
error[E0381]: borrow of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:19:14
|
||||
|
|
||||
LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381]
|
||||
LL | let _y = &**x;
|
||||
| ^^^^ use of possibly uninitialized `**x`
|
||||
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `a`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:24:5
|
||||
|
|
||||
LL | a.x = 0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381]
|
||||
LL | a.x = 0;
|
||||
| ^^^^^^^ use of possibly uninitialized `a`
|
||||
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `a`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:29:5
|
||||
|
|
||||
LL | a.x = &&0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381]
|
||||
LL | a.x = &&0;
|
||||
| ^^^^^^^^^ use of possibly uninitialized `a`
|
||||
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `a`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:35:5
|
||||
|
|
||||
LL | a.x = 0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381]
|
||||
LL | a.x = 0;
|
||||
| ^^^^^^^ use of possibly uninitialized `a`
|
||||
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `a`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:40:5
|
||||
|
|
||||
LL | a.x = &&0; //[mir]~ assign to part of possibly uninitialized variable: `a` [E0381]
|
||||
LL | a.x = &&0;
|
||||
| ^^^^^^^^^ use of possibly uninitialized `a`
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
|
@ -3,9 +3,9 @@ error[E0502]: cannot borrow `u.a` as mutable because it is also borrowed as immu
|
||||
|
|
||||
LL | let ra = &u.a;
|
||||
| ---- immutable borrow occurs here
|
||||
LL | let rma = &mut u.a; //[ast]~ ERROR cannot borrow `u.a` as mutable because it is also borrowed as immutable
|
||||
LL | let rma = &mut u.a;
|
||||
| ^^^^^^^^ mutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR cannot borrow `u.a` as mutable because it is also borrowed as immutable
|
||||
LL |
|
||||
LL | drop(ra);
|
||||
| -- immutable borrow later used here
|
||||
|
||||
@ -14,9 +14,9 @@ error[E0506]: cannot assign to `u.a` because it is borrowed
|
||||
|
|
||||
LL | let ra = &u.a;
|
||||
| ---- borrow of `u.a` occurs here
|
||||
LL | u.a = 1; //[ast]~ ERROR cannot assign to `u.a` because it is borrowed
|
||||
LL | u.a = 1;
|
||||
| ^^^^^^^ assignment to borrowed `u.a` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `u.a` because it is borrowed
|
||||
LL |
|
||||
LL | drop(ra);
|
||||
| -- borrow later used here
|
||||
|
||||
@ -25,9 +25,9 @@ error[E0502]: cannot borrow `u.b` as mutable because it is also borrowed as immu
|
||||
|
|
||||
LL | let ra = &u.a;
|
||||
| ---- immutable borrow occurs here
|
||||
LL | let rmb = &mut u.b; //[ast]~ ERROR cannot borrow `u` (via `u.b`) as mutable because `u` is also borrowed as immutable (via `u.a`)
|
||||
LL | let rmb = &mut u.b;
|
||||
| ^^^^^^^^ mutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR cannot borrow `u.b` as mutable because it is also borrowed as immutable
|
||||
LL |
|
||||
LL | drop(ra);
|
||||
| -- immutable borrow later used here
|
||||
|
||||
@ -36,9 +36,9 @@ error[E0506]: cannot assign to `u.b` because it is borrowed
|
||||
|
|
||||
LL | let ra = &u.a;
|
||||
| ---- borrow of `u.b` occurs here
|
||||
LL | u.b = 1; //[ast]~ ERROR cannot assign to `u.b` because it is borrowed
|
||||
LL | u.b = 1;
|
||||
| ^^^^^^^ assignment to borrowed `u.b` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `u.b` because it is borrowed
|
||||
LL |
|
||||
LL | drop(ra);
|
||||
| -- borrow later used here
|
||||
|
||||
@ -47,9 +47,9 @@ error[E0502]: cannot borrow `u.a` as immutable because it is also borrowed as mu
|
||||
|
|
||||
LL | let rma = &mut u.a;
|
||||
| -------- mutable borrow occurs here
|
||||
LL | let ra = &u.a; //[ast]~ ERROR cannot borrow `u.a` as immutable because it is also borrowed as mutable
|
||||
LL | let ra = &u.a;
|
||||
| ^^^^ immutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR cannot borrow `u.a` as immutable because it is also borrowed as mutable
|
||||
LL |
|
||||
LL | drop(rma);
|
||||
| --- mutable borrow later used here
|
||||
|
||||
@ -58,9 +58,9 @@ error[E0503]: cannot use `u.a` because it was mutably borrowed
|
||||
|
|
||||
LL | let ra = &mut u.a;
|
||||
| -------- borrow of `u.a` occurs here
|
||||
LL | let a = u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed
|
||||
LL | let a = u.a;
|
||||
| ^^^ use of borrowed `u.a`
|
||||
LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed
|
||||
LL |
|
||||
LL | drop(ra);
|
||||
| -- borrow later used here
|
||||
|
||||
@ -69,9 +69,9 @@ error[E0499]: cannot borrow `u.a` as mutable more than once at a time
|
||||
|
|
||||
LL | let rma = &mut u.a;
|
||||
| -------- first mutable borrow occurs here
|
||||
LL | let rma2 = &mut u.a; //[ast]~ ERROR cannot borrow `u.a` as mutable more than once at a time
|
||||
LL | let rma2 = &mut u.a;
|
||||
| ^^^^^^^^ second mutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR cannot borrow `u.a` as mutable more than once at a time
|
||||
LL |
|
||||
LL | drop(rma);
|
||||
| --- first borrow later used here
|
||||
|
||||
@ -80,9 +80,9 @@ error[E0506]: cannot assign to `u.a` because it is borrowed
|
||||
|
|
||||
LL | let rma = &mut u.a;
|
||||
| -------- borrow of `u.a` occurs here
|
||||
LL | u.a = 1; //[ast]~ ERROR cannot assign to `u.a` because it is borrowed
|
||||
LL | u.a = 1;
|
||||
| ^^^^^^^ assignment to borrowed `u.a` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `u.a` because it is borrowed
|
||||
LL |
|
||||
LL | drop(rma);
|
||||
| --- borrow later used here
|
||||
|
||||
@ -91,9 +91,9 @@ error[E0502]: cannot borrow `u.b` as immutable because it is also borrowed as mu
|
||||
|
|
||||
LL | let rma = &mut u.a;
|
||||
| -------- mutable borrow occurs here
|
||||
LL | let rb = &u.b; //[ast]~ ERROR cannot borrow `u` (via `u.b`) as immutable because `u` is also borrowed as mutable (via `u.a`)
|
||||
LL | let rb = &u.b;
|
||||
| ^^^^ immutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR cannot borrow `u.b` as immutable because it is also borrowed as mutable
|
||||
LL |
|
||||
LL | drop(rma);
|
||||
| --- mutable borrow later used here
|
||||
|
||||
@ -102,7 +102,7 @@ error[E0503]: cannot use `u.b` because it was mutably borrowed
|
||||
|
|
||||
LL | let ra = &mut u.a;
|
||||
| -------- borrow of `u.a` occurs here
|
||||
LL | let b = u.b; //[ast]~ ERROR cannot use `u.b` because it was mutably borrowed
|
||||
LL | let b = u.b;
|
||||
| ^^^ use of borrowed `u.a`
|
||||
...
|
||||
LL | drop(ra);
|
||||
@ -113,9 +113,9 @@ error[E0499]: cannot borrow `u.b` as mutable more than once at a time
|
||||
|
|
||||
LL | let rma = &mut u.a;
|
||||
| -------- first mutable borrow occurs here
|
||||
LL | let rmb2 = &mut u.b; //[ast]~ ERROR cannot borrow `u` (via `u.b`) as mutable more than once at a time
|
||||
LL | let rmb2 = &mut u.b;
|
||||
| ^^^^^^^^ second mutable borrow occurs here
|
||||
LL | //[mir]~^ ERROR cannot borrow `u.b` as mutable more than once at a time
|
||||
LL |
|
||||
LL | drop(rma);
|
||||
| --- first borrow later used here
|
||||
|
||||
@ -124,9 +124,9 @@ error[E0506]: cannot assign to `u.b` because it is borrowed
|
||||
|
|
||||
LL | let rma = &mut u.a;
|
||||
| -------- borrow of `u.b` occurs here
|
||||
LL | u.b = 1; //[ast]~ ERROR cannot assign to `u.b` because it is borrowed
|
||||
LL | u.b = 1;
|
||||
| ^^^^^^^ assignment to borrowed `u.b` occurs here
|
||||
LL | //[mir]~^ ERROR cannot assign to `u.b` because it is borrowed
|
||||
LL |
|
||||
LL | drop(rma);
|
||||
| --- borrow later used here
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
error[E0381]: use of possibly uninitialized variable: `w`
|
||||
--> $DIR/borrowck-use-in-index-lvalue.rs:6:5
|
||||
|
|
||||
LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381]
|
||||
LL | w[5] = 0;
|
||||
| ^^^^ use of possibly uninitialized `*w`
|
||||
|
||||
error[E0381]: use of possibly uninitialized variable: `w`
|
||||
--> $DIR/borrowck-use-in-index-lvalue.rs:10:5
|
||||
|
|
||||
LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381]
|
||||
LL | w[5] = 0;
|
||||
| ^^^^ use of possibly uninitialized `*w`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
@ -1,13 +1,13 @@
|
||||
error[E0381]: use of possibly uninitialized variable: `*w`
|
||||
--> $DIR/borrowck-use-in-index-lvalue.rs:6:5
|
||||
|
|
||||
LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381]
|
||||
LL | w[5] = 0;
|
||||
| ^^^^^^^^ use of possibly uninitialized `*w`
|
||||
|
||||
error[E0381]: use of possibly uninitialized variable: `*w`
|
||||
--> $DIR/borrowck-use-in-index-lvalue.rs:10:5
|
||||
|
|
||||
LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381]
|
||||
LL | w[5] = 0;
|
||||
| ^^^^^^^^ use of possibly uninitialized `*w`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
@ -1,13 +1,13 @@
|
||||
error[E0381]: use of possibly uninitialized variable: `w`
|
||||
--> $DIR/borrowck-use-in-index-lvalue.rs:6:5
|
||||
|
|
||||
LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381]
|
||||
LL | w[5] = 0;
|
||||
| ^^^^ use of possibly uninitialized `*w`
|
||||
|
||||
error[E0381]: use of possibly uninitialized variable: `w`
|
||||
--> $DIR/borrowck-use-in-index-lvalue.rs:10:5
|
||||
|
|
||||
LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381]
|
||||
LL | w[5] = 0;
|
||||
| ^^^^ use of possibly uninitialized `*w`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0381]: borrow of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-use-uninitialized-in-cast-trait.rs:12:13
|
||||
|
|
||||
LL | let y = x as *const Foo; //[ast]~ ERROR use of possibly uninitialized variable: `*x`
|
||||
LL | let y = x as *const Foo;
|
||||
| ^ use of possibly uninitialized `*x`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0381]: use of possibly uninitialized variable: `*x`
|
||||
--> $DIR/borrowck-use-uninitialized-in-cast-trait.rs:12:13
|
||||
|
|
||||
LL | let y = x as *const Foo; //[ast]~ ERROR use of possibly uninitialized variable: `*x`
|
||||
LL | let y = x as *const Foo;
|
||||
| ^ use of possibly uninitialized `*x`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user