@@ -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) ,
@@ -1333,7 +1332,7 @@ fn item_enum(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, e: &clean::
13331332 let tcx = cx. tcx ( ) ;
13341333 let count_variants = e. variants ( ) . count ( ) ;
13351334 wrap_item ( w, |mut w| {
1336- render_attributes_in_code ( w, it, tcx ) ;
1335+ render_attributes_in_code ( w, it, cx ) ;
13371336 write ! (
13381337 w,
13391338 "{}enum {}{}" ,
@@ -1538,7 +1537,7 @@ fn item_primitive(w: &mut impl fmt::Write, cx: &mut Context<'_>, it: &clean::Ite
15381537fn item_constant ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , c : & clean:: Constant ) {
15391538 wrap_item ( w, |w| {
15401539 let tcx = cx. tcx ( ) ;
1541- render_attributes_in_code ( w, it, tcx ) ;
1540+ render_attributes_in_code ( w, it, cx ) ;
15421541
15431542 write ! (
15441543 w,
@@ -1587,7 +1586,7 @@ fn item_constant(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, c: &cle
15871586
15881587fn item_struct ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , s : & clean:: Struct ) {
15891588 wrap_item ( w, |w| {
1590- render_attributes_in_code ( w, it, cx. tcx ( ) ) ;
1589+ render_attributes_in_code ( w, it, cx) ;
15911590 render_struct ( w, it, Some ( & s. generics ) , s. ctor_kind , & s. fields , "" , true , cx) ;
15921591 } ) ;
15931592
@@ -1637,7 +1636,7 @@ fn item_struct(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean
16371636
16381637fn item_static ( w : & mut impl fmt:: Write , cx : & mut Context < ' _ > , it : & clean:: Item , s : & clean:: Static ) {
16391638 wrap_item ( w, |buffer| {
1640- render_attributes_in_code ( buffer, it, cx. tcx ( ) ) ;
1639+ render_attributes_in_code ( buffer, it, cx) ;
16411640 write ! (
16421641 buffer,
16431642 "{vis}static {mutability}{name}: {typ}" ,
@@ -1655,7 +1654,7 @@ fn item_static(w: &mut impl fmt::Write, cx: &mut Context<'_>, it: &clean::Item,
16551654fn item_foreign_type ( w : & mut impl fmt:: Write , cx : & mut Context < ' _ > , it : & clean:: Item ) {
16561655 wrap_item ( w, |buffer| {
16571656 buffer. write_str ( "extern {\n " ) . unwrap ( ) ;
1658- render_attributes_in_code ( buffer, it, cx. tcx ( ) ) ;
1657+ render_attributes_in_code ( buffer, it, cx) ;
16591658 write ! (
16601659 buffer,
16611660 " {}type {};\n }}" ,
0 commit comments