Add a full regression test for #73727

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
This commit is contained in:
Yuki Okushi 2022-06-21 19:08:48 +09:00
parent 42dcf70f99
commit 31476e7096
No known key found for this signature in database
GPG key ID: 379CEEFDD63E5DD7
3 changed files with 15 additions and 7 deletions

View file

@ -1,5 +1,5 @@
error: `&'static [u32]` is forbidden as the type of a const generic parameter
--> $DIR/static-reference-array-const-param.rs:1:15
--> $DIR/issue-73727-static-reference-array-const-param.rs:9:15
|
LL | fn a<const X: &'static [u32]>() {}
| ^^^^^^^^^^^^^^

View file

@ -0,0 +1,14 @@
// Regression test for #73727
// revisions: full min
//[full]check-pass
#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
fn a<const X: &'static [u32]>() {}
//[min]~^ ERROR `&'static [u32]` is forbidden as the type of a const generic parameter
fn main() {
a::<{&[]}>();
}

View file

@ -1,6 +0,0 @@
fn a<const X: &'static [u32]>() {}
//~^ ERROR `&'static [u32]` is forbidden as the type of a const generic parameter
fn main() {
a::<{&[]}>();
}