2018-09-10 08:39:43 -05:00
|
|
|
error[E0597]: `x` does not live long enough
|
2018-09-10 09:54:31 -05:00
|
|
|
--> $DIR/patterns.rs:8:9
|
|
|
|
|
|
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
|
|
|
|
--> $DIR/patterns.rs:16:9
|
|
|
|
|
|
|
|
|
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
|
|
|
|
--> $DIR/patterns.rs:22:13
|
|
|
|
|
|
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
|
|
|
|
--> $DIR/patterns.rs:41:9
|
|
|
|
|
|
|
|
|
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
|
2018-10-25 08:45:41 -05:00
|
|
|
--> $DIR/patterns.rs:53:10
|
|
|
|
|
|
|
|
|
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
|
|
|
|
--> $DIR/patterns.rs:58: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
|
2018-10-25 08:45:41 -05:00
|
|
|
--> $DIR/patterns.rs:63: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
|
2018-10-25 08:45:41 -05:00
|
|
|
--> $DIR/patterns.rs:65: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
|
|
|
|
| | |
|
|
|
|
| | creates a temporary which is freed while still in use
|
|
|
|
| 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
|
2018-10-25 08:45:41 -05:00
|
|
|
--> $DIR/patterns.rs:68: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
|
|
|
|
| | |
|
|
|
|
| | creates a temporary which is freed while still in use
|
|
|
|
| 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
|
2018-10-25 08:45:41 -05:00
|
|
|
--> $DIR/patterns.rs:71: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
|
|
|
|
| | |
|
|
|
|
| | creates a temporary which is freed while still in use
|
|
|
|
| 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
|
2018-10-25 08:45:41 -05:00
|
|
|
--> $DIR/patterns.rs:77: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
|
2018-10-25 08:45:41 -05:00
|
|
|
--> $DIR/patterns.rs:82: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
|
2018-10-25 08:45:41 -05:00
|
|
|
--> $DIR/patterns.rs:87: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
|
2018-10-25 08:45:41 -05:00
|
|
|
--> $DIR/patterns.rs:92: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
|
2018-10-25 08:45:41 -05:00
|
|
|
--> $DIR/patterns.rs:100: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
|
2018-10-25 08:45:41 -05:00
|
|
|
--> $DIR/patterns.rs:113: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-12-11 15:49:40 -06:00
|
|
|
error: lifetime may not live long enough
|
2018-10-25 08:45:41 -05:00
|
|
|
--> $DIR/patterns.rs:125: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-12-11 15:49:40 -06:00
|
|
|
error: lifetime may not live long enough
|
2018-10-25 08:45:41 -05:00
|
|
|
--> $DIR/patterns.rs:130:5
|
|
|
|
|
|
|
|
|
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-12-11 15:49:40 -06:00
|
|
|
error: lifetime may not live long enough
|
2018-10-25 08:45:41 -05:00
|
|
|
--> $DIR/patterns.rs:134: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-09-10 08:39:43 -05:00
|
|
|
|
2018-10-25 08:45:41 -05:00
|
|
|
error: aborting due to 19 previous errors
|
2018-08-31 18:20:43 -05:00
|
|
|
|
2018-09-25 09:06:28 -05:00
|
|
|
Some errors occurred: E0597, E0716.
|
2018-09-23 10:30:46 -05:00
|
|
|
For more information about an error, try `rustc --explain E0597`.
|