diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-01-21 19:42:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-21 19:42:28 +0100 |
| commit | c1b20b1ae3a6fd3f95f462ac452c8574f19702d6 (patch) | |
| tree | 0c48ca3a6337686b495a4af02535de7bb1972d78 /src | |
| parent | b6d6391218d434b50ef04962cce66f3fd0d0ee94 (diff) | |
| parent | 32a81f774204dc77dbe11b011cbe769b4fd61476 (diff) | |
| download | rust-c1b20b1ae3a6fd3f95f462ac452c8574f19702d6.tar.gz rust-c1b20b1ae3a6fd3f95f462ac452c8574f19702d6.zip | |
Rollup merge of #68416 - Centril:lowering-cleanup-hofs, r=pietroalbini
lowering: cleanup some hofs Some drive-by cleanup while working on `let_chains`. r? @pietroalbini
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_ast_lowering/expr.rs | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/librustc_ast_lowering/expr.rs b/src/librustc_ast_lowering/expr.rs index a24bb52150a..5dc855e935c 100644 --- a/src/librustc_ast_lowering/expr.rs +++ b/src/librustc_ast_lowering/expr.rs @@ -848,10 +848,7 @@ impl<'hir> LoweringContext<'_, 'hir> { } } - fn with_catch_scope<T, F>(&mut self, catch_id: NodeId, f: F) -> T - where - F: FnOnce(&mut Self) -> T, - { + fn with_catch_scope<T>(&mut self, catch_id: NodeId, f: impl FnOnce(&mut Self) -> T) -> T { let len = self.catch_scopes.len(); self.catch_scopes.push(catch_id); @@ -867,10 +864,7 @@ impl<'hir> LoweringContext<'_, 'hir> { result } - fn with_loop_scope<T, F>(&mut self, loop_id: NodeId, f: F) -> T - where - F: FnOnce(&mut Self) -> T, - { + fn with_loop_scope<T>(&mut self, loop_id: NodeId, f: impl FnOnce(&mut Self) -> T) -> T { // We're no longer in the base loop's condition; we're in another loop. let was_in_loop_condition = self.is_in_loop_condition; self.is_in_loop_condition = false; @@ -892,10 +886,7 @@ impl<'hir> LoweringContext<'_, 'hir> { result } - fn with_loop_condition_scope<T, F>(&mut self, f: F) -> T - where - F: FnOnce(&mut Self) -> T, - { + fn with_loop_condition_scope<T>(&mut self, f: impl FnOnce(&mut Self) -> T) -> T { let was_in_loop_condition = self.is_in_loop_condition; self.is_in_loop_condition = true; |
