@@ -1816,14 +1816,14 @@ pub(crate) enum AmbiguousWidePointerComparisonsAddrSuggestion<'a> {
1816
1816
}
1817
1817
1818
1818
#[ derive( LintDiagnostic ) ]
1819
- pub ( crate ) enum UnpredictableFunctionPointerComparisons < ' a > {
1819
+ pub ( crate ) enum UnpredictableFunctionPointerComparisons < ' a , ' tcx > {
1820
1820
#[ diag( lint_unpredictable_fn_pointer_comparisons) ]
1821
1821
#[ note( lint_note_duplicated_fn) ]
1822
1822
#[ note( lint_note_deduplicated_fn) ]
1823
1823
#[ note( lint_note_visit_fn_addr_eq) ]
1824
1824
Suggestion {
1825
1825
#[ subdiagnostic]
1826
- sugg : UnpredictableFunctionPointerComparisonsSuggestion < ' a > ,
1826
+ sugg : UnpredictableFunctionPointerComparisonsSuggestion < ' a , ' tcx > ,
1827
1827
} ,
1828
1828
#[ diag( lint_unpredictable_fn_pointer_comparisons) ]
1829
1829
#[ note( lint_note_duplicated_fn) ]
@@ -1833,22 +1833,40 @@ pub(crate) enum UnpredictableFunctionPointerComparisons<'a> {
1833
1833
}
1834
1834
1835
1835
#[ derive( Subdiagnostic ) ]
1836
- #[ multipart_suggestion(
1837
- lint_fn_addr_eq_suggestion,
1838
- style = "verbose" ,
1839
- applicability = "maybe-incorrect"
1840
- ) ]
1841
- pub ( crate ) struct UnpredictableFunctionPointerComparisonsSuggestion < ' a > {
1842
- pub ne : & ' a str ,
1843
- pub cast_right : String ,
1844
- pub deref_left : & ' a str ,
1845
- pub deref_right : & ' a str ,
1846
- #[ suggestion_part( code = "{ne}std::ptr::fn_addr_eq({deref_left}" ) ]
1847
- pub left : Span ,
1848
- #[ suggestion_part( code = ", {deref_right}" ) ]
1849
- pub middle : Span ,
1850
- #[ suggestion_part( code = "{cast_right})" ) ]
1851
- pub right : Span ,
1836
+ pub ( crate ) enum UnpredictableFunctionPointerComparisonsSuggestion < ' a , ' tcx > {
1837
+ #[ multipart_suggestion(
1838
+ lint_fn_addr_eq_suggestion,
1839
+ style = "verbose" ,
1840
+ applicability = "maybe-incorrect"
1841
+ ) ]
1842
+ FnAddrEq {
1843
+ ne : & ' a str ,
1844
+ deref_left : & ' a str ,
1845
+ deref_right : & ' a str ,
1846
+ #[ suggestion_part( code = "{ne}std::ptr::fn_addr_eq({deref_left}" ) ]
1847
+ left : Span ,
1848
+ #[ suggestion_part( code = ", {deref_right}" ) ]
1849
+ middle : Span ,
1850
+ #[ suggestion_part( code = ")" ) ]
1851
+ right : Span ,
1852
+ } ,
1853
+ #[ multipart_suggestion(
1854
+ lint_fn_addr_eq_suggestion,
1855
+ style = "verbose" ,
1856
+ applicability = "maybe-incorrect"
1857
+ ) ]
1858
+ FnAddrEqWithCast {
1859
+ ne : & ' a str ,
1860
+ deref_left : & ' a str ,
1861
+ deref_right : & ' a str ,
1862
+ fn_sig : rustc_middle:: ty:: PolyFnSig < ' tcx > ,
1863
+ #[ suggestion_part( code = "{ne}std::ptr::fn_addr_eq({deref_left}" ) ]
1864
+ left : Span ,
1865
+ #[ suggestion_part( code = ", {deref_right}" ) ]
1866
+ middle : Span ,
1867
+ #[ suggestion_part( code = " as {fn_sig})" ) ]
1868
+ right : Span ,
1869
+ } ,
1852
1870
}
1853
1871
1854
1872
pub ( crate ) struct ImproperCTypes < ' a > {
0 commit comments