summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/adt_const_params/const_param_ty_generic_bounds_do_not_hold.rs
blob: e4dc76703a2d8a4eb34444b036a6c0393e5228d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#![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
}