Skip to content

Commit 06b3636

Browse files
committed
Remove unnecessary passing of scope_expr_id
1 parent 120e5bd commit 06b3636

File tree

1 file changed

+6
-9
lines changed
  • compiler/rustc_typeck/src/check/method

1 file changed

+6
-9
lines changed

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

+6-9
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
287287
self_ty,
288288
scope_expr_id,
289289
ProbeScope::AllTraits,
290-
|probe_cx| probe_cx.pick(scope_expr_id),
290+
|probe_cx| probe_cx.pick(),
291291
)
292292
.ok()
293293
.map(|pick| pick.item)
@@ -319,7 +319,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
319319
self_ty,
320320
scope_expr_id,
321321
scope,
322-
|probe_cx| probe_cx.pick(scope_expr_id),
322+
|probe_cx| probe_cx.pick(),
323323
)
324324
}
325325

@@ -1036,7 +1036,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
10361036
///////////////////////////////////////////////////////////////////////////
10371037
// THE ACTUAL SEARCH
10381038

1039-
fn pick(mut self, scope_expr_id: hir::HirId) -> PickResult<'tcx> {
1039+
fn pick(mut self) -> PickResult<'tcx> {
10401040
assert!(self.method_name.is_some());
10411041

10421042
if let Some(r) = self.pick_core() {
@@ -1082,7 +1082,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
10821082
if let Some((kind, def_id)) = private_candidate {
10831083
return Err(MethodError::PrivateMatch(kind, def_id, out_of_scope_traits));
10841084
}
1085-
let lev_candidate = self.probe_for_lev_candidate(scope_expr_id)?;
1085+
let lev_candidate = self.probe_for_lev_candidate()?;
10861086

10871087
Err(MethodError::NoMatch(NoMatchData::new(
10881088
static_candidates,
@@ -1585,10 +1585,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
15851585
/// Similarly to `probe_for_return_type`, this method attempts to find the best matching
15861586
/// candidate method where the method name may have been misspelt. Similarly to other
15871587
/// Levenshtein based suggestions, we provide at most one such suggestion.
1588-
fn probe_for_lev_candidate(
1589-
&mut self,
1590-
scope_expr_id: hir::HirId,
1591-
) -> Result<Option<ty::AssocItem>, MethodError<'tcx>> {
1588+
fn probe_for_lev_candidate(&mut self) -> Result<Option<ty::AssocItem>, MethodError<'tcx>> {
15921589
debug!("probing for method names similar to {:?}", self.method_name);
15931590

15941591
let steps = self.steps.clone();
@@ -1602,7 +1599,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
16021599
self.orig_steps_var_values.clone(),
16031600
steps,
16041601
IsSuggestion(true),
1605-
scope_expr_id,
1602+
self.scope_expr_id,
16061603
);
16071604
pcx.allow_similar_names = true;
16081605
pcx.assemble_inherent_candidates();

0 commit comments

Comments
 (0)