@@ -994,14 +994,15 @@ impl<'tcx> DumpVisitor<'tcx> {
994
994
hir:: TraitItemKind :: Const ( ref ty, body) => {
995
995
let body = body. map ( |b| & self . tcx . hir ( ) . body ( b) . value ) ;
996
996
let respan = respan ( vis_span, hir:: VisibilityKind :: Public ) ;
997
+ let attrs = self . tcx . hir ( ) . attrs ( trait_item. hir_id ( ) ) ;
997
998
self . process_assoc_const (
998
999
trait_item. hir_id ( ) ,
999
1000
trait_item. ident ,
1000
1001
& ty,
1001
1002
body,
1002
1003
trait_id,
1003
1004
& respan,
1004
- & trait_item . attrs ,
1005
+ attrs,
1005
1006
) ;
1006
1007
}
1007
1008
hir:: TraitItemKind :: Fn ( ref sig, ref trait_fn) => {
@@ -1027,6 +1028,7 @@ impl<'tcx> DumpVisitor<'tcx> {
1027
1028
if !self . span . filter_generated ( trait_item. ident . span ) {
1028
1029
let span = self . span_from_span ( trait_item. ident . span ) ;
1029
1030
let id = id_from_def_id ( trait_item. def_id . to_def_id ( ) ) ;
1031
+ let attrs = self . tcx . hir ( ) . attrs ( trait_item. hir_id ( ) ) ;
1030
1032
1031
1033
self . dumper . dump_def (
1032
1034
& Access { public : true , reachable : true } ,
@@ -1040,18 +1042,15 @@ impl<'tcx> DumpVisitor<'tcx> {
1040
1042
parent : Some ( id_from_def_id ( trait_id) ) ,
1041
1043
children : vec ! [ ] ,
1042
1044
decl_id : None ,
1043
- docs : self . save_ctxt . docs_for_attrs ( & trait_item . attrs ) ,
1045
+ docs : self . save_ctxt . docs_for_attrs ( attrs) ,
1044
1046
sig : sig:: assoc_type_signature (
1045
1047
trait_item. hir_id ( ) ,
1046
1048
trait_item. ident ,
1047
1049
Some ( bounds) ,
1048
1050
default_ty. as_ref ( ) . map ( |ty| & * * ty) ,
1049
1051
& self . save_ctxt ,
1050
1052
) ,
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 ) ,
1055
1054
} ,
1056
1055
) ;
1057
1056
}
0 commit comments