]>
Commit | Line | Data |
---|---|---|
48663c56 | 1 | error[E0716]: temporary value dropped while borrowed |
532ac7d7 XL |
2 | --> $DIR/const-ptr-nonnull.rs:4:37 |
3 | | | |
4 | LL | 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 | ... |
9 | LL | } | |
48663c56 | 10 | | - temporary value is freed at the end of this statement |
532ac7d7 | 11 | |
48663c56 | 12 | error[E0716]: temporary value dropped while borrowed |
532ac7d7 XL |
13 | --> $DIR/const-ptr-nonnull.rs:9:37 |
14 | | | |
15 | LL | 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 |
19 | LL | |
20 | LL | } | |
48663c56 | 21 | | - temporary value is freed at the end of this statement |
532ac7d7 XL |
22 | |
23 | error: aborting due to 2 previous errors | |
24 | ||
48663c56 | 25 | For more information about this error, try `rustc --explain E0716`. |