1
Fork 0

Add Mutability::{is_mut,is_not}

This commit is contained in:
Maybe Waffle 2022-11-23 18:22:51 +00:00
parent 9b9c7d0ecc
commit da40965300
14 changed files with 29 additions and 26 deletions

View file

@ -1781,9 +1781,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
// 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
// no longer be an `ImplicitSelf`.
TyKind::Rptr(_, mt)
if mt.ty.kind.is_implicit_self() && mt.mutbl == ast::Mutability::Mut =>
{
TyKind::Rptr(_, mt) if mt.ty.kind.is_implicit_self() && mt.mutbl.is_mut() => {
hir::ImplicitSelfKind::MutRef
}
TyKind::Rptr(_, mt) if mt.ty.kind.is_implicit_self() => {