Const parameters can not be inferred with _
Small improvement. Thanks varkor Co-authored-by: varkor <github@varkor.com> Bless
This commit is contained in:
parent
e6225434ff
commit
6845e22bba
4 changed files with 28 additions and 0 deletions
|
|
@ -9,6 +9,8 @@ error[E0747]: type provided when a constant was expected
|
|||
|
|
||||
LL | foo::<_, {[1]}>();
|
||||
| ^
|
||||
|
|
||||
= help: const arguments cannot yet be inferred with `_`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-62878.rs:11:15
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
#![feature(min_const_generics)]
|
||||
fn foo<const N: usize, const K: usize>(data: [u32; N]) -> [u32; K] {
|
||||
[0; K]
|
||||
}
|
||||
fn main() {
|
||||
let a = foo::<_, 2>([0, 1, 2]);
|
||||
//~^ ERROR type provided when a constant was expected
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
error[E0747]: type provided when a constant was expected
|
||||
--> $DIR/inferred_const.rs:6:19
|
||||
|
|
||||
LL | let a = foo::<_, 2>([0, 1, 2]);
|
||||
| ^
|
||||
|
|
||||
= help: const arguments cannot yet be inferred with `_`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0747`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue