add test for ICE: no entry found for key for const function in generic_const_exprs #113133

Fixes #113133
This commit is contained in:
Matthias Krüger 2024-03-24 10:16:29 +01:00
parent 8ed5e6744f
commit cdea6d8382
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,13 @@
// ICE no entry found for key generics_of
// issue: rust-lang/rust#113133
#![allow(incomplete_features)]
#![feature(generic_const_exprs, non_lifetime_binders)]
pub fn foo()
where
for<const N: usize = { const fn bar() {} bar(); 1 }> ():,
//~^ ERROR defaults for generic parameters are not allowed in `for<...>` binders
{}
fn main() {}

View File

@ -0,0 +1,8 @@
error: defaults for generic parameters are not allowed in `for<...>` binders
--> $DIR/no-entry-found-for-key-ice-gce-nlb-113133.rs:9:9
|
LL | for<const N: usize = { const fn bar() {} bar(); 1 }> ():,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 1 previous error