2018-09-10 08:39:43 -05:00
|
|
|
error[E0597]: `x` does not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/patterns.rs:6:9
|
2018-09-10 09:54:31 -05:00
|
|
|
|
|
2018-10-14 09:12:02 -05:00
|
|
|
LL | let y: &'static u32;
|
|
|
|
| ------------ type annotation requires that `x` is borrowed for `'static`
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | y = &x;
|
2018-09-10 09:54:31 -05:00
|
|
|
| ^^ borrowed value does not live long enough
|
|
|
|
LL | }
|
|
|
|
| - `x` dropped here while still borrowed
|
|
|
|
|
2018-10-22 15:50:10 -05:00
|
|
|
error[E0597]: `x` does not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/patterns.rs:14:9
|
2018-10-22 15:50:10 -05:00
|
|
|
|
|
|
|
|
LL | let (y, z): (&'static u32, &'static u32);
|
|
|
|
| ---------------------------- type annotation requires that `x` is borrowed for `'static`
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | y = &x;
|
2018-10-22 15:50:10 -05:00
|
|
|
| ^^ borrowed value does not live long enough
|
|
|
|
LL | }
|
|
|
|
| - `x` dropped here while still borrowed
|
|
|
|
|
2018-09-10 09:54:31 -05:00
|
|
|
error[E0597]: `x` does not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/patterns.rs:20:13
|
2018-09-10 09:54:31 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let y = &x;
|
2018-09-10 09:54:31 -05:00
|
|
|
| ^^ borrowed value does not live long enough
|
2018-10-14 09:12:02 -05:00
|
|
|
LL | let ref z: &'static u32 = y;
|
|
|
|
| ------------ type annotation requires that `x` is borrowed for `'static`
|
|
|
|
LL | **z
|
2018-09-10 09:54:31 -05:00
|
|
|
LL | }
|
|
|
|
| - `x` dropped here while still borrowed
|
|
|
|
|
2018-10-22 15:50:10 -05:00
|
|
|
error[E0597]: `x` does not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/patterns.rs:39:9
|
2018-10-22 15:50:10 -05:00
|
|
|
|
|
|
|
|
LL | let Single { value: y }: Single<&'static u32>;
|
|
|
|
| -------------------- type annotation requires that `x` is borrowed for `'static`
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | y = &x;
|
2018-10-22 15:50:10 -05:00
|
|
|
| ^^ borrowed value does not live long enough
|
|
|
|
LL | }
|
|
|
|
| - `x` dropped here while still borrowed
|
|
|
|
|
2018-09-10 09:54:31 -05:00
|
|
|
error[E0597]: `x` does not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/patterns.rs:51:10
|
2018-10-25 08:45:41 -05:00
|
|
|
|
|
|
|
|
LL | let Single2 { value: mut _y }: Single2<StaticU32>;
|
|
|
|
| ------------------ type annotation requires that `x` is borrowed for `'static`
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | _y = &x;
|
2018-10-25 08:45:41 -05:00
|
|
|
| ^^ borrowed value does not live long enough
|
|
|
|
LL | }
|
|
|
|
| - `x` dropped here while still borrowed
|
|
|
|
|
|
|
|
error[E0597]: `x` does not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/patterns.rs:56:27
|
2018-09-10 08:39:43 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let y: &'static u32 = &x;
|
2018-10-14 09:12:02 -05:00
|
|
|
| ------------ ^^ borrowed value does not live long enough
|
|
|
|
| |
|
|
|
|
| type annotation requires that `x` is borrowed for `'static`
|
2018-09-10 08:39:43 -05:00
|
|
|
LL | }
|
|
|
|
| - `x` dropped here while still borrowed
|
|
|
|
|
|
|
|
error[E0597]: `x` does not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/patterns.rs:61:27
|
2018-09-10 08:39:43 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let _: &'static u32 = &x;
|
2018-10-14 09:12:02 -05:00
|
|
|
| ------------ ^^ borrowed value does not live long enough
|
|
|
|
| |
|
|
|
|
| type annotation requires that `x` is borrowed for `'static`
|
2018-09-10 08:39:43 -05:00
|
|
|
...
|
|
|
|
LL | }
|
|
|
|
| - `x` dropped here while still borrowed
|
|
|
|
|
2018-09-25 09:06:28 -05:00
|
|
|
error[E0716]: temporary value dropped while borrowed
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/patterns.rs:63:41
|
2018-08-31 18:20:43 -05:00
|
|
|
|
|
|
|
|
LL | let _: Vec<&'static String> = vec![&String::new()];
|
2018-10-14 09:12:02 -05:00
|
|
|
| -------------------- ^^^^^^^^^^^^^ - 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
|
2018-10-14 09:12:02 -05:00
|
|
|
| type annotation requires that borrow lasts for `'static`
|
2018-08-31 18:20:43 -05:00
|
|
|
|
2018-09-25 09:06:28 -05:00
|
|
|
error[E0716]: temporary value dropped while borrowed
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/patterns.rs:66:52
|
2018-08-31 18:20:43 -05:00
|
|
|
|
|
|
|
|
LL | let (_, a): (Vec<&'static String>, _) = (vec![&String::new()], 44);
|
2018-10-14 09:12:02 -05:00
|
|
|
| ------------------------- ^^^^^^^^^^^^^ - 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
|
2018-10-14 09:12:02 -05:00
|
|
|
| type annotation requires that borrow lasts for `'static`
|
2018-08-31 18:20:43 -05:00
|
|
|
|
2018-09-25 09:06:28 -05:00
|
|
|
error[E0716]: temporary value dropped while borrowed
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/patterns.rs:69:53
|
2018-08-31 18:20:43 -05:00
|
|
|
|
|
|
|
|
LL | let (_a, b): (Vec<&'static String>, _) = (vec![&String::new()], 44);
|
2018-10-14 09:12:02 -05:00
|
|
|
| ------------------------- ^^^^^^^^^^^^^ - 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
|
2018-10-14 09:12:02 -05:00
|
|
|
| type annotation requires that borrow lasts for `'static`
|
2018-08-31 18:20:43 -05:00
|
|
|
|
2018-09-10 08:39:43 -05:00
|
|
|
error[E0597]: `x` does not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/patterns.rs:75:40
|
2018-09-10 08:39:43 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let (_, _): (&'static u32, u32) = (&x, 44);
|
2018-10-14 09:12:02 -05:00
|
|
|
| ------------------- ^^ borrowed value does not live long enough
|
|
|
|
| |
|
|
|
|
| type annotation requires that `x` is borrowed for `'static`
|
2018-09-10 08:39:43 -05:00
|
|
|
LL | }
|
|
|
|
| - `x` dropped here while still borrowed
|
|
|
|
|
|
|
|
error[E0597]: `x` does not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/patterns.rs:80:40
|
2018-09-10 08:39:43 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let (y, _): (&'static u32, u32) = (&x, 44);
|
2018-10-14 09:12:02 -05:00
|
|
|
| ------------------- ^^ borrowed value does not live long enough
|
|
|
|
| |
|
|
|
|
| type annotation requires that `x` is borrowed for `'static`
|
2018-09-10 08:39:43 -05:00
|
|
|
LL | }
|
|
|
|
| - `x` dropped here while still borrowed
|
|
|
|
|
|
|
|
error[E0597]: `x` does not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/patterns.rs:85:69
|
2018-09-10 08:39:43 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let Single { value: y }: Single<&'static u32> = Single { value: &x };
|
2018-10-14 09:12:02 -05:00
|
|
|
| -------------------- ^^ borrowed value does not live long enough
|
|
|
|
| |
|
|
|
|
| type annotation requires that `x` is borrowed for `'static`
|
2018-09-10 08:39:43 -05:00
|
|
|
LL | }
|
|
|
|
| - `x` dropped here while still borrowed
|
|
|
|
|
|
|
|
error[E0597]: `x` does not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/patterns.rs:90:69
|
2018-09-10 08:39:43 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let Single { value: _ }: Single<&'static u32> = Single { value: &x };
|
2018-10-14 09:12:02 -05:00
|
|
|
| -------------------- ^^ borrowed value does not live long enough
|
|
|
|
| |
|
|
|
|
| type annotation requires that `x` is borrowed for `'static`
|
2018-09-10 08:39:43 -05:00
|
|
|
LL | }
|
|
|
|
| - `x` dropped here while still borrowed
|
|
|
|
|
|
|
|
error[E0597]: `x` does not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/patterns.rs:98:17
|
2018-09-10 08:39:43 -05:00
|
|
|
|
|
2018-10-14 09:12:02 -05:00
|
|
|
LL | let Double { value1: _, value2: _ }: Double<&'static u32> = Double {
|
|
|
|
| -------------------- type annotation requires that `x` is borrowed for `'static`
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | value1: &x,
|
2018-09-10 08:39:43 -05:00
|
|
|
| ^^ borrowed value does not live long enough
|
|
|
|
...
|
|
|
|
LL | }
|
|
|
|
| - `x` dropped here while still borrowed
|
|
|
|
|
2018-12-11 15:49:40 -06:00
|
|
|
error: lifetime may not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/patterns.rs:111:5
|
2018-09-10 08:39:43 -05:00
|
|
|
|
|
|
|
|
LL | fn static_to_a_to_static_through_variable<'a>(x: &'a u32) -> &'static u32 {
|
|
|
|
| -- lifetime `'a` defined here
|
|
|
|
...
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | y
|
2018-09-10 08:39:43 -05:00
|
|
|
| ^ returning this value requires that `'a` must outlive `'static`
|
2018-11-28 15:05:36 -06:00
|
|
|
|
2018-12-11 15:49:40 -06:00
|
|
|
error: lifetime may not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/patterns.rs:123:5
|
2018-10-22 15:50:10 -05:00
|
|
|
|
|
|
|
|
LL | fn static_to_a_to_static_through_tuple<'a>(x: &'a u32) -> &'static u32 {
|
|
|
|
| -- lifetime `'a` defined here
|
|
|
|
...
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | y
|
2018-10-22 15:50:10 -05:00
|
|
|
| ^ returning this value requires that `'a` must outlive `'static`
|
2018-11-28 15:05:36 -06:00
|
|
|
|
2018-12-11 15:49:40 -06:00
|
|
|
error: lifetime may not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/patterns.rs:128:5
|
2018-10-25 08:45:41 -05:00
|
|
|
|
|
|
|
|
LL | fn static_to_a_to_static_through_struct<'a>(_x: &'a u32) -> &'static u32 {
|
|
|
|
| -- lifetime `'a` defined here
|
|
|
|
LL | let Single { value: y }: Single<&'a u32> = Single { value: &22 };
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | y
|
2018-10-25 08:45:41 -05:00
|
|
|
| ^ returning this value requires that `'a` must outlive `'static`
|
2018-11-28 15:05:36 -06:00
|
|
|
|
2018-12-11 15:49:40 -06:00
|
|
|
error: lifetime may not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/patterns.rs:132:18
|
2018-09-10 08:39:43 -05:00
|
|
|
|
|
|
|
|
LL | fn a_to_static_then_static<'a>(x: &'a u32) -> &'static u32 {
|
|
|
|
| -- lifetime `'a` defined here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let (y, _z): (&'static u32, u32) = (x, 44);
|
2018-10-09 16:59:46 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
|
2018-11-28 15:05:36 -06:00
|
|
|
|
2018-10-25 08:45:41 -05:00
|
|
|
error: aborting due to 19 previous errors
|
2018-08-31 18:20:43 -05:00
|
|
|
|
2019-04-17 12:26:38 -05:00
|
|
|
Some errors have detailed explanations: E0597, E0716.
|
2018-09-23 10:30:46 -05:00
|
|
|
For more information about an error, try `rustc --explain E0597`.
|