Skip to content

Commit 9a96a6d

Browse files
authored
Rollup merge of #104933 - RalfJung:interpret-partial-ord, r=oli-obk
interpret: remove PartialOrd from a bunch of types that do not have or need a sensible order r? `@oli-obk`
2 parents 069f219 + 77071f7 commit 9a96a6d

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

compiler/rustc_middle/src/mir/interpret/allocation.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub use init_mask::{InitChunk, InitChunkIter};
3636
/// module provides higher-level access.
3737
// Note: for performance reasons when interning, some of the `Allocation` fields can be partially
3838
// hashed. (see the `Hash` impl below for more details), so the impl is not derived.
39-
#[derive(Clone, Eq, PartialEq, PartialOrd, Ord, TyEncodable, TyDecodable)]
39+
#[derive(Clone, Eq, PartialEq, TyEncodable, TyDecodable)]
4040
#[derive(HashStable)]
4141
pub struct Allocation<Prov: Provenance = AllocId, Extra = ()> {
4242
/// The actual bytes of the allocation.
@@ -108,7 +108,7 @@ impl hash::Hash for Allocation {
108108
/// Here things are different because only const allocations are interned. This
109109
/// means that both the inner type (`Allocation`) and the outer type
110110
/// (`ConstAllocation`) are used quite a bit.
111-
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, HashStable)]
111+
#[derive(Copy, Clone, PartialEq, Eq, Hash, HashStable)]
112112
#[rustc_pass_by_value]
113113
pub struct ConstAllocation<'tcx>(pub Interned<'tcx, Allocation>);
114114

compiler/rustc_middle/src/mir/interpret/allocation/init_mask.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type Block = u64;
1212
/// is initialized. If it is `false` the byte is uninitialized.
1313
// Note: for performance reasons when interning, some of the `InitMask` fields can be partially
1414
// hashed. (see the `Hash` impl below for more details), so the impl is not derived.
15-
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord, TyEncodable, TyDecodable)]
15+
#[derive(Clone, Debug, Eq, PartialEq, TyEncodable, TyDecodable)]
1616
#[derive(HashStable)]
1717
pub struct InitMask {
1818
blocks: Vec<Block>,

compiler/rustc_middle/src/mir/interpret/allocation/provenance_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use super::{alloc_range, AllocError, AllocId, AllocRange, AllocResult, Provenanc
1010
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
1111

1212
/// Stores the provenance information of pointers stored in memory.
13-
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
13+
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
1414
#[derive(HashStable)]
1515
pub struct ProvenanceMap<Prov = AllocId> {
1616
/// Provenance in this map applies from the given offset for an entire pointer-size worth of

compiler/rustc_middle/src/mir/interpret/pointer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl Provenance for AllocId {
173173
/// Represents a pointer in the Miri engine.
174174
///
175175
/// Pointers are "tagged" with provenance information; typically the `AllocId` they belong to.
176-
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, TyEncodable, TyDecodable, Hash)]
176+
#[derive(Copy, Clone, Eq, PartialEq, TyEncodable, TyDecodable, Hash)]
177177
#[derive(HashStable)]
178178
pub struct Pointer<Prov = AllocId> {
179179
pub(super) offset: Size, // kept private to avoid accidental misinterpretation (meaning depends on `Prov` type)

compiler/rustc_middle/src/mir/interpret/value.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub struct ConstAlloc<'tcx> {
2828

2929
/// Represents a constant value in Rust. `Scalar` and `Slice` are optimizations for
3030
/// array length computations, enum discriminants and the pattern matching logic.
31-
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord, TyEncodable, TyDecodable, Hash)]
31+
#[derive(Copy, Clone, Debug, Eq, PartialEq, TyEncodable, TyDecodable, Hash)]
3232
#[derive(HashStable, Lift)]
3333
pub enum ConstValue<'tcx> {
3434
/// Used only for types with `layout::abi::Scalar` ABI.
@@ -110,7 +110,7 @@ impl<'tcx> ConstValue<'tcx> {
110110
///
111111
/// These variants would be private if there was a convenient way to achieve that in Rust.
112112
/// Do *not* match on a `Scalar`! Use the various `to_*` methods instead.
113-
#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, TyEncodable, TyDecodable, Hash)]
113+
#[derive(Clone, Copy, Eq, PartialEq, TyEncodable, TyDecodable, Hash)]
114114
#[derive(HashStable)]
115115
pub enum Scalar<Prov = AllocId> {
116116
/// The raw bytes of a simple value.

src/tools/miri/src/concurrency/data_race.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ impl ThreadClockSet {
158158

159159
/// Error returned by finding a data race
160160
/// should be elaborated upon.
161-
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
161+
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
162162
pub struct DataRace;
163163

164164
/// Externally stored memory cell clocks

0 commit comments

Comments
 (0)