diff --git a/compiler/rustc_typeck/src/check/method/mod.rs b/compiler/rustc_typeck/src/check/method/mod.rs index 1ca9c192096..adc284785c2 100644 --- a/compiler/rustc_typeck/src/check/method/mod.rs +++ b/compiler/rustc_typeck/src/check/method/mod.rs @@ -78,28 +78,6 @@ pub struct NoMatchData<'tcx> { pub mode: probe::Mode, } -impl<'tcx> NoMatchData<'tcx> { - pub fn new( - static_candidates: Vec, - unsatisfied_predicates: Vec<( - ty::Predicate<'tcx>, - Option>, - Option>, - )>, - out_of_scope_traits: Vec, - lev_candidate: Option, - mode: probe::Mode, - ) -> Self { - NoMatchData { - static_candidates, - unsatisfied_predicates, - out_of_scope_traits, - lev_candidate, - mode, - } - } -} - // A pared down enum describing just the places from which a method // candidate can arise. Used for error reporting only. #[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd)] diff --git a/compiler/rustc_typeck/src/check/method/probe.rs b/compiler/rustc_typeck/src/check/method/probe.rs index 2ccd25212f1..ed20e5a4869 100644 --- a/compiler/rustc_typeck/src/check/method/probe.rs +++ b/compiler/rustc_typeck/src/check/method/probe.rs @@ -427,13 +427,13 @@ fn probe_op( .unwrap_or_else(|_| span_bug!(span, "instantiating {:?} failed?", ty)); let ty = self.structurally_resolved_type(span, ty.value); assert!(matches!(ty.kind(), ty::Error(_))); - return Err(MethodError::NoMatch(NoMatchData::new( - Vec::new(), - Vec::new(), - Vec::new(), - None, + return Err(MethodError::NoMatch(NoMatchData { + static_candidates: Vec::new(), + unsatisfied_predicates: Vec::new(), + out_of_scope_traits: Vec::new(), + lev_candidate: None, mode, - ))); + })); } } @@ -1093,13 +1093,13 @@ fn pick(mut self) -> PickResult<'tcx> { } let lev_candidate = self.probe_for_lev_candidate()?; - Err(MethodError::NoMatch(NoMatchData::new( + Err(MethodError::NoMatch(NoMatchData { static_candidates, unsatisfied_predicates, out_of_scope_traits, lev_candidate, - self.mode, - ))) + mode: self.mode, + })) } fn pick_core(&mut self) -> Option> {