]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/const-ptr-nonnull.stderr
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / consts / const-ptr-nonnull.stderr
CommitLineData
48663c56 1error[E0716]: temporary value dropped while borrowed
532ac7d7
XL
2 --> $DIR/const-ptr-nonnull.rs:4:37
3 |
4LL | let x: &'static NonNull<u32> = &(NonNull::dangling());
48663c56
XL
5 | --------------------- ^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
6 | |
7 | type annotation requires that borrow lasts for `'static`
532ac7d7
XL
8...
9LL | }
48663c56 10 | - temporary value is freed at the end of this statement
532ac7d7 11
48663c56 12error[E0716]: temporary value dropped while borrowed
532ac7d7
XL
13 --> $DIR/const-ptr-nonnull.rs:9:37
14 |
15LL | let x: &'static NonNull<u32> = &(non_null.cast());
48663c56
XL
16 | --------------------- ^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
17 | |
18 | type annotation requires that borrow lasts for `'static`
532ac7d7
XL
19LL |
20LL | }
48663c56 21 | - temporary value is freed at the end of this statement
532ac7d7
XL
22
23error: aborting due to 2 previous errors
24
48663c56 25For more information about this error, try `rustc --explain E0716`.