Skip to content

Commit bdc865d

Browse files
committed
remove unnecessary PartialOrd and Ord
1 parent b44197a commit bdc865d

File tree

7 files changed

+7
-27
lines changed

7 files changed

+7
-27
lines changed

compiler/rustc_borrowck/src/region_infer/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ pub struct RegionInferenceContext<'tcx> {
135135
/// adds a new lower bound to the SCC it is analyzing: so you wind up
136136
/// with `'R: 'O` where `'R` is the pick-region and `'O` is the
137137
/// minimal viable option.
138-
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
139138
pub(crate) struct AppliedMemberConstraint {
140139
/// The SCC that was affected. (The "member region".)
141140
///

compiler/rustc_errors/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ struct HandlerInner {
456456
}
457457

458458
/// A key denoting where from a diagnostic was stashed.
459-
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
459+
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
460460
pub enum StashKey {
461461
ItemNoType,
462462
UnderscoreForArrayLengths,

compiler/rustc_hir/src/def.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ impl PartialRes {
457457

458458
/// Different kinds of symbols can coexist even if they share the same textual name.
459459
/// Therefore, they each have a separate universe (known as a "namespace").
460-
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
460+
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
461461
pub enum Namespace {
462462
/// The type namespace includes `struct`s, `enum`s, `union`s, `trait`s, and `mod`s
463463
/// (and, by extension, crates).

compiler/rustc_lexer/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub enum TokenKind {
141141
Unknown,
142142
}
143143

144-
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
144+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
145145
pub enum DocStyle {
146146
Outer,
147147
Inner,

compiler/rustc_middle/src/mir/syntax.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ pub enum TerminatorKind<'tcx> {
705705
}
706706

707707
/// Information about an assertion failure.
708-
#[derive(Clone, TyEncodable, TyDecodable, Hash, HashStable, PartialEq, PartialOrd)]
708+
#[derive(Clone, TyEncodable, TyDecodable, Hash, HashStable, PartialEq)]
709709
pub enum AssertKind<O> {
710710
BoundsCheck { len: O, index: O },
711711
Overflow(BinOp, O, O),

compiler/rustc_middle/src/mir/terminator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::slice;
1414

1515
pub use super::query::*;
1616

17-
#[derive(Debug, Clone, TyEncodable, TyDecodable, Hash, HashStable, PartialEq, PartialOrd)]
17+
#[derive(Debug, Clone, TyEncodable, TyDecodable, Hash, HashStable, PartialEq)]
1818
pub struct SwitchTargets {
1919
/// Possible values. The locations to branch to in each case
2020
/// are found in the corresponding indices from the `targets` vector.

compiler/rustc_resolve/src/lib.rs

+2-21
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ use rustc_span::{Span, DUMMY_SP};
5757
use smallvec::{smallvec, SmallVec};
5858
use std::cell::{Cell, RefCell};
5959
use std::collections::BTreeSet;
60-
use std::{cmp, fmt, ptr};
60+
use std::{fmt, ptr};
6161

6262
use diagnostics::{ImportSuggestion, LabelSuggestion, Suggestion};
6363
use imports::{Import, ImportKind, ImportResolver, NameResolution};
@@ -163,32 +163,13 @@ enum ImplTraitContext {
163163
Universal(LocalDefId),
164164
}
165165

166-
#[derive(Eq)]
167166
struct BindingError {
168167
name: Symbol,
169168
origin: BTreeSet<Span>,
170169
target: BTreeSet<Span>,
171170
could_be_path: bool,
172171
}
173172

174-
impl PartialOrd for BindingError {
175-
fn partial_cmp(&self, other: &BindingError) -> Option<cmp::Ordering> {
176-
Some(self.cmp(other))
177-
}
178-
}
179-
180-
impl PartialEq for BindingError {
181-
fn eq(&self, other: &BindingError) -> bool {
182-
self.name == other.name
183-
}
184-
}
185-
186-
impl Ord for BindingError {
187-
fn cmp(&self, other: &BindingError) -> cmp::Ordering {
188-
self.name.cmp(&other.name)
189-
}
190-
}
191-
192173
enum ResolutionError<'a> {
193174
/// Error E0401: can't use type or const parameters from outer function.
194175
GenericParamsFromOuterFunction(Res, HasGenericParams),
@@ -845,7 +826,7 @@ impl<'a> NameBinding<'a> {
845826
}
846827
}
847828

848-
#[derive(Debug, Default, Clone)]
829+
#[derive(Default, Clone)]
849830
pub struct ExternPreludeEntry<'a> {
850831
extern_crate_item: Option<&'a NameBinding<'a>>,
851832
pub introduced_by_item: bool,

0 commit comments

Comments
 (0)