]> git.lizzy.rs Git - rust.git/commitdiff
Remove unused parameter from in(_opt)?_scope
authorMatthew Jasper <mjjasper1@gmail.com>
Sat, 30 Mar 2019 21:49:52 +0000 (21:49 +0000)
committerMatthew Jasper <mjjasper1@gmail.com>
Tue, 21 May 2019 18:37:38 +0000 (19:37 +0100)
src/librustc_mir/build/block.rs
src/librustc_mir/build/expr/as_operand.rs
src/librustc_mir/build/expr/as_place.rs
src/librustc_mir/build/expr/as_rvalue.rs
src/librustc_mir/build/expr/as_temp.rs
src/librustc_mir/build/expr/into.rs
src/librustc_mir/build/expr/stmt.rs
src/librustc_mir/build/mod.rs
src/librustc_mir/build/scope.rs

index 7469aceee3a9ee959c7647fee82007ba20eaed77..d93223a4292c4399f7233ac9acb0004b04071af1 100644 (file)
@@ -23,8 +23,8 @@ pub fn ast_block(&mut self,
             safety_mode
         } =
             self.hir.mirror(ast_block);
-        self.in_opt_scope(opt_destruction_scope.map(|de|(de, source_info)), block, move |this| {
-            this.in_scope((region_scope, source_info), LintLevel::Inherited, block, move |this| {
+        self.in_opt_scope(opt_destruction_scope.map(|de|(de, source_info)), move |this| {
+            this.in_scope((region_scope, source_info), LintLevel::Inherited, move |this| {
                 if targeted_by_break {
                     // This is a `break`-able block
                     let exit_block = this.cfg.start_new_block();
@@ -83,9 +83,9 @@ fn ast_block_stmts(&mut self,
                 StmtKind::Expr { scope, expr } => {
                     this.block_context.push(BlockFrame::Statement { ignores_expr_result: true });
                     unpack!(block = this.in_opt_scope(
-                        opt_destruction_scope.map(|de|(de, source_info)), block, |this| {
+                        opt_destruction_scope.map(|de|(de, source_info)), |this| {
                             let si = (scope, source_info);
-                            this.in_scope(si, LintLevel::Inherited, block, |this| {
+                            this.in_scope(si, LintLevel::Inherited, |this| {
                                 let expr = this.hir.mirror(expr);
                                 this.stmt_expr(block, expr, Some(stmt_span))
                             })
@@ -128,9 +128,9 @@ fn ast_block_stmts(&mut self,
                             Some((None, initializer_span)),
                         );
                         unpack!(block = this.in_opt_scope(
-                            opt_destruction_scope.map(|de|(de, source_info)), block, |this| {
+                            opt_destruction_scope.map(|de|(de, source_info)), |this| {
                                 let scope = (init_scope, source_info);
-                                this.in_scope(scope, lint_level, block, |this| {
+                                this.in_scope(scope, lint_level, |this| {
                                     this.expr_into_pattern(block, pattern, init)
                                 })
                             }));
index e354a2ee8160b47f1f17c40b8561df9eb14e82e4..ed80cb1a16369e6286917c16d0dfe05d2a54031f 100644 (file)
@@ -57,7 +57,7 @@ fn expr_as_operand(
         {
             let source_info = this.source_info(expr.span);
             let region_scope = (region_scope, source_info);
-            return this.in_scope(region_scope, lint_level, block, |this| {
+            return this.in_scope(region_scope, lint_level, |this| {
                 this.as_operand(block, scope, value)
             });
         }
index 5f444d4ceeb8895fe40bae33b69969bad3ac3942..a956eacb0699fd3cd1276a0687645addc1282bf6 100644 (file)
@@ -52,7 +52,7 @@ fn expr_as_place(
                 region_scope,
                 lint_level,
                 value,
-            } => this.in_scope((region_scope, source_info), lint_level, block, |this| {
+            } => this.in_scope((region_scope, source_info), lint_level, |this| {
                 if mutability == Mutability::Not {
                     this.as_read_only_place(block, value)
                 } else {
index fbc4835a6557b4e2a7b34f744286a8c2c424fd72..a0b504a99de9a7981778362410688bec60663dd7 100644 (file)
@@ -58,7 +58,7 @@ fn expr_as_rvalue(
                 value,
             } => {
                 let region_scope = (region_scope, source_info);
-                this.in_scope(region_scope, lint_level, block, |this| {
+                this.in_scope(region_scope, lint_level, |this| {
                     this.as_rvalue(block, scope, value)
                 })
             }
index cba771f27065d93cd6649f94ee44bfccfd3a2a43..c60e197010067990548fa54b228925b7c0a4b026 100644 (file)
@@ -43,7 +43,7 @@ fn expr_as_temp(
             value,
         } = expr.kind
         {
-            return this.in_scope((region_scope, source_info), lint_level, block, |this| {
+            return this.in_scope((region_scope, source_info), lint_level, |this| {
                 this.as_temp(block, temp_lifetime, value, mutability)
             });
         }
index 15795a64e3b7dcea2703280b12c3fc6024ff40dc..7bdfdf0b0895f9579fe4a0cd16cd9f2ae809ebf6 100644 (file)
@@ -46,7 +46,7 @@ pub fn into_expr(
                 value,
             } => {
                 let region_scope = (region_scope, source_info);
-                this.in_scope(region_scope, lint_level, block, |this| {
+                this.in_scope(region_scope, lint_level, |this| {
                     this.into(destination, block, value)
                 })
             }
index b58914b017fd4601f4a677772ed2fa9d93c0ac17..ac690f89264bfdd0d84f163ecbc3f79df3534733 100644 (file)
@@ -29,7 +29,7 @@ pub fn stmt_expr(&mut self,
                 value,
             } => {
                 let value = this.hir.mirror(value);
-                this.in_scope((region_scope, source_info), lint_level, block, |this| {
+                this.in_scope((region_scope, source_info), lint_level, |this| {
                     this.stmt_expr(block, value, opt_stmt_span)
                 })
             }
index 16ab233bd2e368893ba3e30c83d621eb4392bf87..b432ed47d0b8d42b0e6519c6e9ec46cff786b35e 100644 (file)
@@ -702,13 +702,13 @@ fn construct_fn<'a, 'gcx, 'tcx, A>(hir: Cx<'a, 'gcx, 'tcx>,
     let mut block = START_BLOCK;
     let source_info = builder.source_info(span);
     let call_site_s = (call_site_scope, source_info);
-    unpack!(block = builder.in_scope(call_site_s, LintLevel::Inherited, block, |builder| {
+    unpack!(block = builder.in_scope(call_site_s, LintLevel::Inherited, |builder| {
         if should_abort_on_panic(tcx, fn_def_id, abi) {
             builder.schedule_abort();
         }
 
         let arg_scope_s = (arg_scope, source_info);
-        unpack!(block = builder.in_scope(arg_scope_s, LintLevel::Inherited, block, |builder| {
+        unpack!(block = builder.in_scope(arg_scope_s, LintLevel::Inherited, |builder| {
             builder.args_and_body(block, &arguments, arg_scope, &body.value)
         }));
         // Attribute epilogue to function's closing brace
index 4aa463b37ab779f74e02fe432dc44ac89f0db4be..471304012c9a803bf54a5f0446be9e409d45a9ee 100644 (file)
@@ -279,13 +279,13 @@ pub fn in_breakable_scope<F, R>(&mut self,
 
     pub fn in_opt_scope<F, R>(&mut self,
                               opt_scope: Option<(region::Scope, SourceInfo)>,
-                              mut block: BasicBlock,
                               f: F)
                               -> BlockAnd<R>
         where F: FnOnce(&mut Builder<'a, 'gcx, 'tcx>) -> BlockAnd<R>
     {
-        debug!("in_opt_scope(opt_scope={:?}, block={:?})", opt_scope, block);
+        debug!("in_opt_scope(opt_scope={:?})", opt_scope);
         if let Some(region_scope) = opt_scope { self.push_scope(region_scope); }
+        let mut block;
         let rv = unpack!(block = f(self));
         if let Some(region_scope) = opt_scope {
             unpack!(block = self.pop_scope(region_scope, block));
@@ -299,12 +299,11 @@ pub fn in_opt_scope<F, R>(&mut self,
     pub fn in_scope<F, R>(&mut self,
                           region_scope: (region::Scope, SourceInfo),
                           lint_level: LintLevel,
-                          mut block: BasicBlock,
                           f: F)
                           -> BlockAnd<R>
         where F: FnOnce(&mut Builder<'a, 'gcx, 'tcx>) -> BlockAnd<R>
     {
-        debug!("in_scope(region_scope={:?}, block={:?})", region_scope, block);
+        debug!("in_scope(region_scope={:?})", region_scope);
         let source_scope = self.source_scope;
         let tcx = self.hir.tcx();
         if let LintLevel::Explicit(current_hir_id) = lint_level {
@@ -330,6 +329,7 @@ pub fn in_scope<F, R>(&mut self,
             }
         }
         self.push_scope(region_scope);
+        let mut block;
         let rv = unpack!(block = f(self));
         unpack!(block = self.pop_scope(region_scope, block));
         self.source_scope = source_scope;