Instance is Copy
This commit is contained in:
parent
cb7c63606e
commit
99fbc6f8ef
7 changed files with 38 additions and 38 deletions
|
@ -165,7 +165,7 @@ impl<'tcx> Inliner<'tcx> {
|
|||
caller_body: &mut Body<'tcx>,
|
||||
callsite: &CallSite<'tcx>,
|
||||
) -> Result<std::ops::Range<BasicBlock>, &'static str> {
|
||||
self.check_mir_is_available(caller_body, &callsite.callee)?;
|
||||
self.check_mir_is_available(caller_body, callsite.callee)?;
|
||||
|
||||
let callee_attrs = self.tcx.codegen_fn_attrs(callsite.callee.def_id());
|
||||
let cross_crate_inlinable = self.tcx.cross_crate_inlinable(callsite.callee.def_id());
|
||||
|
@ -298,7 +298,7 @@ impl<'tcx> Inliner<'tcx> {
|
|||
fn check_mir_is_available(
|
||||
&self,
|
||||
caller_body: &Body<'tcx>,
|
||||
callee: &Instance<'tcx>,
|
||||
callee: Instance<'tcx>,
|
||||
) -> Result<(), &'static str> {
|
||||
let caller_def_id = caller_body.source.def_id();
|
||||
let callee_def_id = callee.def_id();
|
||||
|
@ -354,7 +354,7 @@ impl<'tcx> Inliner<'tcx> {
|
|||
|
||||
// If we know for sure that the function we're calling will itself try to
|
||||
// call us, then we avoid inlining that function.
|
||||
if self.tcx.mir_callgraph_reachable((*callee, caller_def_id.expect_local())) {
|
||||
if self.tcx.mir_callgraph_reachable((callee, caller_def_id.expect_local())) {
|
||||
return Err("caller might be reachable from callee (query cycle avoidance)");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue