@@ -1862,9 +1862,15 @@ macro_rules! maybe_fnptr_doc {
1862
1862
// Impls for function pointers
1863
1863
macro_rules! fnptr_impls_safety_abi {
1864
1864
( $FnTy: ty, $( $Arg: ident) ,* ) => {
1865
+ fnptr_impls_safety_abi! { #[ stable( feature = "fnptr_impls" , since = "1.4.0" ) ] $FnTy, $( $Arg) ,* }
1866
+ } ;
1867
+ ( @c_unwind $FnTy: ty, $( $Arg: ident) ,* ) => {
1868
+ fnptr_impls_safety_abi! { #[ unstable( feature = "c_unwind" , issue = "74990" ) ] $FnTy, $( $Arg) ,* }
1869
+ } ;
1870
+ ( #[ $meta: meta] $FnTy: ty, $( $Arg: ident) ,* ) => {
1865
1871
maybe_fnptr_doc! {
1866
1872
$( $Arg) * @
1867
- #[ stable ( feature = "fnptr_impls" , since = "1.4.0" ) ]
1873
+ #[ $meta ]
1868
1874
impl <Ret , $( $Arg) ,* > PartialEq for $FnTy {
1869
1875
#[ inline]
1870
1876
fn eq( & self , other: & Self ) -> bool {
@@ -1875,13 +1881,13 @@ macro_rules! fnptr_impls_safety_abi {
1875
1881
1876
1882
maybe_fnptr_doc! {
1877
1883
$( $Arg) * @
1878
- #[ stable ( feature = "fnptr_impls" , since = "1.4.0" ) ]
1884
+ #[ $meta ]
1879
1885
impl <Ret , $( $Arg) ,* > Eq for $FnTy { }
1880
1886
}
1881
1887
1882
1888
maybe_fnptr_doc! {
1883
1889
$( $Arg) * @
1884
- #[ stable ( feature = "fnptr_impls" , since = "1.4.0" ) ]
1890
+ #[ $meta ]
1885
1891
impl <Ret , $( $Arg) ,* > PartialOrd for $FnTy {
1886
1892
#[ inline]
1887
1893
fn partial_cmp( & self , other: & Self ) -> Option <Ordering > {
@@ -1892,7 +1898,7 @@ macro_rules! fnptr_impls_safety_abi {
1892
1898
1893
1899
maybe_fnptr_doc! {
1894
1900
$( $Arg) * @
1895
- #[ stable ( feature = "fnptr_impls" , since = "1.4.0" ) ]
1901
+ #[ $meta ]
1896
1902
impl <Ret , $( $Arg) ,* > Ord for $FnTy {
1897
1903
#[ inline]
1898
1904
fn cmp( & self , other: & Self ) -> Ordering {
@@ -1903,7 +1909,7 @@ macro_rules! fnptr_impls_safety_abi {
1903
1909
1904
1910
maybe_fnptr_doc! {
1905
1911
$( $Arg) * @
1906
- #[ stable ( feature = "fnptr_impls" , since = "1.4.0" ) ]
1912
+ #[ $meta ]
1907
1913
impl <Ret , $( $Arg) ,* > hash:: Hash for $FnTy {
1908
1914
fn hash<HH : hash:: Hasher >( & self , state: & mut HH ) {
1909
1915
state. write_usize( * self as usize )
@@ -1913,7 +1919,7 @@ macro_rules! fnptr_impls_safety_abi {
1913
1919
1914
1920
maybe_fnptr_doc! {
1915
1921
$( $Arg) * @
1916
- #[ stable ( feature = "fnptr_impls" , since = "1.4.0" ) ]
1922
+ #[ $meta ]
1917
1923
impl <Ret , $( $Arg) ,* > fmt:: Pointer for $FnTy {
1918
1924
fn fmt( & self , f: & mut fmt:: Formatter <' _>) -> fmt:: Result {
1919
1925
fmt:: pointer_fmt_inner( * self as usize , f)
@@ -1923,7 +1929,7 @@ macro_rules! fnptr_impls_safety_abi {
1923
1929
1924
1930
maybe_fnptr_doc! {
1925
1931
$( $Arg) * @
1926
- #[ stable ( feature = "fnptr_impls" , since = "1.4.0" ) ]
1932
+ #[ $meta ]
1927
1933
impl <Ret , $( $Arg) ,* > fmt:: Debug for $FnTy {
1928
1934
fn fmt( & self , f: & mut fmt:: Formatter <' _>) -> fmt:: Result {
1929
1935
fmt:: pointer_fmt_inner( * self as usize , f)
@@ -1938,22 +1944,22 @@ macro_rules! fnptr_impls_args {
1938
1944
fnptr_impls_safety_abi! { extern "Rust" fn ( $( $Arg) ,+) -> Ret , $( $Arg) ,+ }
1939
1945
fnptr_impls_safety_abi! { extern "C" fn ( $( $Arg) ,+) -> Ret , $( $Arg) ,+ }
1940
1946
fnptr_impls_safety_abi! { extern "C" fn ( $( $Arg) ,+ , ...) -> Ret , $( $Arg) ,+ }
1941
- fnptr_impls_safety_abi! { extern "C-unwind" fn ( $( $Arg) ,+) -> Ret , $( $Arg) ,+ }
1942
- fnptr_impls_safety_abi! { extern "C-unwind" fn ( $( $Arg) ,+ , ...) -> Ret , $( $Arg) ,+ }
1947
+ fnptr_impls_safety_abi! { @c_unwind extern "C-unwind" fn ( $( $Arg) ,+) -> Ret , $( $Arg) ,+ }
1948
+ fnptr_impls_safety_abi! { @c_unwind extern "C-unwind" fn ( $( $Arg) ,+ , ...) -> Ret , $( $Arg) ,+ }
1943
1949
fnptr_impls_safety_abi! { unsafe extern "Rust" fn ( $( $Arg) ,+) -> Ret , $( $Arg) ,+ }
1944
1950
fnptr_impls_safety_abi! { unsafe extern "C" fn ( $( $Arg) ,+) -> Ret , $( $Arg) ,+ }
1945
1951
fnptr_impls_safety_abi! { unsafe extern "C" fn ( $( $Arg) ,+ , ...) -> Ret , $( $Arg) ,+ }
1946
- fnptr_impls_safety_abi! { unsafe extern "C-unwind" fn ( $( $Arg) ,+) -> Ret , $( $Arg) ,+ }
1947
- fnptr_impls_safety_abi! { unsafe extern "C-unwind" fn ( $( $Arg) ,+ , ...) -> Ret , $( $Arg) ,+ }
1952
+ fnptr_impls_safety_abi! { @c_unwind unsafe extern "C-unwind" fn ( $( $Arg) ,+) -> Ret , $( $Arg) ,+ }
1953
+ fnptr_impls_safety_abi! { @c_unwind unsafe extern "C-unwind" fn ( $( $Arg) ,+ , ...) -> Ret , $( $Arg) ,+ }
1948
1954
} ;
1949
1955
( ) => {
1950
1956
// No variadic functions with 0 parameters
1951
1957
fnptr_impls_safety_abi! { extern "Rust" fn ( ) -> Ret , }
1952
1958
fnptr_impls_safety_abi! { extern "C" fn ( ) -> Ret , }
1953
- fnptr_impls_safety_abi! { extern "C-unwind" fn ( ) -> Ret , }
1959
+ fnptr_impls_safety_abi! { @c_unwind extern "C-unwind" fn ( ) -> Ret , }
1954
1960
fnptr_impls_safety_abi! { unsafe extern "Rust" fn ( ) -> Ret , }
1955
1961
fnptr_impls_safety_abi! { unsafe extern "C" fn ( ) -> Ret , }
1956
- fnptr_impls_safety_abi! { unsafe extern "C-unwind" fn ( ) -> Ret , }
1962
+ fnptr_impls_safety_abi! { @c_unwind unsafe extern "C-unwind" fn ( ) -> Ret , }
1957
1963
} ;
1958
1964
}
1959
1965
0 commit comments