rust/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr

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

114 lines
4.7 KiB
Plaintext
Raw Normal View History

warning: creating a mutable reference to mutable static is discouraged
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:12:16
|
LL | c1(&mut Y);
| ^^^^^^ mutable reference to mutable static
|
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
= note: this will be a hard error in the 2024 edition
= note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
= note: `#[warn(static_mut_refs)]` on by default
help: use `addr_of_mut!` instead to create a raw pointer
|
LL | c1(addr_of_mut!(Y));
| ~~~~~~~~~~~~~ +
warning: creating a mutable reference to mutable static is discouraged
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:27:16
|
LL | c1(&mut Z);
| ^^^^^^ mutable reference to mutable static
|
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
= note: this will be a hard error in the 2024 edition
= note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
help: use `addr_of_mut!` instead to create a raw pointer
|
LL | c1(addr_of_mut!(Z));
| ~~~~~~~~~~~~~ +
warning: creating a mutable reference to mutable static is discouraged
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:64:37
|
LL | borrowck_closures_unique::e(&mut X);
| ^^^^^^ mutable reference to mutable static
|
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
= note: this will be a hard error in the 2024 edition
= note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
help: use `addr_of_mut!` instead to create a raw pointer
|
LL | borrowck_closures_unique::e(addr_of_mut!(X));
| ~~~~~~~~~~~~~ +
error[E0594]: cannot assign to `x`, as it is not declared as mutable
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:9:46
|
LL | let mut c1 = |y: &'static mut isize| x = y;
| ^^^^^ cannot assign
2024-07-03 23:26:10 +00:00
|
help: consider changing this to be mutable
|
LL | pub fn e(mut x: &'static mut isize) {
| +++
2018-10-30 00:25:09 +01:00
error[E0594]: cannot assign to `x`, as it is not declared as mutable
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:22:50
2018-10-30 00:25:09 +01:00
|
LL | let mut c2 = |y: &'static mut isize| x = y;
| ^^^^^ cannot assign
2024-07-03 23:26:10 +00:00
|
help: consider changing this to be mutable
|
LL | pub fn ee(mut x: &'static mut isize) {
| +++
2018-10-30 00:25:09 +01:00
error[E0594]: cannot assign to `x`, as it is not declared as mutable
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:37:13
2018-10-30 00:25:09 +01:00
|
LL | x = (1,);
| ^^^^^^^^ cannot assign
2024-07-03 23:26:10 +00:00
|
help: consider changing this to be mutable
|
LL | pub fn capture_assign_whole(mut x: (i32,)) {
| +++
2018-10-30 00:25:09 +01:00
error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:43:13
2018-10-30 00:25:09 +01:00
|
LL | x.0 = 1;
| ^^^^^^^ cannot assign
2024-07-03 23:26:10 +00:00
|
help: consider changing this to be mutable
|
LL | pub fn capture_assign_part(mut x: (i32,)) {
| +++
2018-10-30 00:25:09 +01:00
error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:49:13
2018-10-30 00:25:09 +01:00
|
LL | &mut x;
| ^^^^^^ cannot borrow as mutable
2024-07-03 23:26:10 +00:00
|
help: consider changing this to be mutable
|
LL | pub fn capture_reborrow_whole(mut x: (i32,)) {
| +++
2018-10-30 00:25:09 +01:00
error[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:55:13
2018-10-30 00:25:09 +01:00
|
LL | &mut x.0;
| ^^^^^^^^ cannot borrow as mutable
2024-07-03 23:26:10 +00:00
|
help: consider changing this to be mutable
|
LL | pub fn capture_reborrow_part(mut x: (i32,)) {
| +++
2018-10-30 00:25:09 +01:00
error: aborting due to 6 previous errors; 3 warnings emitted
2018-10-30 00:25:09 +01:00
2019-11-06 13:58:44 +01:00
Some errors have detailed explanations: E0594, E0596.
For more information about an error, try `rustc --explain E0594`.