mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
25 lines
476 B
Rust
25 lines
476 B
Rust
#![allow(incomplete_features)]
|
|
#![feature(generic_const_exprs)]
|
|
|
|
trait True {}
|
|
|
|
struct Is<const V: bool>;
|
|
|
|
impl True for Is<true> {}
|
|
|
|
fn g<T>()
|
|
//~^ NOTE required by a bound in this
|
|
where
|
|
Is<{ std::mem::size_of::<T>() == 0 }>: True,
|
|
//~^ NOTE required by a bound in `g`
|
|
//~| NOTE required by this bound in `g`
|
|
{
|
|
}
|
|
|
|
fn main() {
|
|
g::<usize>();
|
|
//~^ ERROR mismatched types
|
|
//~| NOTE expected `false`, found `true`
|
|
//~| NOTE expected constant `false`
|
|
}
|