@@ -117,8 +117,7 @@ macro_rules! item_template_methods {
117117 fn render_attributes_in_pre<' b>( & ' b self ) -> impl fmt:: Display + Captures <' a> + ' b + Captures <' cx> {
118118 display_fn( move |f| {
119119 let ( item, cx) = self . item_and_mut_cx( ) ;
120- let tcx = cx. tcx( ) ;
121- let v = render_attributes_in_pre( item, "" , tcx) ;
120+ let v = render_attributes_in_pre( item, "" , & cx) ;
122121 write!( f, "{v}" )
123122 } )
124123 }
@@ -656,7 +655,7 @@ fn item_function(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, f: &cle
656655 w,
657656 "{attrs}{vis}{constness}{asyncness}{unsafety}{abi}fn \
658657 {name}{generics}{decl}{notable_traits}{where_clause}",
659- attrs = render_attributes_in_pre( it, "" , tcx ) ,
658+ attrs = render_attributes_in_pre( it, "" , cx ) ,
660659 vis = visibility,
661660 constness = constness,
662661 asyncness = asyncness,
@@ -691,7 +690,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
691690 write ! (
692691 w,
693692 "{attrs}{vis}{unsafety}{is_auto}trait {name}{generics}{bounds}" ,
694- attrs = render_attributes_in_pre( it, "" , tcx ) ,
693+ attrs = render_attributes_in_pre( it, "" , cx ) ,
695694 vis = visibility_print_with_space( it. visibility( tcx) , it. item_id, cx) ,
696695 unsafety = t. unsafety( tcx) . print_with_space( ) ,
697696 is_auto = if t. is_auto( tcx) { "auto " } else { "" } ,
@@ -1170,7 +1169,7 @@ fn item_trait_alias(
11701169 write ! (
11711170 w,
11721171 "{attrs}trait {name}{generics}{where_b} = {bounds};" ,
1173- attrs = render_attributes_in_pre( it, "" , cx. tcx ( ) ) ,
1172+ attrs = render_attributes_in_pre( it, "" , cx) ,
11741173 name = it. name. unwrap( ) ,
11751174 generics = t. generics. print( cx) ,
11761175 where_b = print_where_clause( & t. generics, cx, 0 , Ending :: Newline ) ,
@@ -1198,7 +1197,7 @@ fn item_opaque_ty(
11981197 write ! (
11991198 w,
12001199 "{attrs}type {name}{generics}{where_clause} = impl {bounds};" ,
1201- attrs = render_attributes_in_pre( it, "" , cx. tcx ( ) ) ,
1200+ attrs = render_attributes_in_pre( it, "" , cx) ,
12021201 name = it. name. unwrap( ) ,
12031202 generics = t. generics. print( cx) ,
12041203 where_clause = print_where_clause( & t. generics, cx, 0 , Ending :: Newline ) ,
@@ -1223,7 +1222,7 @@ fn item_type_alias(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &c
12231222 write ! (
12241223 w,
12251224 "{attrs}{vis}type {name}{generics}{where_clause} = {type_};" ,
1226- attrs = render_attributes_in_pre( it, "" , cx. tcx ( ) ) ,
1225+ attrs = render_attributes_in_pre( it, "" , cx) ,
12271226 vis = visibility_print_with_space( it. visibility( cx. tcx( ) ) , it. item_id, cx) ,
12281227 name = it. name. unwrap( ) ,
12291228 generics = t. generics. print( cx) ,
@@ -1408,7 +1407,7 @@ fn item_enum(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, e: &clean::
14081407 let tcx = cx. tcx ( ) ;
14091408 let count_variants = e. variants ( ) . count ( ) ;
14101409 wrap_item ( w, |w| {
1411- render_attributes_in_code ( w, it, tcx ) ;
1410+ render_attributes_in_code ( w, it, cx ) ;
14121411 write ! (
14131412 w,
14141413 "{}enum {}{}" ,
@@ -1644,7 +1643,7 @@ fn item_primitive(w: &mut impl fmt::Write, cx: &mut Context<'_>, it: &clean::Ite
16441643fn item_constant ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , c : & clean:: Constant ) {
16451644 wrap_item ( w, |w| {
16461645 let tcx = cx. tcx ( ) ;
1647- render_attributes_in_code ( w, it, tcx ) ;
1646+ render_attributes_in_code ( w, it, cx ) ;
16481647
16491648 write ! (
16501649 w,
@@ -1693,7 +1692,7 @@ fn item_constant(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, c: &cle
16931692
16941693fn item_struct ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , s : & clean:: Struct ) {
16951694 wrap_item ( w, |w| {
1696- render_attributes_in_code ( w, it, cx. tcx ( ) ) ;
1695+ render_attributes_in_code ( w, it, cx) ;
16971696 render_struct ( w, it, Some ( & s. generics ) , s. ctor_kind , & s. fields , "" , true , cx) ;
16981697 } ) ;
16991698
@@ -1753,7 +1752,7 @@ fn item_fields(
17531752
17541753fn item_static ( w : & mut impl fmt:: Write , cx : & mut Context < ' _ > , it : & clean:: Item , s : & clean:: Static ) {
17551754 wrap_item ( w, |buffer| {
1756- render_attributes_in_code ( buffer, it, cx. tcx ( ) ) ;
1755+ render_attributes_in_code ( buffer, it, cx) ;
17571756 write ! (
17581757 buffer,
17591758 "{vis}static {mutability}{name}: {typ}" ,
@@ -1771,7 +1770,7 @@ fn item_static(w: &mut impl fmt::Write, cx: &mut Context<'_>, it: &clean::Item,
17711770fn item_foreign_type ( w : & mut impl fmt:: Write , cx : & mut Context < ' _ > , it : & clean:: Item ) {
17721771 wrap_item ( w, |buffer| {
17731772 buffer. write_str ( "extern {\n " ) . unwrap ( ) ;
1774- render_attributes_in_code ( buffer, it, cx. tcx ( ) ) ;
1773+ render_attributes_in_code ( buffer, it, cx) ;
17751774 write ! (
17761775 buffer,
17771776 " {}type {};\n }}" ,
0 commit comments