mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
update dangling-alloc-id-ice test
This commit is contained in:
parent
bd7229daf0
commit
a15ee4d7c8
@ -6,7 +6,7 @@ union Foo<'a> {
|
||||
long_live_the_unit: &'static (),
|
||||
}
|
||||
|
||||
const FOO: &() = { //~ ERROR it is undefined behavior to use this value
|
||||
const FOO: &() = {
|
||||
//~^ ERROR encountered dangling pointer in final constant
|
||||
let y = ();
|
||||
unsafe { Foo { y: &y }.long_live_the_unit }
|
||||
|
@ -8,18 +8,5 @@ LL | | unsafe { Foo { y: &y }.long_live_the_unit }
|
||||
LL | | };
|
||||
| |__^
|
||||
|
||||
error[E0080]: it is undefined behavior to use this value
|
||||
--> $DIR/dangling-alloc-id-ice.rs:9:1
|
||||
|
|
||||
LL | / const FOO: &() = {
|
||||
LL | |
|
||||
LL | | let y = ();
|
||||
LL | | unsafe { Foo { y: &y }.long_live_the_unit }
|
||||
LL | | };
|
||||
| |__^ type validation failed: encountered a dangling reference (use-after-free)
|
||||
|
|
||||
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
|
||||
error: aborting due to previous error
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0080`.
|
||||
|
Loading…
Reference in New Issue
Block a user