Skip to content

Commit 795fa0a

Browse files
committed
Remove useless calls to assemble_extension_candidates_for_traits_in_scope
Calls to `assemble_extension_candidates_for_traits_in_scope` with `DUMMY_HIR_ID` as `expr_hir_id` are useless because the first thing that this function does is to return `Ok(())` in this case.
1 parent a00bd29 commit 795fa0a

File tree

1 file changed

+1
-5
lines changed
  • src/librustc_typeck/check/method

1 file changed

+1
-5
lines changed

src/librustc_typeck/check/method/probe.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,7 +1513,6 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
15131513
);
15141514
pcx.allow_similar_names = true;
15151515
pcx.assemble_inherent_candidates();
1516-
pcx.assemble_extension_candidates_for_traits_in_scope(hir::DUMMY_HIR_ID)?;
15171516

15181517
let method_names = pcx.candidate_method_names();
15191518
pcx.allow_similar_names = false;
@@ -1523,10 +1522,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
15231522
pcx.reset();
15241523
pcx.method_name = Some(method_name);
15251524
pcx.assemble_inherent_candidates();
1526-
pcx.assemble_extension_candidates_for_traits_in_scope(hir::DUMMY_HIR_ID)
1527-
.map_or(None, |_| {
1528-
pcx.pick_core().and_then(|pick| pick.ok()).map(|pick| pick.item)
1529-
})
1525+
pcx.pick_core().and_then(|pick| pick.ok()).map(|pick| pick.item)
15301526
})
15311527
.collect();
15321528

0 commit comments

Comments
 (0)