Skip to content

Commit 4558a12

Browse files
committed
remove NoMatchData::new
1 parent 975162d commit 4558a12

File tree

2 files changed

+9
-31
lines changed

2 files changed

+9
-31
lines changed

compiler/rustc_typeck/src/check/method/mod.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -78,28 +78,6 @@ pub struct NoMatchData<'tcx> {
7878
pub mode: probe::Mode,
7979
}
8080

81-
impl<'tcx> NoMatchData<'tcx> {
82-
pub fn new(
83-
static_candidates: Vec<CandidateSource>,
84-
unsatisfied_predicates: Vec<(
85-
ty::Predicate<'tcx>,
86-
Option<ty::Predicate<'tcx>>,
87-
Option<ObligationCause<'tcx>>,
88-
)>,
89-
out_of_scope_traits: Vec<DefId>,
90-
lev_candidate: Option<ty::AssocItem>,
91-
mode: probe::Mode,
92-
) -> Self {
93-
NoMatchData {
94-
static_candidates,
95-
unsatisfied_predicates,
96-
out_of_scope_traits,
97-
lev_candidate,
98-
mode,
99-
}
100-
}
101-
}
102-
10381
// A pared down enum describing just the places from which a method
10482
// candidate can arise. Used for error reporting only.
10583
#[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]

compiler/rustc_typeck/src/check/method/probe.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -427,13 +427,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
427427
.unwrap_or_else(|_| span_bug!(span, "instantiating {:?} failed?", ty));
428428
let ty = self.structurally_resolved_type(span, ty.value);
429429
assert!(matches!(ty.kind(), ty::Error(_)));
430-
return Err(MethodError::NoMatch(NoMatchData::new(
431-
Vec::new(),
432-
Vec::new(),
433-
Vec::new(),
434-
None,
430+
return Err(MethodError::NoMatch(NoMatchData {
431+
static_candidates: Vec::new(),
432+
unsatisfied_predicates: Vec::new(),
433+
out_of_scope_traits: Vec::new(),
434+
lev_candidate: None,
435435
mode,
436-
)));
436+
}));
437437
}
438438
}
439439

@@ -1093,13 +1093,13 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
10931093
}
10941094
let lev_candidate = self.probe_for_lev_candidate()?;
10951095

1096-
Err(MethodError::NoMatch(NoMatchData::new(
1096+
Err(MethodError::NoMatch(NoMatchData {
10971097
static_candidates,
10981098
unsatisfied_predicates,
10991099
out_of_scope_traits,
11001100
lev_candidate,
1101-
self.mode,
1102-
)))
1101+
mode: self.mode,
1102+
}))
11031103
}
11041104

11051105
fn pick_core(&mut self) -> Option<PickResult<'tcx>> {

0 commit comments

Comments
 (0)