@@ -994,14 +994,15 @@ impl<'tcx> DumpVisitor<'tcx> {
994994 hir:: TraitItemKind :: Const ( ref ty, body) => {
995995 let body = body. map ( |b| & self . tcx . hir ( ) . body ( b) . value ) ;
996996 let respan = respan ( vis_span, hir:: VisibilityKind :: Public ) ;
997+ let attrs = self . tcx . hir ( ) . attrs ( trait_item. hir_id ( ) ) ;
997998 self . process_assoc_const (
998999 trait_item. hir_id ( ) ,
9991000 trait_item. ident ,
10001001 & ty,
10011002 body,
10021003 trait_id,
10031004 & respan,
1004- & trait_item . attrs ,
1005+ attrs,
10051006 ) ;
10061007 }
10071008 hir:: TraitItemKind :: Fn ( ref sig, ref trait_fn) => {
@@ -1027,6 +1028,7 @@ impl<'tcx> DumpVisitor<'tcx> {
10271028 if !self . span . filter_generated ( trait_item. ident . span ) {
10281029 let span = self . span_from_span ( trait_item. ident . span ) ;
10291030 let id = id_from_def_id ( trait_item. def_id . to_def_id ( ) ) ;
1031+ let attrs = self . tcx . hir ( ) . attrs ( trait_item. hir_id ( ) ) ;
10301032
10311033 self . dumper . dump_def (
10321034 & Access { public : true , reachable : true } ,
@@ -1040,18 +1042,15 @@ impl<'tcx> DumpVisitor<'tcx> {
10401042 parent : Some ( id_from_def_id ( trait_id) ) ,
10411043 children : vec ! [ ] ,
10421044 decl_id : None ,
1043- docs : self . save_ctxt . docs_for_attrs ( & trait_item . attrs ) ,
1045+ docs : self . save_ctxt . docs_for_attrs ( attrs) ,
10441046 sig : sig:: assoc_type_signature (
10451047 trait_item. hir_id ( ) ,
10461048 trait_item. ident ,
10471049 Some ( bounds) ,
10481050 default_ty. as_ref ( ) . map ( |ty| & * * ty) ,
10491051 & self . save_ctxt ,
10501052 ) ,
1051- attributes : lower_attributes (
1052- trait_item. attrs . to_vec ( ) ,
1053- & self . save_ctxt ,
1054- ) ,
1053+ attributes : lower_attributes ( attrs. to_vec ( ) , & self . save_ctxt ) ,
10551054 } ,
10561055 ) ;
10571056 }
0 commit comments