diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2020-05-06 10:17:38 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2020-05-06 12:15:26 +1000 |
| commit | afd8a4e7ec4c5b6d8296d6d9109389b27e074980 (patch) | |
| tree | 1b6629d8c8274d5f23b1ed17963c6dbb5a7a73a1 /src/librustc_mir/transform/inline.rs | |
| parent | a17234ca542f45028d846c7ec95c0a19d96df743 (diff) | |
| download | rust-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.rs | 4 |
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 { |
