diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index 3d473ec0bc7d..6a43fa8da16d 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -1054,7 +1054,7 @@ impl Mutability { } } - pub fn not(self) -> Self { + pub fn invert(self) -> Self { match self { MutMutable => MutImmutable, MutImmutable => MutMutable, diff --git a/src/librustc_typeck/check/method/mod.rs b/src/librustc_typeck/check/method/mod.rs index 5851a074fa3f..434ead50e042 100644 --- a/src/librustc_typeck/check/method/mod.rs +++ b/src/librustc_typeck/check/method/mod.rs @@ -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, diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs index c3ca58c834db..c19ea5780236 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -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)); }