From 3a6e96e8bc8b7285c5a9b357d0e5e8dd9c191edf Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Wed, 25 Sep 2019 10:28:53 +0200 Subject: [PATCH] Allow simd_insert and simd_extract in const_fn --- src/librustc_mir/transform/qualify_consts.rs | 2 + .../const-eval/simd/insert_extract-fail.rs | 2 +- .../consts/const-eval/simd/insert_extract.rs | 2 +- .../const-eval/simd/insert_extract.stderr | 288 ------------------ 4 files changed, 4 insertions(+), 290 deletions(-) delete mode 100644 src/test/ui/consts/const-eval/simd/insert_extract.stderr diff --git a/src/librustc_mir/transform/qualify_consts.rs b/src/librustc_mir/transform/qualify_consts.rs index 795721f3b3f..8a6dcd1d2b4 100644 --- a/src/librustc_mir/transform/qualify_consts.rs +++ b/src/librustc_mir/transform/qualify_consts.rs @@ -557,6 +557,8 @@ fn in_call( | "saturating_add" | "saturating_sub" | "transmute" + | "simd_insert" + | "simd_extract" => return true, _ => {} diff --git a/src/test/ui/consts/const-eval/simd/insert_extract-fail.rs b/src/test/ui/consts/const-eval/simd/insert_extract-fail.rs index 20c839a81a0..bbfae997e72 100644 --- a/src/test/ui/consts/const-eval/simd/insert_extract-fail.rs +++ b/src/test/ui/consts/const-eval/simd/insert_extract-fail.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zunleash-the-miri-inside-of-you +#![feature(const_fn)] #![feature(repr_simd)] #![feature(platform_intrinsics)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/consts/const-eval/simd/insert_extract.rs b/src/test/ui/consts/const-eval/simd/insert_extract.rs index 136965bf68a..d3462d802ea 100644 --- a/src/test/ui/consts/const-eval/simd/insert_extract.rs +++ b/src/test/ui/consts/const-eval/simd/insert_extract.rs @@ -1,5 +1,5 @@ // run-pass -// compile-flags: -Zunleash-the-miri-inside-of-you +#![feature(const_fn)] #![feature(repr_simd)] #![feature(platform_intrinsics)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/consts/const-eval/simd/insert_extract.stderr b/src/test/ui/consts/const-eval/simd/insert_extract.stderr deleted file mode 100644 index 8975241403e..00000000000 --- a/src/test/ui/consts/const-eval/simd/insert_extract.stderr +++ /dev/null @@ -1,288 +0,0 @@ -warning: skipping const checks - --> $DIR/insert_extract.rs:22:9 - | -LL | assert_eq!(X0, 42); - | ^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:22:9 - | -LL | assert_eq!(X0, 42); - | ^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:22:9 - | -LL | assert_eq!(X0, 42); - | ^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:23:9 - | -LL | assert_eq!(Y0, 42); - | ^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:23:9 - | -LL | assert_eq!(Y0, 42); - | ^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:23:9 - | -LL | assert_eq!(Y0, 42); - | ^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:32:9 - | -LL | assert_eq!(X0, 13); - | ^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:32:9 - | -LL | assert_eq!(X0, 13); - | ^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:32:9 - | -LL | assert_eq!(X0, 13); - | ^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:33:9 - | -LL | assert_eq!(X1, 42); - | ^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:33:9 - | -LL | assert_eq!(X1, 42); - | ^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:33:9 - | -LL | assert_eq!(X1, 42); - | ^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:34:9 - | -LL | assert_eq!(Y0, 13); - | ^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:34:9 - | -LL | assert_eq!(Y0, 13); - | ^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:34:9 - | -LL | assert_eq!(Y0, 13); - | ^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:35:9 - | -LL | assert_eq!(Y1, 42); - | ^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:35:9 - | -LL | assert_eq!(Y1, 42); - | ^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:35:9 - | -LL | assert_eq!(Y1, 42); - | ^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:46:9 - | -LL | assert_eq!(X0, 13.); - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:46:9 - | -LL | assert_eq!(X0, 13.); - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:46:9 - | -LL | assert_eq!(X0, 13.); - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:47:9 - | -LL | assert_eq!(X1, 42.); - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:47:9 - | -LL | assert_eq!(X1, 42.); - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:47:9 - | -LL | assert_eq!(X1, 42.); - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:48:9 - | -LL | assert_eq!(X2, 15.); - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:48:9 - | -LL | assert_eq!(X2, 15.); - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:48:9 - | -LL | assert_eq!(X2, 15.); - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:49:9 - | -LL | assert_eq!(Y0, 13.); - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:49:9 - | -LL | assert_eq!(Y0, 13.); - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:49:9 - | -LL | assert_eq!(Y0, 13.); - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:50:9 - | -LL | assert_eq!(Y1, 42.); - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:50:9 - | -LL | assert_eq!(Y1, 42.); - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:50:9 - | -LL | assert_eq!(Y1, 42.); - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:51:9 - | -LL | assert_eq!(Y2, 15.); - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:51:9 - | -LL | assert_eq!(Y2, 15.); - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -warning: skipping const checks - --> $DIR/insert_extract.rs:51:9 - | -LL | assert_eq!(Y2, 15.); - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -- 2.44.0