]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/promoted_raw_ptr_ops.stderr
Rollup merge of #85766 - workingjubilee:file-options, r=yaahc
[rust.git] / src / test / ui / consts / const-eval / promoted_raw_ptr_ops.stderr
1 error[E0716]: temporary value dropped while borrowed
2   --> $DIR/promoted_raw_ptr_ops.rs:2:29
3    |
4 LL |     let x: &'static bool = &(42 as *const i32 == 43 as *const i32);
5    |            -------------    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary 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/promoted_raw_ptr_ops.rs:4:30
14    |
15 LL |     let y: &'static usize = &(&1 as *const i32 as usize + 1);
16    |            --------------    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary 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/promoted_raw_ptr_ops.rs:6:28
25    |
26 LL |     let z: &'static i32 = &(unsafe { *(42 as *const i32) });
27    |            ------------    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary 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/promoted_raw_ptr_ops.rs:8:29
36    |
37 LL |     let a: &'static bool = &(main as fn() == main as fn());
38    |            -------------    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
39    |            |
40    |            type annotation requires that borrow lasts for `'static`
41 LL |
42 LL | }
43    | - temporary value is freed at the end of this statement
44
45 error: aborting due to 4 previous errors
46
47 For more information about this error, try `rustc --explain E0716`.