mirror of
https://github.com/rust-lang/rust.git
synced 2026-07-17 21:27:35 -04:00
10 lines
264 B
Rust
10 lines
264 B
Rust
#![feature(type_info)]
|
|
|
|
trait Trait {}
|
|
|
|
fn main() {
|
|
// Test the (lack of) usability of comptime fns in runtime code.
|
|
std::any::TypeId::of::<[u8; usize::MAX]>().trait_info_of::<dyn Trait>();
|
|
//~^ ERROR: comptime fns can only be called at compile time
|
|
}
|