diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2019-10-06 18:38:15 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2019-10-09 10:17:29 -0700 |
| commit | 2c6bcac535942533489bccdd39515babd0ebb15a (patch) | |
| tree | 0347faba8cdbc3886bc87607954ea5668270fe8e | |
| parent | 4fcaa4a283faa1c5b6b18f7c1dad002dbc1f7bea (diff) | |
| download | rust-2c6bcac535942533489bccdd39515babd0ebb15a.tar.gz rust-2c6bcac535942533489bccdd39515babd0ebb15a.zip | |
review comments
| -rw-r--r-- | src/librustc/hir/mod.rs | 2 | ||||
| -rw-r--r-- | src/librustc_typeck/check/method/mod.rs | 2 | ||||
| -rw-r--r-- | src/librustc_typeck/check/method/suggest.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index 3d473ec0bc7..6a43fa8da16 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 5851a074fa3..434ead50e04 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 c3ca58c834d..c19ea578023 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)); } |
