2021-08-18 21:15:33 +01:00
|
|
|
// revisions: cfail
|
2021-08-30 10:59:53 +02:00
|
|
|
#![feature(generic_const_exprs, adt_const_params)]
|
2021-08-18 21:15:33 +01:00
|
|
|
#![allow(incomplete_features)]
|
2023-05-17 04:05:46 +00:00
|
|
|
|
|
|
|
use std::marker::ConstParamTy;
|
|
|
|
|
|
|
|
#[derive(PartialEq, Eq, ConstParamTy)]
|
|
|
|
struct NonZeroUsize(usize);
|
|
|
|
|
|
|
|
impl NonZeroUsize {
|
|
|
|
const fn get(self) -> usize {
|
|
|
|
self.0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-18 21:15:33 +01:00
|
|
|
// regression test for #77650
|
2023-05-17 04:05:46 +00:00
|
|
|
fn c<T, const N: NonZeroUsize>()
|
2021-08-18 21:15:33 +01:00
|
|
|
where
|
|
|
|
[T; N.get()]: Sized,
|
|
|
|
{
|
|
|
|
use std::convert::TryFrom;
|
|
|
|
<[T; N.get()]>::try_from(())
|
|
|
|
//~^ error: the trait bound
|
2022-08-24 18:36:44 +00:00
|
|
|
//~| error: the trait bound
|
2021-08-27 17:34:48 -05:00
|
|
|
//~| error: mismatched types
|
2021-08-18 21:15:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|