about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/inline.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-09-09 18:53:06 +0000
committerbors <bors@rust-lang.org>2024-09-09 18:53:06 +0000
commitc2f74c3f928aeb503f15b4e9ef5778e77f3058b8 (patch)
treefb95aea0cb40f76209cd354496a90ba6391d9c6c /compiler/rustc_mir_transform/src/inline.rs
parentd7522d872601c5243899a813728a05cde1e5a8e2 (diff)
parenta0346bbd31110e5f269ce1f3e5a794131d48359a (diff)
downloadrust-c2f74c3f928aeb503f15b4e9ef5778e77f3058b8.tar.gz
rust-c2f74c3f928aeb503f15b4e9ef5778e77f3058b8.zip
Auto merge of #130165 - matthiaskrgr:rollup-fsnmz3t, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #129929 (`rustc_mir_transform` cleanups, round 2)
 - #130022 (Dataflow/borrowck lifetime cleanups)
 - #130064 (fix ICE in CMSE type validation)
 - #130067 (Remove redundant check in `symlink_hard_link` test)
 - #130131 (Print a helpful message if any tests were skipped for being up-to-date)
 - #130137 (Fix ICE caused by missing span in a region error)
 - #130153 (use verbose flag as a default value for `rust.verbose-tests`)
 - #130154 (Stabilize `char::MIN`)
 - #130158 (Update books)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_mir_transform/src/inline.rs')
-rw-r--r--compiler/rustc_mir_transform/src/inline.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/rustc_mir_transform/src/inline.rs b/compiler/rustc_mir_transform/src/inline.rs
index 6cc7e0ee1e4..03ef808efec 100644
--- a/compiler/rustc_mir_transform/src/inline.rs
+++ b/compiler/rustc_mir_transform/src/inline.rs
@@ -32,9 +32,11 @@ pub(crate) mod cycle;
 
 const TOP_DOWN_DEPTH_LIMIT: usize = 5;
 
+// Made public so that `mir_drops_elaborated_and_const_checked` can be overridden
+// by custom rustc drivers, running all the steps by themselves. See #114628.
 pub struct Inline;
 
-#[derive(Copy, Clone, Debug)]
+#[derive(Clone, Debug)]
 struct CallSite<'tcx> {
     callee: Instance<'tcx>,
     fn_sig: ty::PolyFnSig<'tcx>,
@@ -156,7 +158,6 @@ impl<'tcx> Inliner<'tcx> {
             match self.try_inlining(caller_body, &callsite) {
                 Err(reason) => {
                     debug!("not-inlined {} [{}]", callsite.callee, reason);
-                    continue;
                 }
                 Ok(new_blocks) => {
                     debug!("inlined {}", callsite.callee);
@@ -638,7 +639,7 @@ impl<'tcx> Inliner<'tcx> {
             );
             let dest_ty = dest.ty(caller_body, self.tcx);
             let temp =
-                Place::from(self.new_call_temp(caller_body, &callsite, dest_ty, return_block));
+                Place::from(self.new_call_temp(caller_body, callsite, dest_ty, return_block));
             caller_body[callsite.block].statements.push(Statement {
                 source_info: callsite.source_info,
                 kind: StatementKind::Assign(Box::new((temp, dest))),
@@ -657,7 +658,7 @@ impl<'tcx> Inliner<'tcx> {
                 true,
                 self.new_call_temp(
                     caller_body,
-                    &callsite,
+                    callsite,
                     destination.ty(caller_body, self.tcx).ty,
                     return_block,
                 ),
@@ -665,7 +666,7 @@ impl<'tcx> Inliner<'tcx> {
         };
 
         // Copy the arguments if needed.
-        let args = self.make_call_args(args, &callsite, caller_body, &callee_body, return_block);
+        let args = self.make_call_args(args, callsite, caller_body, &callee_body, return_block);
 
         let mut integrator = Integrator {
             args: &args,