summaryrefslogtreecommitdiffstats
path: root/tests/incremental/const-generics/hash-tyvid-regression-1.rs
blob: 06d674234510ab643e28921d3c6a327c5cb11998 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// revisions: cfail
#![feature(generic_const_exprs, adt_const_params)]
#![allow(incomplete_features)]

use std::marker::ConstParamTy;

#[derive(PartialEq, Eq, ConstParamTy)]
struct NonZeroUsize(usize);

impl NonZeroUsize {
    const fn get(self) -> usize {
        self.0
    }
}

// regression test for #77650
fn c<T, const N: NonZeroUsize>()
where
    [T; N.get()]: Sized,
{
    use std::convert::TryFrom;
    <[T; N.get()]>::try_from(())
    //~^ error: the trait bound
    //~| error: the trait bound
    //~| error: mismatched types
}

fn main() {}