diff options
| author | lcnr <rust@lcnr.de> | 2022-03-11 12:20:27 +0100 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2022-03-30 11:23:58 +0200 |
| commit | 4558a125b6108f3c080e88d7746e1d422b969bef (patch) | |
| tree | dce35161dab04e9d663f6f4638ede15feb921d1e | |
| parent | 975162d1bef80bfb642ef4069c72a30b1e9d2923 (diff) | |
remove `NoMatchData::new`
| -rw-r--r-- | compiler/rustc_typeck/src/check/method/mod.rs | 22 | ||||
| -rw-r--r-- | compiler/rustc_typeck/src/check/method/probe.rs | 18 |
2 files changed, 9 insertions, 31 deletions
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<CandidateSource>, - unsatisfied_predicates: Vec<( - ty::Predicate<'tcx>, - Option<ty::Predicate<'tcx>>, - Option<ObligationCause<'tcx>>, - )>, - out_of_scope_traits: Vec<DefId>, - lev_candidate: Option<ty::AssocItem>, - 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 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { .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 @@ impl<'a, 'tcx> ProbeContext<'a, '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<PickResult<'tcx>> { |
