rust/tests/incremental/const-generics/hash-tyvid-regression-1.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
554 B
Rust
Raw Normal View History

2021-08-18 15:15:33 -05:00
// revisions: cfail
#![feature(generic_const_exprs, adt_const_params)]
2021-08-18 15:15:33 -05:00
#![allow(incomplete_features)]
use std::marker::ConstParamTy;
#[derive(PartialEq, Eq, ConstParamTy)]
struct NonZeroUsize(usize);
impl NonZeroUsize {
const fn get(self) -> usize {
self.0
}
}
2021-08-18 15:15:33 -05:00
// regression test for #77650
fn c<T, const N: NonZeroUsize>()
2021-08-18 15:15:33 -05:00
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
2021-08-18 15:15:33 -05:00
}
fn main() {}