review comments

This commit is contained in:
Esteban Küber 2019-10-06 18:38:15 -07:00
parent 4fcaa4a283
commit 2c6bcac535
3 changed files with 3 additions and 3 deletions

View File

@ -1054,7 +1054,7 @@ impl Mutability {
}
}
pub fn not(self) -> Self {
pub fn invert(self) -> Self {
match self {
MutMutable => MutImmutable,
MutImmutable => MutMutable,

View File

@ -217,7 +217,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
if let ty::Ref(region, t_type, mutability) = self_ty.kind {
let trait_type = self.tcx.mk_ref(region, ty::TypeAndMut {
ty: t_type,
mutbl: mutability.not(),
mutbl: mutability.invert(),
});
match self.lookup_probe(
span,

View File

@ -582,7 +582,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
if needs_mut {
let trait_type = self.tcx.mk_ref(region, ty::TypeAndMut {
ty: t_type,
mutbl: mutability.not(),
mutbl: mutability.invert(),
});
err.note(&format!("you need `{}` instead of `{}`", trait_type, rcvr_ty));
}