From a15ee4d7c844c317043116969cede8341d932a46 Mon Sep 17 00:00:00 2001 From: Vishnunarayan K I Date: Thu, 5 Nov 2020 13:24:21 +0530 Subject: [PATCH] update dangling-alloc-id-ice test --- src/test/ui/consts/dangling-alloc-id-ice.rs | 2 +- src/test/ui/consts/dangling-alloc-id-ice.stderr | 15 +-------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/test/ui/consts/dangling-alloc-id-ice.rs b/src/test/ui/consts/dangling-alloc-id-ice.rs index 3b7f1de5b9be..95acacdb7879 100644 --- a/src/test/ui/consts/dangling-alloc-id-ice.rs +++ b/src/test/ui/consts/dangling-alloc-id-ice.rs @@ -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 } diff --git a/src/test/ui/consts/dangling-alloc-id-ice.stderr b/src/test/ui/consts/dangling-alloc-id-ice.stderr index 14a49810b9de..24f574498722 100644 --- a/src/test/ui/consts/dangling-alloc-id-ice.stderr +++ b/src/test/ui/consts/dangling-alloc-id-ice.stderr @@ -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`.