From 71362c733f3e3b0d83e78554b1cf4009aa319e84 Mon Sep 17 00:00:00 2001 From: James Dietz Date: Wed, 28 Jun 2023 07:50:34 -0400 Subject: [PATCH] remove FIXME and add test --- .../src/transform/check_consts/qualifs.rs | 2 -- tests/ui/match/issue-113012.rs | 12 ++++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 tests/ui/match/issue-113012.rs diff --git a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs index 3496a06a4e072..36c76e532313d 100644 --- a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs +++ b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs @@ -344,8 +344,6 @@ where }; // Check the qualifs of the value of `const` items. - // FIXME(valtrees): check whether const qualifs should behave the same - // way for type and mir constants. let uneval = match constant.literal { ConstantKind::Ty(ct) if matches!( diff --git a/tests/ui/match/issue-113012.rs b/tests/ui/match/issue-113012.rs new file mode 100644 index 0000000000000..da7a8b65b97ba --- /dev/null +++ b/tests/ui/match/issue-113012.rs @@ -0,0 +1,12 @@ +// run-pass + +#![allow(dead_code)] +struct Foo(()); + +const FOO: Foo = Foo(match 0 { + 0.. => (), + _ => (), +}); + +fn main() { +}