mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
nested-match mutability (proposed by the reviewer)
This commit is contained in:
parent
550319059d
commit
e143fa2156
@ -1781,12 +1781,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
|||||||
// Given we are only considering `ImplicitSelf` types, we needn't consider
|
// Given we are only considering `ImplicitSelf` types, we needn't consider
|
||||||
// the case where we have a mutable pattern to a reference as that would
|
// the case where we have a mutable pattern to a reference as that would
|
||||||
// no longer be an `ImplicitSelf`.
|
// no longer be an `ImplicitSelf`.
|
||||||
TyKind::Rptr(_, mt) if mt.ty.kind.is_implicit_self() && mt.mutbl.is_mut() => {
|
TyKind::Rptr(_, mt) if mt.ty.kind.is_implicit_self() => match mt.mutbl {
|
||||||
hir::ImplicitSelfKind::MutRef
|
hir::Mutability::Not => hir::ImplicitSelfKind::ImmRef,
|
||||||
}
|
hir::Mutability::Mut => hir::ImplicitSelfKind::MutRef,
|
||||||
TyKind::Rptr(_, mt) if mt.ty.kind.is_implicit_self() => {
|
},
|
||||||
hir::ImplicitSelfKind::ImmRef
|
|
||||||
}
|
|
||||||
_ => hir::ImplicitSelfKind::None,
|
_ => hir::ImplicitSelfKind::None,
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
Loading…
Reference in New Issue
Block a user