Skip to content

Commit c1b20b1

Browse files
authored
Rollup merge of rust-lang#68416 - Centril:lowering-cleanup-hofs, r=pietroalbini
lowering: cleanup some hofs Some drive-by cleanup while working on `let_chains`. r? @pietroalbini
2 parents b6d6391 + 32a81f7 commit c1b20b1

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/librustc_ast_lowering/expr.rs

+3-12
Original file line numberDiff line numberDiff line change
@@ -848,10 +848,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
848848
}
849849
}
850850

851-
fn with_catch_scope<T, F>(&mut self, catch_id: NodeId, f: F) -> T
852-
where
853-
F: FnOnce(&mut Self) -> T,
854-
{
851+
fn with_catch_scope<T>(&mut self, catch_id: NodeId, f: impl FnOnce(&mut Self) -> T) -> T {
855852
let len = self.catch_scopes.len();
856853
self.catch_scopes.push(catch_id);
857854

@@ -867,10 +864,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
867864
result
868865
}
869866

870-
fn with_loop_scope<T, F>(&mut self, loop_id: NodeId, f: F) -> T
871-
where
872-
F: FnOnce(&mut Self) -> T,
873-
{
867+
fn with_loop_scope<T>(&mut self, loop_id: NodeId, f: impl FnOnce(&mut Self) -> T) -> T {
874868
// We're no longer in the base loop's condition; we're in another loop.
875869
let was_in_loop_condition = self.is_in_loop_condition;
876870
self.is_in_loop_condition = false;
@@ -892,10 +886,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
892886
result
893887
}
894888

895-
fn with_loop_condition_scope<T, F>(&mut self, f: F) -> T
896-
where
897-
F: FnOnce(&mut Self) -> T,
898-
{
889+
fn with_loop_condition_scope<T>(&mut self, f: impl FnOnce(&mut Self) -> T) -> T {
899890
let was_in_loop_condition = self.is_in_loop_condition;
900891
self.is_in_loop_condition = true;
901892

0 commit comments

Comments
 (0)