@@ -120,8 +120,7 @@ macro_rules! item_template_methods {
120120 fn render_attributes_in_pre<' b>( & ' b self ) -> impl fmt:: Display + Captures <' a> + ' b + Captures <' cx> {
121121 display_fn( move |f| {
122122 let ( item, cx) = self . item_and_mut_cx( ) ;
123- let tcx = cx. tcx( ) ;
124- let v = render_attributes_in_pre( item, "" , tcx) ;
123+ let v = render_attributes_in_pre( item, "" , & cx) ;
125124 write!( f, "{v}" )
126125 } )
127126 }
@@ -659,7 +658,7 @@ fn item_function(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, f: &cle
659658 w,
660659 "{attrs}{vis}{constness}{asyncness}{unsafety}{abi}fn \
661660 {name}{generics}{decl}{notable_traits}{where_clause}",
662- attrs = render_attributes_in_pre( it, "" , tcx ) ,
661+ attrs = render_attributes_in_pre( it, "" , cx ) ,
663662 vis = visibility,
664663 constness = constness,
665664 asyncness = asyncness,
@@ -694,7 +693,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
694693 write ! (
695694 w,
696695 "{attrs}{vis}{unsafety}{is_auto}trait {name}{generics}{bounds}" ,
697- attrs = render_attributes_in_pre( it, "" , tcx ) ,
696+ attrs = render_attributes_in_pre( it, "" , cx ) ,
698697 vis = visibility_print_with_space( it. visibility( tcx) , it. item_id, cx) ,
699698 unsafety = t. unsafety( tcx) . print_with_space( ) ,
700699 is_auto = if t. is_auto( tcx) { "auto " } else { "" } ,
@@ -1173,7 +1172,7 @@ fn item_trait_alias(
11731172 write ! (
11741173 w,
11751174 "{attrs}trait {name}{generics}{where_b} = {bounds};" ,
1176- attrs = render_attributes_in_pre( it, "" , cx. tcx ( ) ) ,
1175+ attrs = render_attributes_in_pre( it, "" , cx) ,
11771176 name = it. name. unwrap( ) ,
11781177 generics = t. generics. print( cx) ,
11791178 where_b = print_where_clause( & t. generics, cx, 0 , Ending :: Newline ) ,
@@ -1201,7 +1200,7 @@ fn item_opaque_ty(
12011200 write ! (
12021201 w,
12031202 "{attrs}type {name}{generics}{where_clause} = impl {bounds};" ,
1204- attrs = render_attributes_in_pre( it, "" , cx. tcx ( ) ) ,
1203+ attrs = render_attributes_in_pre( it, "" , cx) ,
12051204 name = it. name. unwrap( ) ,
12061205 generics = t. generics. print( cx) ,
12071206 where_clause = print_where_clause( & t. generics, cx, 0 , Ending :: Newline ) ,
@@ -1226,7 +1225,7 @@ fn item_type_alias(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &c
12261225 write ! (
12271226 w,
12281227 "{attrs}{vis}type {name}{generics}{where_clause} = {type_};" ,
1229- attrs = render_attributes_in_pre( it, "" , cx. tcx ( ) ) ,
1228+ attrs = render_attributes_in_pre( it, "" , cx) ,
12301229 vis = visibility_print_with_space( it. visibility( cx. tcx( ) ) , it. item_id, cx) ,
12311230 name = it. name. unwrap( ) ,
12321231 generics = t. generics. print( cx) ,
@@ -1415,7 +1414,7 @@ fn item_enum(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, e: &clean::
14151414 let tcx = cx. tcx ( ) ;
14161415 let count_variants = e. variants ( ) . count ( ) ;
14171416 wrap_item ( w, |w| {
1418- render_attributes_in_code ( w, it, tcx ) ;
1417+ render_attributes_in_code ( w, it, cx ) ;
14191418 write ! (
14201419 w,
14211420 "{}enum {}{}" ,
@@ -1734,7 +1733,7 @@ fn item_primitive(w: &mut impl fmt::Write, cx: &mut Context<'_>, it: &clean::Ite
17341733fn item_constant ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , c : & clean:: Constant ) {
17351734 wrap_item ( w, |w| {
17361735 let tcx = cx. tcx ( ) ;
1737- render_attributes_in_code ( w, it, tcx ) ;
1736+ render_attributes_in_code ( w, it, cx ) ;
17381737
17391738 write ! (
17401739 w,
@@ -1783,7 +1782,7 @@ fn item_constant(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, c: &cle
17831782
17841783fn item_struct ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , s : & clean:: Struct ) {
17851784 wrap_item ( w, |w| {
1786- render_attributes_in_code ( w, it, cx. tcx ( ) ) ;
1785+ render_attributes_in_code ( w, it, cx) ;
17871786 render_struct ( w, it, Some ( & s. generics ) , s. ctor_kind , & s. fields , "" , true , cx) ;
17881787 } ) ;
17891788
@@ -1843,7 +1842,7 @@ fn item_fields(
18431842
18441843fn item_static ( w : & mut impl fmt:: Write , cx : & mut Context < ' _ > , it : & clean:: Item , s : & clean:: Static ) {
18451844 wrap_item ( w, |buffer| {
1846- render_attributes_in_code ( buffer, it, cx. tcx ( ) ) ;
1845+ render_attributes_in_code ( buffer, it, cx) ;
18471846 write ! (
18481847 buffer,
18491848 "{vis}static {mutability}{name}: {typ}" ,
@@ -1861,7 +1860,7 @@ fn item_static(w: &mut impl fmt::Write, cx: &mut Context<'_>, it: &clean::Item,
18611860fn item_foreign_type ( w : & mut impl fmt:: Write , cx : & mut Context < ' _ > , it : & clean:: Item ) {
18621861 wrap_item ( w, |buffer| {
18631862 buffer. write_str ( "extern {\n " ) . unwrap ( ) ;
1864- render_attributes_in_code ( buffer, it, cx. tcx ( ) ) ;
1863+ render_attributes_in_code ( buffer, it, cx) ;
18651864 write ! (
18661865 buffer,
18671866 " {}type {};\n }}" ,
0 commit comments