@@ -120,7 +120,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
120120 mixed_export_name_no_mangle_lint_state. track_no_mangle (
121121 attr. span ,
122122 tcx. local_def_id_to_hir_id ( did) ,
123- rustc_ast_pretty :: pprust :: attribute_to_string ( attr) ,
123+ attr,
124124 ) ;
125125 } else {
126126 tcx. dcx ( )
@@ -788,22 +788,22 @@ fn check_link_name_xor_ordinal(
788788}
789789
790790#[ derive( Default ) ]
791- struct MixedExportNameAndNoMangleState {
791+ struct MixedExportNameAndNoMangleState < ' a > {
792792 export_name : Option < Span > ,
793793 hir_id : Option < HirId > ,
794794 no_mangle : Option < Span > ,
795- no_mangle_attr_name : Option < String > ,
795+ no_mangle_attr : Option < & ' a ast :: Attribute > ,
796796}
797797
798- impl MixedExportNameAndNoMangleState {
798+ impl < ' a > MixedExportNameAndNoMangleState < ' a > {
799799 fn track_export_name ( & mut self , span : Span ) {
800800 self . export_name = Some ( span) ;
801801 }
802802
803- fn track_no_mangle ( & mut self , span : Span , hir_id : HirId , attr_name : String ) {
803+ fn track_no_mangle ( & mut self , span : Span , hir_id : HirId , attr_name : & ' a ast :: Attribute ) {
804804 self . no_mangle = Some ( span) ;
805805 self . hir_id = Some ( hir_id) ;
806- self . no_mangle_attr_name = Some ( attr_name) ;
806+ self . no_mangle_attr = Some ( attr_name) ;
807807 }
808808
809809 /// Emit diagnostics if the lint condition is met.
@@ -812,7 +812,7 @@ impl MixedExportNameAndNoMangleState {
812812 export_name : Some ( export_name) ,
813813 no_mangle : Some ( no_mangle) ,
814814 hir_id : Some ( hir_id) ,
815- no_mangle_attr_name : Some ( no_mangle_attr_name ) ,
815+ no_mangle_attr : Some ( no_mangle_attr ) ,
816816 } = self
817817 {
818818 tcx. emit_node_span_lint (
@@ -821,7 +821,7 @@ impl MixedExportNameAndNoMangleState {
821821 no_mangle,
822822 errors:: MixedExportNameAndNoMangle {
823823 no_mangle,
824- no_mangle_attr : no_mangle_attr_name ,
824+ no_mangle_attr : rustc_ast_pretty :: pprust :: attribute_to_string ( no_mangle_attr ) ,
825825 export_name,
826826 removal_span : no_mangle,
827827 } ,
0 commit comments