fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71868 - Mark-Simulacrum:stable-1.43.1, r=pietroalbini8d69840ab92

1.43.1
3.3 KiB80 linesraw
1error[E0716]: temporary value dropped while borrowed
2  --> $DIR/const-int-conversion.rs:2:28
3   |
4LL |     let x: &'static i32 = &(5_i32.reverse_bits());
5   |            ------------    ^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
6   |            |
7   |            type annotation requires that borrow lasts for `'static`
8...
9LL | }
10   | - temporary value is freed at the end of this statement
11
12error[E0716]: temporary value dropped while borrowed
13  --> $DIR/const-int-conversion.rs:4:28
14   |
15LL |     let y: &'static i32 = &(i32::from_be_bytes([0x12, 0x34, 0x56, 0x78]));
16   |            ------------    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
17   |            |
18   |            type annotation requires that borrow lasts for `'static`
19...
20LL | }
21   | - temporary value is freed at the end of this statement
22
23error[E0716]: temporary value dropped while borrowed
24  --> $DIR/const-int-conversion.rs:6:28
25   |
26LL |     let z: &'static i32 = &(i32::from_le_bytes([0x12, 0x34, 0x56, 0x78]));
27   |            ------------    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
28   |            |
29   |            type annotation requires that borrow lasts for `'static`
30...
31LL | }
32   | - temporary value is freed at the end of this statement
33
34error[E0716]: temporary value dropped while borrowed
35  --> $DIR/const-int-conversion.rs:8:28
36   |
37LL |     let a: &'static i32 = &(i32::from_be(i32::from_ne_bytes([0x80, 0, 0, 0])));
38   |            ------------    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
39   |            |
40   |            type annotation requires that borrow lasts for `'static`
41...
42LL | }
43   | - temporary value is freed at the end of this statement
44
45error[E0716]: temporary value dropped while borrowed
46  --> $DIR/const-int-conversion.rs:10:29
47   |
48LL |     let b: &'static [u8] = &(0x12_34_56_78_i32.to_be_bytes());
49   |            -------------    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
50   |            |
51   |            type annotation requires that borrow lasts for `'static`
52...
53LL | }
54   | - temporary value is freed at the end of this statement
55
56error[E0716]: temporary value dropped while borrowed
57  --> $DIR/const-int-conversion.rs:12:29
58   |
59LL |     let c: &'static [u8] = &(0x12_34_56_78_i32.to_le_bytes());
60   |            -------------    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
61   |            |
62   |            type annotation requires that borrow lasts for `'static`
63...
64LL | }
65   | - temporary value is freed at the end of this statement
66
67error[E0716]: temporary value dropped while borrowed
68  --> $DIR/const-int-conversion.rs:14:29
69   |
70LL |     let d: &'static [u8] = &(i32::min_value().to_be().to_ne_bytes());
71   |            -------------    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
72   |            |
73   |            type annotation requires that borrow lasts for `'static`
74LL |
75LL | }
76   | - temporary value is freed at the end of this statement
77
78error: aborting due to 7 previous errors
79
80For more information about this error, try `rustc --explain E0716`.