From d7e0f431dedbf3684496ef1f2289ab1c7d936e60 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Fri, 11 Jun 2021 06:20:54 +0900 Subject: [PATCH] Run full const-generics test for issue-72293 --- .../transmute-const-param-static-reference.rs | 10 ---------- ...mute-const-param-static-reference.min.stderr} | 2 +- .../transmute-const-param-static-reference.rs | 16 ++++++++++++++++ 3 files changed, 17 insertions(+), 11 deletions(-) delete mode 100644 src/test/ui/const-generics/min_const_generics/transmute-const-param-static-reference.rs rename src/test/ui/const-generics/{min_const_generics/transmute-const-param-static-reference.stderr => transmute-const-param-static-reference.min.stderr} (85%) create mode 100644 src/test/ui/const-generics/transmute-const-param-static-reference.rs diff --git a/src/test/ui/const-generics/min_const_generics/transmute-const-param-static-reference.rs b/src/test/ui/const-generics/min_const_generics/transmute-const-param-static-reference.rs deleted file mode 100644 index 560795a51f58e..0000000000000 --- a/src/test/ui/const-generics/min_const_generics/transmute-const-param-static-reference.rs +++ /dev/null @@ -1,10 +0,0 @@ -struct Const; -//~^ ERROR `&'static ()` is forbidden as the type of a const generic parameter - -fn main() { - const A: &'static () = unsafe { - std::mem::transmute(10 as *const ()) - }; - - let _ = Const::<{A}>; -} diff --git a/src/test/ui/const-generics/min_const_generics/transmute-const-param-static-reference.stderr b/src/test/ui/const-generics/transmute-const-param-static-reference.min.stderr similarity index 85% rename from src/test/ui/const-generics/min_const_generics/transmute-const-param-static-reference.stderr rename to src/test/ui/const-generics/transmute-const-param-static-reference.min.stderr index d612e0c35a10f..f735be9c24e08 100644 --- a/src/test/ui/const-generics/min_const_generics/transmute-const-param-static-reference.stderr +++ b/src/test/ui/const-generics/transmute-const-param-static-reference.min.stderr @@ -1,5 +1,5 @@ error: `&'static ()` is forbidden as the type of a const generic parameter - --> $DIR/transmute-const-param-static-reference.rs:1:23 + --> $DIR/transmute-const-param-static-reference.rs:7:23 | LL | struct Const; | ^^^^^^^^^^^ diff --git a/src/test/ui/const-generics/transmute-const-param-static-reference.rs b/src/test/ui/const-generics/transmute-const-param-static-reference.rs new file mode 100644 index 0000000000000..3147d61ec9bd9 --- /dev/null +++ b/src/test/ui/const-generics/transmute-const-param-static-reference.rs @@ -0,0 +1,16 @@ +// revisions: full min +//[full] check-pass + +#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, allow(incomplete_features))] + +struct Const; +//[min]~^ ERROR `&'static ()` is forbidden as the type of a const generic parameter + +fn main() { + const A: &'static () = unsafe { + std::mem::transmute(10 as *const ()) + }; + + let _ = Const::<{A}>; +}