about summary refs log tree commit diff
diff options
context:
space:
mode:
authormarmeladema <xademax@gmail.com>2020-04-12 21:22:30 +0100
committermarmeladema <xademax@gmail.com>2020-04-13 13:43:44 +0100
commit795fa0a006bed5526e762a8bb11284da96ddf57d (patch)
tree553ba74d828fcf5a86a2eea02754c88704431b15
parenta00bd29e01c4042143d01681e45723a2052412b0 (diff)
downloadrust-795fa0a006bed5526e762a8bb11284da96ddf57d.tar.gz
rust-795fa0a006bed5526e762a8bb11284da96ddf57d.zip
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.
-rw-r--r--src/librustc_typeck/check/method/probe.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/librustc_typeck/check/method/probe.rs b/src/librustc_typeck/check/method/probe.rs
index 7e7d84c1996..0b1aff7e806 100644
--- a/src/librustc_typeck/check/method/probe.rs
+++ b/src/librustc_typeck/check/method/probe.rs
@@ -1513,7 +1513,6 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
             );
             pcx.allow_similar_names = true;
             pcx.assemble_inherent_candidates();
-            pcx.assemble_extension_candidates_for_traits_in_scope(hir::DUMMY_HIR_ID)?;
 
             let method_names = pcx.candidate_method_names();
             pcx.allow_similar_names = false;
@@ -1523,10 +1522,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
                     pcx.reset();
                     pcx.method_name = Some(method_name);
                     pcx.assemble_inherent_candidates();
-                    pcx.assemble_extension_candidates_for_traits_in_scope(hir::DUMMY_HIR_ID)
-                        .map_or(None, |_| {
-                            pcx.pick_core().and_then(|pick| pick.ok()).map(|pick| pick.item)
-                        })
+                    pcx.pick_core().and_then(|pick| pick.ok()).map(|pick| pick.item)
                 })
                 .collect();