From 6761a916c827acf7d16c715ece915c65a4c5e9d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Fri, 19 Apr 2024 18:27:25 +0200 Subject: [PATCH] add test for #83993 Fixes #83993 --- .../adt_const_params/index-oob-ice-83993.rs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/ui/const-generics/adt_const_params/index-oob-ice-83993.rs diff --git a/tests/ui/const-generics/adt_const_params/index-oob-ice-83993.rs b/tests/ui/const-generics/adt_const_params/index-oob-ice-83993.rs new file mode 100644 index 0000000000000..129009f67e354 --- /dev/null +++ b/tests/ui/const-generics/adt_const_params/index-oob-ice-83993.rs @@ -0,0 +1,20 @@ +// issue: rust-lang/rust/#83993 + +#![feature(adt_const_params)] +//~^ WARN the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes +fn bug<'a>() +where + for<'b> [(); { + let x: &'b (); + //~^ ERROR generic parameters may not be used in const operations + //~| WARN unused variable: `x` + 0 + }]: +{} + +fn bad() where for<'b> [();{let _:&'b (); 0}]: Sized { } +//~^ ERROR generic parameters may not be used in const operations +fn good() where for<'b> [();{0}]: Sized { } +//~^ WARN unnecessary braces around const expression + +pub fn main() {}