Print constants in type_name for const generics
This commit is contained in:
parent
dee12bb2b7
commit
50dd8eaeb9
5 changed files with 52 additions and 12 deletions
11
src/test/ui/const-generics/const-generic-type_name.rs
Normal file
11
src/test/ui/const-generics/const-generic-type_name.rs
Normal 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>");
|
||||
}
|
||||
|
|
@ -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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue