2020-08-16 15:51:49 +00:00
|
|
|
error[E0716]: temporary value dropped while borrowed
|
2021-06-03 07:31:27 +00:00
|
|
|
--> $DIR/promote-not.rs:8:50
|
2020-08-16 15:51:49 +00:00
|
|
|
|
|
|
|
|
LL | static mut TEST1: Option<&mut [i32]> = Some(&mut [1, 2, 3]);
|
|
|
|
| ----------^^^^^^^^^-
|
|
|
|
| | | |
|
|
|
|
| | | temporary value is freed at the end of this statement
|
|
|
|
| | creates a temporary which is freed while still in use
|
|
|
|
| using this value as a static requires that borrow lasts for `'static`
|
|
|
|
|
|
|
|
error[E0716]: temporary value dropped while borrowed
|
2021-06-03 07:31:27 +00:00
|
|
|
--> $DIR/promote-not.rs:11:18
|
2020-08-16 15:51:49 +00:00
|
|
|
|
|
|
|
|
LL | let x = &mut [1,2,3];
|
|
|
|
| ^^^^^^^ creates a temporary which is freed while still in use
|
|
|
|
LL | x
|
|
|
|
| - using this value as a static requires that borrow lasts for `'static`
|
|
|
|
LL | };
|
|
|
|
| - temporary value is freed at the end of this statement
|
|
|
|
|
2020-09-06 14:06:39 +00:00
|
|
|
error[E0716]: temporary value dropped while borrowed
|
2021-06-03 07:31:27 +00:00
|
|
|
--> $DIR/promote-not.rs:20:32
|
2020-09-06 14:06:39 +00:00
|
|
|
|
|
|
|
|
LL | let _x: &'static () = &foo();
|
|
|
|
| ----------- ^^^^^ creates a temporary which is freed while still in use
|
|
|
|
| |
|
|
|
|
| type annotation requires that borrow lasts for `'static`
|
|
|
|
LL | }
|
|
|
|
| - temporary value is freed at the end of this statement
|
|
|
|
|
|
|
|
error[E0716]: temporary value dropped while borrowed
|
2021-06-03 07:31:27 +00:00
|
|
|
--> $DIR/promote-not.rs:28:29
|
2020-09-06 14:06:39 +00:00
|
|
|
|
|
|
|
|
LL | let _x: &'static i32 = &unsafe { U { x: 0 }.x };
|
|
|
|
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
|
|
|
|
| |
|
|
|
|
| type annotation requires that borrow lasts for `'static`
|
|
|
|
LL | }
|
|
|
|
| - temporary value is freed at the end of this statement
|
|
|
|
|
2020-10-04 13:25:26 +00:00
|
|
|
error[E0716]: temporary value dropped while borrowed
|
2021-06-03 07:31:27 +00:00
|
|
|
--> $DIR/promote-not.rs:33:29
|
2020-10-04 13:25:26 +00:00
|
|
|
|
|
|
|
|
LL | let _x: &'static i32 = &unsafe { U { x: 0 }.x };
|
|
|
|
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
|
|
|
|
| |
|
|
|
|
| type annotation requires that borrow lasts for `'static`
|
|
|
|
LL | };
|
|
|
|
| - temporary value is freed at the end of this statement
|
|
|
|
|
2020-10-25 16:46:01 +00:00
|
|
|
error[E0716]: temporary value dropped while borrowed
|
2021-06-03 07:31:27 +00:00
|
|
|
--> $DIR/promote-not.rs:39:29
|
2020-10-25 17:06:41 +00:00
|
|
|
|
|
|
|
|
LL | let _val: &'static _ = &(Cell::new(1), 2).1;
|
|
|
|
| ---------- ^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
|
|
|
|
| |
|
|
|
|
| type annotation requires that borrow lasts for `'static`
|
|
|
|
LL | };
|
|
|
|
| - temporary value is freed at the end of this statement
|
|
|
|
|
|
|
|
error[E0716]: temporary value dropped while borrowed
|
2021-06-03 07:31:27 +00:00
|
|
|
--> $DIR/promote-not.rs:44:29
|
2020-10-25 16:46:01 +00:00
|
|
|
|
|
|
|
|
LL | let _val: &'static _ = &(Cell::new(1), 2).0;
|
|
|
|
| ---------- ^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
|
|
|
|
| |
|
|
|
|
| type annotation requires that borrow lasts for `'static`
|
2021-01-01 13:47:45 +00:00
|
|
|
...
|
2020-10-25 17:06:41 +00:00
|
|
|
LL | }
|
|
|
|
| - temporary value is freed at the end of this statement
|
|
|
|
|
|
|
|
error[E0716]: temporary value dropped while borrowed
|
2021-06-03 07:31:27 +00:00
|
|
|
--> $DIR/promote-not.rs:45:29
|
2020-10-25 17:06:41 +00:00
|
|
|
|
|
|
|
|
LL | let _val: &'static _ = &(Cell::new(1), 2).1;
|
|
|
|
| ---------- ^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
|
|
|
|
| |
|
|
|
|
| type annotation requires that borrow lasts for `'static`
|
2021-01-01 13:47:45 +00:00
|
|
|
...
|
|
|
|
LL | }
|
|
|
|
| - temporary value is freed at the end of this statement
|
|
|
|
|
|
|
|
error[E0716]: temporary value dropped while borrowed
|
2021-06-03 07:31:27 +00:00
|
|
|
--> $DIR/promote-not.rs:48:29
|
2021-01-01 13:47:45 +00:00
|
|
|
|
|
|
|
|
LL | let _val: &'static _ = &(1/0);
|
|
|
|
| ---------- ^^^^^ creates a temporary which is freed while still in use
|
|
|
|
| |
|
|
|
|
| type annotation requires that borrow lasts for `'static`
|
|
|
|
...
|
|
|
|
LL | }
|
|
|
|
| - temporary value is freed at the end of this statement
|
|
|
|
|
|
|
|
error[E0716]: temporary value dropped while borrowed
|
2021-06-03 07:31:27 +00:00
|
|
|
--> $DIR/promote-not.rs:49:29
|
2021-01-01 13:47:45 +00:00
|
|
|
|
|
|
|
|
LL | let _val: &'static _ = &(1/(1-1));
|
|
|
|
| ---------- ^^^^^^^^^ creates a temporary which is freed while still in use
|
|
|
|
| |
|
|
|
|
| type annotation requires that borrow lasts for `'static`
|
|
|
|
...
|
|
|
|
LL | }
|
|
|
|
| - temporary value is freed at the end of this statement
|
|
|
|
|
|
|
|
error[E0716]: temporary value dropped while borrowed
|
2021-06-03 07:31:27 +00:00
|
|
|
--> $DIR/promote-not.rs:50:29
|
2021-01-01 13:47:45 +00:00
|
|
|
|
|
|
|
|
LL | let _val: &'static _ = &(1%0);
|
|
|
|
| ---------- ^^^^^ creates a temporary which is freed while still in use
|
|
|
|
| |
|
|
|
|
| type annotation requires that borrow lasts for `'static`
|
|
|
|
...
|
|
|
|
LL | }
|
|
|
|
| - temporary value is freed at the end of this statement
|
|
|
|
|
|
|
|
error[E0716]: temporary value dropped while borrowed
|
2021-06-03 07:31:27 +00:00
|
|
|
--> $DIR/promote-not.rs:51:29
|
2021-01-01 13:47:45 +00:00
|
|
|
|
|
|
|
|
LL | let _val: &'static _ = &(1%(1-1));
|
|
|
|
| ---------- ^^^^^^^^^ creates a temporary which is freed while still in use
|
|
|
|
| |
|
|
|
|
| type annotation requires that borrow lasts for `'static`
|
|
|
|
LL | let _val: &'static _ = &([1,2,3][4]+1);
|
|
|
|
LL | }
|
|
|
|
| - temporary value is freed at the end of this statement
|
|
|
|
|
|
|
|
error[E0716]: temporary value dropped while borrowed
|
2021-06-03 07:31:27 +00:00
|
|
|
--> $DIR/promote-not.rs:52:29
|
2021-01-01 13:47:45 +00:00
|
|
|
|
|
|
|
|
LL | let _val: &'static _ = &([1,2,3][4]+1);
|
|
|
|
| ---------- ^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
|
|
|
|
| |
|
|
|
|
| type annotation requires that borrow lasts for `'static`
|
2020-10-25 16:46:01 +00:00
|
|
|
LL | }
|
|
|
|
| - temporary value is freed at the end of this statement
|
|
|
|
|
2021-01-01 13:47:45 +00:00
|
|
|
error: aborting due to 13 previous errors
|
2020-08-16 15:51:49 +00:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0716`.
|