Skip to content

Commit 9342994

Browse files
committed
Make #[no_ord_impl] an attribute in newtype_index
1 parent 88d5f7f commit 9342994

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

compiler/rustc_macros/src/newtype.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ mod kw {
77
syn::custom_keyword!(DEBUG_FORMAT);
88
syn::custom_keyword!(MAX);
99
syn::custom_keyword!(custom);
10-
syn::custom_keyword!(ORD_IMPL);
1110
}
1211

1312
#[derive(Debug)]
@@ -56,6 +55,10 @@ impl Parse for Newtype {
5655
encodable = false;
5756
false
5857
}
58+
"no_ord_impl" => {
59+
ord = false;
60+
false
61+
}
5962
_ => true,
6063
},
6164
_ => true,
@@ -91,13 +94,6 @@ impl Parse for Newtype {
9194
}
9295
continue;
9396
}
94-
if body.lookahead1().peek(kw::ORD_IMPL) {
95-
body.parse::<kw::ORD_IMPL>()?;
96-
body.parse::<Token![=]>()?;
97-
body.parse::<kw::custom>()?;
98-
ord = false;
99-
continue;
100-
}
10197

10298
// We've parsed everything that the user provided, so we're done
10399
if body.is_empty() {

compiler/rustc_span/src/hygiene.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ impl fmt::Debug for ExpnId {
8383
rustc_index::newtype_index! {
8484
/// A unique ID associated with a macro invocation and expansion.
8585
#[custom_encodable]
86+
#[no_ord_impl]
8687
pub struct LocalExpnId {
87-
ORD_IMPL = custom
8888
DEBUG_FORMAT = "expn{}"
8989
}
9090
}

0 commit comments

Comments
 (0)