Skip to content

Commit

Permalink
add test for rust-lang#83993
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Apr 19, 2024
1 parent 07d0d7c commit 6761a91
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/ui/const-generics/adt_const_params/index-oob-ice-83993.rs
Original file line number Diff line number Diff line change
@@ -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() {}

0 comments on commit 6761a91

Please sign in to comment.