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