mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
interpret: remove PartialOrd from a bunch of types that do not have or need a sensible order
This commit is contained in:
parent
f8a2e491eb
commit
77071f7e3a
@ -36,7 +36,7 @@ pub use init_mask::{InitChunk, InitChunkIter};
|
||||
/// module provides higher-level access.
|
||||
// Note: for performance reasons when interning, some of the `Allocation` fields can be partially
|
||||
// hashed. (see the `Hash` impl below for more details), so the impl is not derived.
|
||||
#[derive(Clone, Eq, PartialEq, PartialOrd, Ord, TyEncodable, TyDecodable)]
|
||||
#[derive(Clone, Eq, PartialEq, TyEncodable, TyDecodable)]
|
||||
#[derive(HashStable)]
|
||||
pub struct Allocation<Prov: Provenance = AllocId, Extra = ()> {
|
||||
/// The actual bytes of the allocation.
|
||||
@ -108,7 +108,7 @@ impl hash::Hash for Allocation {
|
||||
/// Here things are different because only const allocations are interned. This
|
||||
/// means that both the inner type (`Allocation`) and the outer type
|
||||
/// (`ConstAllocation`) are used quite a bit.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, HashStable)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, HashStable)]
|
||||
#[rustc_pass_by_value]
|
||||
pub struct ConstAllocation<'tcx>(pub Interned<'tcx, Allocation>);
|
||||
|
||||
|
@ -12,7 +12,7 @@ type Block = u64;
|
||||
/// is initialized. If it is `false` the byte is uninitialized.
|
||||
// Note: for performance reasons when interning, some of the `InitMask` fields can be partially
|
||||
// hashed. (see the `Hash` impl below for more details), so the impl is not derived.
|
||||
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord, TyEncodable, TyDecodable)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq, TyEncodable, TyDecodable)]
|
||||
#[derive(HashStable)]
|
||||
pub struct InitMask {
|
||||
blocks: Vec<Block>,
|
||||
|
@ -10,7 +10,7 @@ use super::{alloc_range, AllocError, AllocId, AllocRange, AllocResult, Provenanc
|
||||
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
|
||||
|
||||
/// Stores the provenance information of pointers stored in memory.
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
|
||||
#[derive(HashStable)]
|
||||
pub struct ProvenanceMap<Prov = AllocId> {
|
||||
/// Provenance in this map applies from the given offset for an entire pointer-size worth of
|
||||
|
@ -173,7 +173,7 @@ impl Provenance for AllocId {
|
||||
/// Represents a pointer in the Miri engine.
|
||||
///
|
||||
/// Pointers are "tagged" with provenance information; typically the `AllocId` they belong to.
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, TyEncodable, TyDecodable, Hash)]
|
||||
#[derive(Copy, Clone, Eq, PartialEq, TyEncodable, TyDecodable, Hash)]
|
||||
#[derive(HashStable)]
|
||||
pub struct Pointer<Prov = AllocId> {
|
||||
pub(super) offset: Size, // kept private to avoid accidental misinterpretation (meaning depends on `Prov` type)
|
||||
|
@ -28,7 +28,7 @@ pub struct ConstAlloc<'tcx> {
|
||||
|
||||
/// Represents a constant value in Rust. `Scalar` and `Slice` are optimizations for
|
||||
/// array length computations, enum discriminants and the pattern matching logic.
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord, TyEncodable, TyDecodable, Hash)]
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, TyEncodable, TyDecodable, Hash)]
|
||||
#[derive(HashStable, Lift)]
|
||||
pub enum ConstValue<'tcx> {
|
||||
/// Used only for types with `layout::abi::Scalar` ABI.
|
||||
@ -110,7 +110,7 @@ impl<'tcx> ConstValue<'tcx> {
|
||||
///
|
||||
/// These variants would be private if there was a convenient way to achieve that in Rust.
|
||||
/// Do *not* match on a `Scalar`! Use the various `to_*` methods instead.
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, TyEncodable, TyDecodable, Hash)]
|
||||
#[derive(Clone, Copy, Eq, PartialEq, TyEncodable, TyDecodable, Hash)]
|
||||
#[derive(HashStable)]
|
||||
pub enum Scalar<Prov = AllocId> {
|
||||
/// The raw bytes of a simple value.
|
||||
|
@ -158,7 +158,7 @@ impl ThreadClockSet {
|
||||
|
||||
/// Error returned by finding a data race
|
||||
/// should be elaborated upon.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
|
||||
pub struct DataRace;
|
||||
|
||||
/// Externally stored memory cell clocks
|
||||
|
Loading…
Reference in New Issue
Block a user