Print constants in type_name for const generics

This commit is contained in:
varkor 2020-01-24 16:22:24 +00:00
parent dee12bb2b7
commit 50dd8eaeb9
5 changed files with 52 additions and 12 deletions

View file

@ -0,0 +1,11 @@
// run-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
#[derive(Debug)]
struct S<const N: usize>;
fn main() {
assert_eq!(std::any::type_name::<S<3>>(), "const_generic_type_name::S<3usize>");
}

View file

@ -0,0 +1,8 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
--> $DIR/const-generic-type_name.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default