@@ -120,7 +120,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
120
120
mixed_export_name_no_mangle_lint_state. track_no_mangle (
121
121
attr. span ,
122
122
tcx. local_def_id_to_hir_id ( did) ,
123
- rustc_ast_pretty :: pprust :: attribute_to_string ( attr) ,
123
+ attr,
124
124
) ;
125
125
} else {
126
126
tcx. dcx ( )
@@ -788,22 +788,22 @@ fn check_link_name_xor_ordinal(
788
788
}
789
789
790
790
#[ derive( Default ) ]
791
- struct MixedExportNameAndNoMangleState {
791
+ struct MixedExportNameAndNoMangleState < ' a > {
792
792
export_name : Option < Span > ,
793
793
hir_id : Option < HirId > ,
794
794
no_mangle : Option < Span > ,
795
- no_mangle_attr_name : Option < String > ,
795
+ no_mangle_attr : Option < & ' a ast :: Attribute > ,
796
796
}
797
797
798
- impl MixedExportNameAndNoMangleState {
798
+ impl < ' a > MixedExportNameAndNoMangleState < ' a > {
799
799
fn track_export_name ( & mut self , span : Span ) {
800
800
self . export_name = Some ( span) ;
801
801
}
802
802
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 ) {
804
804
self . no_mangle = Some ( span) ;
805
805
self . hir_id = Some ( hir_id) ;
806
- self . no_mangle_attr_name = Some ( attr_name) ;
806
+ self . no_mangle_attr = Some ( attr_name) ;
807
807
}
808
808
809
809
/// Emit diagnostics if the lint condition is met.
@@ -812,7 +812,7 @@ impl MixedExportNameAndNoMangleState {
812
812
export_name : Some ( export_name) ,
813
813
no_mangle : Some ( no_mangle) ,
814
814
hir_id : Some ( hir_id) ,
815
- no_mangle_attr_name : Some ( no_mangle_attr_name ) ,
815
+ no_mangle_attr : Some ( no_mangle_attr ) ,
816
816
} = self
817
817
{
818
818
tcx. emit_node_span_lint (
@@ -821,7 +821,7 @@ impl MixedExportNameAndNoMangleState {
821
821
no_mangle,
822
822
errors:: MixedExportNameAndNoMangle {
823
823
no_mangle,
824
- no_mangle_attr : no_mangle_attr_name ,
824
+ no_mangle_attr : rustc_ast_pretty :: pprust :: attribute_to_string ( no_mangle_attr ) ,
825
825
export_name,
826
826
removal_span : no_mangle,
827
827
} ,
0 commit comments