move lower_binding_mode -> pat.rs
This commit is contained in:
parent
f75ccdef10
commit
ae6e31b1a3
2 changed files with 9 additions and 9 deletions
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue