mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
31 lines
556 B
Rust
31 lines
556 B
Rust
#![feature(const_type_id)]
|
|
#![feature(generic_const_exprs)]
|
|
#![feature(core_intrinsics)]
|
|
#![allow(incomplete_features)]
|
|
|
|
use std::any::TypeId;
|
|
|
|
struct If<const B: bool>;
|
|
pub trait True {}
|
|
impl True for If<true> {}
|
|
|
|
fn consume<T: 'static>(_val: T)
|
|
where
|
|
If<{ TypeId::of::<T>() != TypeId::of::<()>() }>: True,
|
|
//~^ overly complex generic constant
|
|
{
|
|
}
|
|
|
|
fn test<T: 'static>()
|
|
where
|
|
If<{ TypeId::of::<T>() != TypeId::of::<()>() }>: True,
|
|
//~^ overly complex generic constant
|
|
{
|
|
}
|
|
|
|
fn main() {
|
|
let a = ();
|
|
consume(0i32);
|
|
consume(a);
|
|
}
|