]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-int-conversion.stderr
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / consts / const-int-conversion.stderr
1 error[E0597]: borrowed value does not live long enough
2   --> $DIR/const-int-conversion.rs:14:28
3    |
4 LL |     let x: &'static i32 = &(5_i32.reverse_bits());
5    |                            ^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
6 ...
7 LL | }
8    | - temporary value only lives until here
9    |
10    = note: borrowed value must be valid for the static lifetime...
11
12 error[E0597]: borrowed value does not live long enough
13   --> $DIR/const-int-conversion.rs:16:28
14    |
15 LL |     let y: &'static i32 = &(i32::from_be_bytes([0x12, 0x34, 0x56, 0x78]));
16    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
17 ...
18 LL | }
19    | - temporary value only lives until here
20    |
21    = note: borrowed value must be valid for the static lifetime...
22
23 error[E0597]: borrowed value does not live long enough
24   --> $DIR/const-int-conversion.rs:18:28
25    |
26 LL |     let z: &'static i32 = &(i32::from_le_bytes([0x12, 0x34, 0x56, 0x78]));
27    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
28 ...
29 LL | }
30    | - temporary value only lives until here
31    |
32    = note: borrowed value must be valid for the static lifetime...
33
34 error[E0597]: borrowed value does not live long enough
35   --> $DIR/const-int-conversion.rs:20:28
36    |
37 LL |     let a: &'static i32 = &(i32::from_be(i32::from_ne_bytes([0x80, 0, 0, 0])));
38    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
39 ...
40 LL | }
41    | - temporary value only lives until here
42    |
43    = note: borrowed value must be valid for the static lifetime...
44
45 error[E0597]: borrowed value does not live long enough
46   --> $DIR/const-int-conversion.rs:22:29
47    |
48 LL |     let b: &'static [u8] = &(0x12_34_56_78_i32.to_be_bytes());
49    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
50 ...
51 LL | }
52    | - temporary value only lives until here
53    |
54    = note: borrowed value must be valid for the static lifetime...
55
56 error[E0597]: borrowed value does not live long enough
57   --> $DIR/const-int-conversion.rs:24:29
58    |
59 LL |     let c: &'static [u8] = &(0x12_34_56_78_i32.to_le_bytes());
60    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
61 ...
62 LL | }
63    | - temporary value only lives until here
64    |
65    = note: borrowed value must be valid for the static lifetime...
66
67 error[E0597]: borrowed value does not live long enough
68   --> $DIR/const-int-conversion.rs:26:29
69    |
70 LL |     let d: &'static [u8] = &(i32::min_value().to_be().to_ne_bytes());
71    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
72 LL |         //~^ ERROR does not live long enough
73 LL | }
74    | - temporary value only lives until here
75    |
76    = note: borrowed value must be valid for the static lifetime...
77
78 error: aborting due to 7 previous errors
79
80 For more information about this error, try `rustc --explain E0597`.