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