rust/tests/ui/const-generics/adt_const_params/const_param_ty_generic_boun...

14 lines
452 B
Rust

#![allow(incomplete_features)]
#![feature(adt_const_params)]
#[derive(PartialEq, Eq)]
struct NotParam;
fn check<T: std::marker::ConstParamTy + ?Sized>() {}
fn main() {
check::<&NotParam>(); //~ error: `NotParam` can't be used as a const parameter type
check::<[NotParam]>(); //~ error: `NotParam` can't be used as a const parameter type
check::<[NotParam; 17]>(); //~ error: `NotParam` can't be used as a const parameter type
}