Add a test for [NotParam; 0]: ConstParamTy
(not holding)
This commit is contained in:
parent
2c5e7160f3
commit
51355ad92b
@ -0,0 +1,12 @@
|
|||||||
|
#![allow(incomplete_features)]
|
||||||
|
#![feature(adt_const_params)]
|
||||||
|
|
||||||
|
#[derive(PartialEq, Eq)]
|
||||||
|
struct NotParam;
|
||||||
|
|
||||||
|
fn check<T: std::marker::ConstParamTy>() {}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
check::<[NotParam; 0]>();
|
||||||
|
//~^ error: `NotParam` can't be used as a const parameter type
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
error[E0277]: `NotParam` can't be used as a const parameter type
|
||||||
|
--> $DIR/const_param_ty_bad_empty_array.rs:10:13
|
||||||
|
|
|
||||||
|
LL | check::<[NotParam; 0]>();
|
||||||
|
| ^^^^^^^^^^^^^ the trait `ConstParamTy` is not implemented for `NotParam`
|
||||||
|
|
|
||||||
|
= note: required for `[NotParam; 0]` to implement `ConstParamTy`
|
||||||
|
note: required by a bound in `check`
|
||||||
|
--> $DIR/const_param_ty_bad_empty_array.rs:7:13
|
||||||
|
|
|
||||||
|
LL | fn check<T: std::marker::ConstParamTy>() {}
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0277`.
|
Loading…
Reference in New Issue
Block a user