From ae6e31b1a339903a92bb03ee085924e3da425356 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Mon, 6 Jan 2020 06:54:48 +0100 Subject: [PATCH] move lower_binding_mode -> pat.rs --- src/librustc_ast_lowering/lib.rs | 9 --------- src/librustc_ast_lowering/pat.rs | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/librustc_ast_lowering/lib.rs b/src/librustc_ast_lowering/lib.rs index 658bcb26ecf..3431cf08b6d 100644 --- a/src/librustc_ast_lowering/lib.rs +++ b/src/librustc_ast_lowering/lib.rs @@ -2696,15 +2696,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { } } - fn lower_binding_mode(&mut self, b: &BindingMode) -> hir::BindingAnnotation { - match *b { - BindingMode::ByValue(Mutability::Not) => hir::BindingAnnotation::Unannotated, - BindingMode::ByRef(Mutability::Not) => hir::BindingAnnotation::Ref, - BindingMode::ByValue(Mutability::Mut) => hir::BindingAnnotation::Mutable, - BindingMode::ByRef(Mutability::Mut) => hir::BindingAnnotation::RefMut, - } - } - fn lower_unsafe_source(&mut self, u: UnsafeSource) -> hir::UnsafeSource { match u { CompilerGenerated => hir::UnsafeSource::CompilerGenerated, diff --git a/src/librustc_ast_lowering/pat.rs b/src/librustc_ast_lowering/pat.rs index 3a3ffd7560b..4d7d21abc8c 100644 --- a/src/librustc_ast_lowering/pat.rs +++ b/src/librustc_ast_lowering/pat.rs @@ -213,6 +213,15 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { } } + fn lower_binding_mode(&mut self, b: &BindingMode) -> hir::BindingAnnotation { + match *b { + BindingMode::ByValue(Mutability::Not) => hir::BindingAnnotation::Unannotated, + BindingMode::ByRef(Mutability::Not) => hir::BindingAnnotation::Ref, + BindingMode::ByValue(Mutability::Mut) => hir::BindingAnnotation::Mutable, + BindingMode::ByRef(Mutability::Mut) => hir::BindingAnnotation::RefMut, + } + } + fn pat_wild_with_node_id_of(&mut self, p: &Pat) -> &'hir hir::Pat<'hir> { self.pat_with_node_id_of(p, hir::PatKind::Wild) }