forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tim
committed
Mar 3, 2019
1 parent
797d8ea
commit 60a649e
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
error[E0716]: temporary value dropped while borrowed | ||
--> $DIR/const-ptr-nonnull.rs:4:37 | ||
| | ||
LL | let x: &'static NonNull<u32> = &(NonNull::dangling()); | ||
| --------------------- ^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use | ||
| | | ||
| type annotation requires that borrow lasts for `'static` | ||
... | ||
LL | } | ||
| - temporary value is freed at the end of this statement | ||
|
||
error[E0716]: temporary value dropped while borrowed | ||
--> $DIR/const-ptr-nonnull.rs:9:37 | ||
| | ||
LL | let x: &'static NonNull<u32> = &(non_null.cast()); | ||
| --------------------- ^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use | ||
| | | ||
| type annotation requires that borrow lasts for `'static` | ||
LL | //~^ ERROR borrowed value does not live long enough | ||
LL | } | ||
| - temporary value is freed at the end of this statement | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0716`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error[E0716]: temporary value dropped while borrowed | ||
--> $DIR/const-ptr-unique.rs:8:33 | ||
| | ||
LL | let x: &'static *mut u32 = &(unique.as_ptr()); | ||
| ----------------- ^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use | ||
| | | ||
| type annotation requires that borrow lasts for `'static` | ||
LL | //~^ ERROR borrowed value does not live long enough | ||
LL | } | ||
| - temporary value is freed at the end of this statement | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0716`. |