File tree 2 files changed +16
-1
lines changed
test/rustdoc/const-generics
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 {
2768
2768
} ;
2769
2769
let length = match cx. tcx . const_eval ( param_env. and ( cid) ) {
2770
2770
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 ( ) ) ,
2772
2775
} ;
2773
2776
Array ( box ty. clean ( cx) , length)
2774
2777
} ,
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