]> git.proxmox.com Git - rustc.git/blame - tests/ui/consts/const-eval/promoted_raw_ptr_ops.stderr
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / consts / const-eval / promoted_raw_ptr_ops.stderr
CommitLineData
48663c56 1error[E0716]: temporary value dropped while borrowed
3c0e092e 2 --> $DIR/promoted_raw_ptr_ops.rs:2:29
b7449926
XL
3 |
4LL | let x: &'static bool = &(42 as *const i32 == 43 as *const i32);
487cf647 5 | ------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
48663c56
XL
6 | |
7 | type annotation requires that borrow lasts for `'static`
b7449926
XL
8...
9LL | }
48663c56 10 | - temporary value is freed at the end of this statement
b7449926 11
48663c56 12error[E0716]: temporary value dropped while borrowed
3c0e092e 13 --> $DIR/promoted_raw_ptr_ops.rs:4:30
b7449926 14 |
532ac7d7 15LL | let y: &'static usize = &(&1 as *const i32 as usize + 1);
487cf647 16 | -------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
48663c56
XL
17 | |
18 | type annotation requires that borrow lasts for `'static`
0bf4aa26 19...
b7449926 20LL | }
48663c56 21 | - temporary value is freed at the end of this statement
b7449926 22
48663c56 23error[E0716]: temporary value dropped while borrowed
3c0e092e 24 --> $DIR/promoted_raw_ptr_ops.rs:6:28
b7449926 25 |
532ac7d7 26LL | let z: &'static i32 = &(unsafe { *(42 as *const i32) });
487cf647 27 | ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
48663c56
XL
28 | |
29 | type annotation requires that borrow lasts for `'static`
30...
0bf4aa26 31LL | }
48663c56 32 | - temporary value is freed at the end of this statement
0bf4aa26 33
48663c56 34error[E0716]: temporary value dropped while borrowed
3c0e092e 35 --> $DIR/promoted_raw_ptr_ops.rs:8:29
0bf4aa26 36 |
532ac7d7 37LL | let a: &'static bool = &(main as fn() == main as fn());
487cf647 38 | ------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
48663c56
XL
39 | |
40 | type annotation requires that borrow lasts for `'static`
41LL |
b7449926 42LL | }
48663c56 43 | - temporary value is freed at the end of this statement
b7449926 44
0bf4aa26 45error: aborting due to 4 previous errors
b7449926 46
48663c56 47For more information about this error, try `rustc --explain E0716`.