Skip to content

Commit 13fd5e9

Browse files
committed
Auto merge of #41320 - Mark-Simulacrum:cleanup-methodmatch, r=arielb1
Remove MethodMatchResult and MethodMatchedData. These two enums were unused. Fixes #41318. r? @nikomatsakis
2 parents d5cf1cb + f8f5282 commit 13fd5e9

File tree

2 files changed

+0
-31
lines changed

2 files changed

+0
-31
lines changed

src/librustc/traits/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ pub use self::project::{ProjectionCache, ProjectionCacheSnapshot, Reveal};
3838
pub use self::object_safety::ObjectSafetyViolation;
3939
pub use self::object_safety::MethodViolationCode;
4040
pub use self::select::{EvaluationCache, SelectionContext, SelectionCache};
41-
pub use self::select::{MethodMatchResult, MethodMatched, MethodAmbiguous, MethodDidNotMatch};
42-
pub use self::select::{MethodMatchedData}; // intentionally don't export variants
4341
pub use self::specialize::{OverlapError, specialization_graph, specializes, translate_substs};
4442
pub use self::specialize::{SpecializesCache, find_associated_item};
4543
pub use self::util::elaborate_predicates;

src/librustc/traits/select.rs

-29
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
//! See `README.md` for high-level documentation
1212
13-
pub use self::MethodMatchResult::*;
14-
pub use self::MethodMatchedData::*;
1513
use self::SelectionCandidate::*;
1614
use self::EvaluationResult::*;
1715

@@ -110,23 +108,6 @@ pub struct SelectionCache<'tcx> {
110108
SelectionResult<'tcx, SelectionCandidate<'tcx>>>>,
111109
}
112110

113-
pub enum MethodMatchResult {
114-
MethodMatched(MethodMatchedData),
115-
MethodAmbiguous(/* list of impls that could apply */ Vec<DefId>),
116-
MethodDidNotMatch,
117-
}
118-
119-
#[derive(Copy, Clone, Debug)]
120-
pub enum MethodMatchedData {
121-
// In the case of a precise match, we don't really need to store
122-
// how the match was found. So don't.
123-
PreciseMethodMatch,
124-
125-
// In the case of a coercion, we need to know the precise impl so
126-
// that we can determine the type to which things were coerced.
127-
CoerciveMethodMatch(/* impl we matched */ DefId)
128-
}
129-
130111
/// The selection process begins by considering all impls, where
131112
/// clauses, and so forth that might resolve an obligation. Sometimes
132113
/// we'll be able to say definitively that (e.g.) an impl does not
@@ -2982,13 +2963,3 @@ impl EvaluationResult {
29822963
}
29832964
}
29842965
}
2985-
2986-
impl MethodMatchResult {
2987-
pub fn may_apply(&self) -> bool {
2988-
match *self {
2989-
MethodMatched(_) => true,
2990-
MethodAmbiguous(_) => true,
2991-
MethodDidNotMatch => false,
2992-
}
2993-
}
2994-
}

0 commit comments

Comments
 (0)