rust/tests/ui/const-generics/issues/issue-88468.rs

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

14 lines
290 B
Rust
Raw Normal View History

2021-12-08 16:25:52 -06:00
//@ check-pass
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
pub struct Assert<const COND: bool>();
pub trait IsTrue {}
impl IsTrue for Assert<true> {}
pub trait IsNotZST {}
impl<T> IsNotZST for T where Assert<{ std::mem::size_of::<T>() > 0 }>: IsTrue {}
fn main() {}