Skip to content

Commit 2648bc7

Browse files
committed
Auto merge of rust-lang#117001 - saethlin:defpathhash-check, r=<try>
Remove the DefPathHash check Just wondering how much perf this is worth r? `@ghost`
2 parents 249624b + 838c879 commit 2648bc7

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

compiler/rustc_mir_transform/src/inline.rs

-10
Original file line numberDiff line numberDiff line change
@@ -336,16 +336,6 @@ impl<'tcx> Inliner<'tcx> {
336336
}
337337

338338
if callee_def_id.is_local() {
339-
// Avoid a cycle here by only using `instance_mir` only if we have
340-
// a lower `DefPathHash` than the callee. This ensures that the callee will
341-
// not inline us. This trick even works with incremental compilation,
342-
// since `DefPathHash` is stable.
343-
if self.tcx.def_path_hash(caller_def_id).local_hash()
344-
< self.tcx.def_path_hash(callee_def_id).local_hash()
345-
{
346-
return Ok(());
347-
}
348-
349339
// If we know for sure that the function we're calling will itself try to
350340
// call us, then we avoid inlining that function.
351341
if self.tcx.mir_callgraph_reachable((*callee, caller_def_id.expect_local())) {

0 commit comments

Comments
 (0)