File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
test/rustdoc/const-generics Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -2768,7 +2768,10 @@ impl Clean<Type> for hir::Ty {
27682768 } ;
27692769 let length = match cx. tcx . const_eval ( param_env. and ( cid) ) {
27702770 Ok ( length) => print_const ( cx, length) ,
2771- Err ( _) => "_" . to_string ( ) ,
2771+ Err ( _) => cx. sess ( )
2772+ . source_map ( )
2773+ . span_to_snippet ( cx. tcx . def_span ( def_id) )
2774+ . unwrap_or_else ( |_| "_" . to_string ( ) ) ,
27722775 } ;
27732776 Array ( box ty. clean ( cx) , length)
27742777 } ,
Original file line number Diff line number Diff line change 1+ #![ crate_name = "foo" ]
2+ #![ feature( const_generics) ]
3+
4+ pub trait Array {
5+ type Item ;
6+ }
7+
8+ // @has foo/trait.Array.html
9+ // @has - '//h3[@class="impl"]' 'impl<T, const N: usize> Array for [T; N]'
10+ impl < T , const N : usize > Array for [ T ; N ] {
11+ type Item = T ;
12+ }
You can’t perform that action at this time.
0 commit comments