Skip to content

Commit 2c6bcac

Browse files
committed
review comments
1 parent 4fcaa4a commit 2c6bcac

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/librustc/hir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ impl Mutability {
10541054
}
10551055
}
10561056

1057-
pub fn not(self) -> Self {
1057+
pub fn invert(self) -> Self {
10581058
match self {
10591059
MutMutable => MutImmutable,
10601060
MutImmutable => MutMutable,

src/librustc_typeck/check/method/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
217217
if let ty::Ref(region, t_type, mutability) = self_ty.kind {
218218
let trait_type = self.tcx.mk_ref(region, ty::TypeAndMut {
219219
ty: t_type,
220-
mutbl: mutability.not(),
220+
mutbl: mutability.invert(),
221221
});
222222
match self.lookup_probe(
223223
span,

src/librustc_typeck/check/method/suggest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
582582
if needs_mut {
583583
let trait_type = self.tcx.mk_ref(region, ty::TypeAndMut {
584584
ty: t_type,
585-
mutbl: mutability.not(),
585+
mutbl: mutability.invert(),
586586
});
587587
err.note(&format!("you need `{}` instead of `{}`", trait_type, rcvr_ty));
588588
}

0 commit comments

Comments
 (0)