diff options
| author | clubby789 <jamie@hill-daniel.co.uk> | 2024-03-05 13:26:47 +0000 |
|---|---|---|
| committer | clubby789 <jamie@hill-daniel.co.uk> | 2024-03-19 16:32:01 +0000 |
| commit | 5f254d8b66f995eaeb5316b2e26ca507ebd5d0c4 (patch) | |
| tree | 5b6f58fb1f7b8052dd3b356a176a5e13c9a83a15 /compiler/rustc_index_macros | |
| parent | f296c162d8c6f84bcfee99c152d4fd63aaef3e38 (diff) | |
| download | rust-5f254d8b66f995eaeb5316b2e26ca507ebd5d0c4.tar.gz rust-5f254d8b66f995eaeb5316b2e26ca507ebd5d0c4.zip | |
Remove `SpecOptionPartialEq`
Diffstat (limited to 'compiler/rustc_index_macros')
| -rw-r--r-- | compiler/rustc_index_macros/src/lib.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_index_macros/src/newtype.rs | 28 |
2 files changed, 1 insertions, 35 deletions
diff --git a/compiler/rustc_index_macros/src/lib.rs b/compiler/rustc_index_macros/src/lib.rs index 532cac5791e..015518ae4d6 100644 --- a/compiler/rustc_index_macros/src/lib.rs +++ b/compiler/rustc_index_macros/src/lib.rs @@ -34,13 +34,7 @@ mod newtype; #[proc_macro] #[cfg_attr( feature = "nightly", - allow_internal_unstable( - step_trait, - rustc_attrs, - trusted_step, - spec_option_partial_eq, - min_specialization - ) + allow_internal_unstable(step_trait, rustc_attrs, trusted_step, min_specialization) )] pub fn newtype_index(input: TokenStream) -> TokenStream { newtype::newtype(input) diff --git a/compiler/rustc_index_macros/src/newtype.rs b/compiler/rustc_index_macros/src/newtype.rs index 0b25628b9e1..e5c2ba42483 100644 --- a/compiler/rustc_index_macros/src/newtype.rs +++ b/compiler/rustc_index_macros/src/newtype.rs @@ -156,32 +156,6 @@ impl Parse for Newtype { } }; - let spec_partial_eq_impl = if let Lit::Int(max) = &max { - if let Ok(max_val) = max.base10_parse::<u32>() { - quote! { - #gate_rustc_only - impl core::option::SpecOptionPartialEq for #name { - #[inline] - fn eq(l: &Option<Self>, r: &Option<Self>) -> bool { - if #max_val < u32::MAX { - l.map(|i| i.as_u32()).unwrap_or(#max_val+1) == r.map(|i| i.as_u32()).unwrap_or(#max_val+1) - } else { - match (l, r) { - (Some(l), Some(r)) => r == l, - (None, None) => true, - _ => false - } - } - } - } - } - } else { - quote! {} - } - } else { - quote! {} - }; - Ok(Self(quote! { #(#attrs)* #[derive(Clone, Copy, PartialEq, Eq, Hash, #(#derive_paths),*)] @@ -283,8 +257,6 @@ impl Parse for Newtype { #step - #spec_partial_eq_impl - impl From<#name> for u32 { #[inline] fn from(v: #name) -> u32 { |
