diff options
| -rw-r--r-- | src/librustc_mir/build/expr/into.rs | 5 | ||||
| -rw-r--r-- | src/librustc_mir/build/mod.rs | 11 | ||||
| -rw-r--r-- | src/librustc_mir/hair/cx/mod.rs | 4 |
3 files changed, 5 insertions, 15 deletions
diff --git a/src/librustc_mir/build/expr/into.rs b/src/librustc_mir/build/expr/into.rs index 44d1d52a06a..53ac4d854ed 100644 --- a/src/librustc_mir/build/expr/into.rs +++ b/src/librustc_mir/build/expr/into.rs @@ -157,8 +157,9 @@ impl<'a,'tcx> Builder<'a,'tcx> { } // execute the body, branching back to the test - let unit_temp = this.unit_temp.clone(); - let body_block_end = unpack!(this.into(&unit_temp, body_block, body)); + // FIXME(#30636): this should not create or request any sort of destination at + // all. + let body_block_end = unpack!(this.into(destination, body_block, body)); this.cfg.terminate(body_block_end, Terminator::Goto { target: loop_block }); // final point is exit_block diff --git a/src/librustc_mir/build/mod.rs b/src/librustc_mir/build/mod.rs index e6e5b8380b2..d217eb06647 100644 --- a/src/librustc_mir/build/mod.rs +++ b/src/librustc_mir/build/mod.rs @@ -23,7 +23,6 @@ pub struct Builder<'a, 'tcx: 'a> { cfg: CFG<'tcx>, scopes: Vec<scope::Scope<'tcx>>, loop_scopes: Vec<scope::LoopScope>, - unit_temp: Lvalue<'tcx>, var_decls: Vec<VarDecl<'tcx>>, var_indices: FnvHashMap<ast::NodeId, u32>, temp_decls: Vec<TempDecl<'tcx>>, @@ -79,7 +78,7 @@ macro_rules! unpack { /////////////////////////////////////////////////////////////////////////// // construct() -- the main entry point for building MIR for a function -pub fn construct<'a,'tcx>(mut hir: Cx<'a,'tcx>, +pub fn construct<'a,'tcx>(hir: Cx<'a,'tcx>, _span: Span, implicit_arguments: Vec<Ty<'tcx>>, explicit_arguments: Vec<(Ty<'tcx>, &'tcx hir::Pat)>, @@ -89,20 +88,14 @@ pub fn construct<'a,'tcx>(mut hir: Cx<'a,'tcx>, -> Mir<'tcx> { let cfg = CFG { basic_blocks: vec![] }; - // it's handy to have a temporary of type `()` sometimes, so make - // one from the start and keep it available - let temp_decls = vec![TempDecl::<'tcx> { ty: hir.unit_ty() }]; - let unit_temp = Lvalue::Temp(0); - let mut builder = Builder { hir: hir, cfg: cfg, scopes: vec![], loop_scopes: vec![], - temp_decls: temp_decls, + temp_decls: vec![], var_decls: vec![], var_indices: FnvHashMap(), - unit_temp: unit_temp, }; assert_eq!(builder.cfg.start_new_block(), START_BLOCK); diff --git a/src/librustc_mir/hair/cx/mod.rs b/src/librustc_mir/hair/cx/mod.rs index f9dd40defdf..b49dc6d8962 100644 --- a/src/librustc_mir/hair/cx/mod.rs +++ b/src/librustc_mir/hair/cx/mod.rs @@ -46,10 +46,6 @@ impl<'a,'tcx:'a> Cx<'a, 'tcx> { ast.make_mirror(self) } - pub fn unit_ty(&mut self) -> Ty<'tcx> { - self.tcx.mk_nil() - } - pub fn usize_ty(&mut self) -> Ty<'tcx> { self.tcx.types.usize } |
