about summary refs log tree commit diff
path: root/src/librustc_mir/transform/inline.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2020-05-06 10:17:38 +1000
committerNicholas Nethercote <nnethercote@mozilla.com>2020-05-06 12:15:26 +1000
commitafd8a4e7ec4c5b6d8296d6d9109389b27e074980 (patch)
tree1b6629d8c8274d5f23b1ed17963c6dbb5a7a73a1 /src/librustc_mir/transform/inline.rs
parenta17234ca542f45028d846c7ec95c0a19d96df743 (diff)
downloadrust-afd8a4e7ec4c5b6d8296d6d9109389b27e074980.tar.gz
rust-afd8a4e7ec4c5b6d8296d6d9109389b27e074980.zip
Improve `LocalDecl` creation.
This commit adds some new `LocalDecl` methods:
- `with_source_info`, a most general constructor.
- `new`, a variant of `with_source_info` which represents the most
  common use case.
- `internal` a modifying method (like the already present `immutable`).

It removes some old `LocalDecl` methods:
- `new_internal` and `new_local`, because they're subsumed by the new
  methods.
- `new_return_place`, because it was identical to `new_temp`.

Finally, it cleans up all the use sites.
Diffstat (limited to 'src/librustc_mir/transform/inline.rs')
-rw-r--r--src/librustc_mir/transform/inline.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_mir/transform/inline.rs b/src/librustc_mir/transform/inline.rs
index 985bd2b1660..a8e949ecb31 100644
--- a/src/librustc_mir/transform/inline.rs
+++ b/src/librustc_mir/transform/inline.rs
@@ -480,7 +480,7 @@ impl Inliner<'tcx> {
 
                     let ty = dest.ty(caller_body, self.tcx);
 
-                    let temp = LocalDecl::new_temp(ty, callsite.location.span);
+                    let temp = LocalDecl::new(ty, callsite.location.span);
 
                     let tmp = caller_body.local_decls.push(temp);
                     let tmp = Place::from(tmp);
@@ -631,7 +631,7 @@ impl Inliner<'tcx> {
 
         let ty = arg.ty(caller_body, self.tcx);
 
-        let arg_tmp = LocalDecl::new_temp(ty, callsite.location.span);
+        let arg_tmp = LocalDecl::new(ty, callsite.location.span);
         let arg_tmp = caller_body.local_decls.push(arg_tmp);
 
         let stmt = Statement {