Skip to content

Commit ae6e31b

Browse files
committed
move lower_binding_mode -> pat.rs
1 parent f75ccde commit ae6e31b

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/librustc_ast_lowering/lib.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2696,15 +2696,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
26962696
}
26972697
}
26982698

2699-
fn lower_binding_mode(&mut self, b: &BindingMode) -> hir::BindingAnnotation {
2700-
match *b {
2701-
BindingMode::ByValue(Mutability::Not) => hir::BindingAnnotation::Unannotated,
2702-
BindingMode::ByRef(Mutability::Not) => hir::BindingAnnotation::Ref,
2703-
BindingMode::ByValue(Mutability::Mut) => hir::BindingAnnotation::Mutable,
2704-
BindingMode::ByRef(Mutability::Mut) => hir::BindingAnnotation::RefMut,
2705-
}
2706-
}
2707-
27082699
fn lower_unsafe_source(&mut self, u: UnsafeSource) -> hir::UnsafeSource {
27092700
match u {
27102701
CompilerGenerated => hir::UnsafeSource::CompilerGenerated,

src/librustc_ast_lowering/pat.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,15 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
213213
}
214214
}
215215

216+
fn lower_binding_mode(&mut self, b: &BindingMode) -> hir::BindingAnnotation {
217+
match *b {
218+
BindingMode::ByValue(Mutability::Not) => hir::BindingAnnotation::Unannotated,
219+
BindingMode::ByRef(Mutability::Not) => hir::BindingAnnotation::Ref,
220+
BindingMode::ByValue(Mutability::Mut) => hir::BindingAnnotation::Mutable,
221+
BindingMode::ByRef(Mutability::Mut) => hir::BindingAnnotation::RefMut,
222+
}
223+
}
224+
216225
fn pat_wild_with_node_id_of(&mut self, p: &Pat) -> &'hir hir::Pat<'hir> {
217226
self.pat_with_node_id_of(p, hir::PatKind::Wild)
218227
}

0 commit comments

Comments
 (0)