diff --git a/compiler/rustc_macros/src/newtype.rs b/compiler/rustc_macros/src/newtype.rs index 2e28e9fb49d..59cedef08ea 100644 --- a/compiler/rustc_macros/src/newtype.rs +++ b/compiler/rustc_macros/src/newtype.rs @@ -7,7 +7,6 @@ mod kw { syn::custom_keyword!(DEBUG_FORMAT); syn::custom_keyword!(MAX); syn::custom_keyword!(custom); - syn::custom_keyword!(ORD_IMPL); } #[derive(Debug)] @@ -56,6 +55,10 @@ impl Parse for Newtype { encodable = false; false } + "no_ord_impl" => { + ord = false; + false + } _ => true, }, _ => true, @@ -91,13 +94,6 @@ impl Parse for Newtype { } continue; } - if body.lookahead1().peek(kw::ORD_IMPL) { - body.parse::()?; - body.parse::()?; - body.parse::()?; - ord = false; - continue; - } // We've parsed everything that the user provided, so we're done if body.is_empty() { diff --git a/compiler/rustc_span/src/hygiene.rs b/compiler/rustc_span/src/hygiene.rs index 4fb56dac856..2de559c5a70 100644 --- a/compiler/rustc_span/src/hygiene.rs +++ b/compiler/rustc_span/src/hygiene.rs @@ -83,8 +83,8 @@ impl fmt::Debug for ExpnId { rustc_index::newtype_index! { /// A unique ID associated with a macro invocation and expansion. #[custom_encodable] + #[no_ord_impl] pub struct LocalExpnId { - ORD_IMPL = custom DEBUG_FORMAT = "expn{}" } }