Skip to content

Commit 8f07588

Browse files
Rollup merge of #162702 - malezjaa:regression-test-for-unconstrained-const-args, r=BoxyUwU
regression test for unconstrained const args Closes #146906
2 parents 04aa30c + 46dd39c commit 8f07588

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/146906
2+
3+
#![feature(min_generic_const_args)]
4+
5+
trait Trait {}
6+
7+
impl Trait for [(); N] {}
8+
//~^ ERROR mismatched types
9+
10+
fn N(f: impl FnOnce(f64) -> f64 + Trait) {}
11+
12+
fn main() {}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/unconstrained-type-params.rs:7:21
3+
|
4+
LL | impl Trait for [(); N] {}
5+
| ^ expected `usize`, found fn item
6+
|
7+
= note: expected type `usize`
8+
found fn item `fn(_) {N::<_>}`
9+
= note: array length can only be `usize`
10+
11+
error: aborting due to 1 previous error
12+
13+
For more information about this error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)