Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 7060fc8

Browse files
committed
Replace no_ord_impl with orderable.
Similar to the previous commit, this replaces `newtype_index`'s opt-out `no_ord_impl` attribute with the opt-in `orderable` attribute.
1 parent 3ef9d4d commit 7060fc8

File tree

28 files changed

+43
-4
lines changed

28 files changed

+43
-4
lines changed

compiler/rustc_ast/src/ast.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2574,6 +2574,7 @@ pub enum AttrStyle {
25742574
}
25752575

25762576
rustc_index::newtype_index! {
2577+
#[orderable]
25772578
#[debug_format = "AttrId({})"]
25782579
pub struct AttrId {}
25792580
}

compiler/rustc_ast/src/node_id.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ rustc_index::newtype_index! {
99
///
1010
/// [`DefId`]: rustc_span::def_id::DefId
1111
#[encodable]
12+
#[orderable]
1213
#[debug_format = "NodeId({})"]
1314
pub struct NodeId {
1415
/// The [`NodeId`] used to represent the root of the crate.

compiler/rustc_borrowck/src/constraints/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ rustc_index::newtype_index! {
122122
}
123123

124124
rustc_index::newtype_index! {
125+
#[orderable]
125126
#[debug_format = "ConstraintSccIndex({})"]
126127
pub struct ConstraintSccIndex {}
127128
}

compiler/rustc_borrowck/src/dataflow.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ impl_visitable! {
109109
}
110110

111111
rustc_index::newtype_index! {
112+
#[orderable]
112113
#[debug_format = "bw{}"]
113114
pub struct BorrowIndex {}
114115
}

compiler/rustc_borrowck/src/location.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub struct LocationTable {
2020
}
2121

2222
rustc_index::newtype_index! {
23+
#[orderable]
2324
#[debug_format = "LocationIndex({})"]
2425
pub struct LocationIndex {}
2526
}

compiler/rustc_borrowck/src/region_infer/values.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ impl RegionValueElements {
9090
rustc_index::newtype_index! {
9191
/// A single integer representing a `Location` in the MIR control-flow
9292
/// graph. Constructed efficiently from `RegionValueElements`.
93+
#[orderable]
9394
#[debug_format = "PointIndex({})"]
9495
pub struct PointIndex {}
9596
}

compiler/rustc_data_structures/src/graph/dominators/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ struct PreOrderFrame<Iter> {
2323
}
2424

2525
rustc_index::newtype_index! {
26+
#[orderable]
2627
struct PreorderIndex {}
2728
}
2829

compiler/rustc_hir/src/hir_id.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ rustc_index::newtype_index! {
155155
/// tree or hash map.
156156
#[derive(HashStable_Generic)]
157157
#[encodable]
158+
#[orderable]
158159
pub struct ItemLocalId {}
159160
}
160161

compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ impl<'tcx> InherentOverlapChecker<'tcx> {
198198
// entire graph when there are many connected regions.
199199

200200
rustc_index::newtype_index! {
201+
#[orderable]
201202
pub struct RegionId {}
202203
}
203204

compiler/rustc_hir_typeck/src/fn_ctxt/arg_matrix.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ use rustc_middle::ty::error::TypeError;
44
use std::cmp;
55

66
rustc_index::newtype_index! {
7+
#[orderable]
78
#[debug_format = "ExpectedIdx({})"]
89
pub(crate) struct ExpectedIdx {}
910
}
1011

1112
rustc_index::newtype_index! {
13+
#[orderable]
1214
#[debug_format = "ProvidedIdx({})"]
1315
pub(crate) struct ProvidedIdx {}
1416
}

0 commit comments

Comments
 (0)