Skip to content

Commit 6efcb02

Browse files
committed
review comments
1 parent 169b040 commit 6efcb02

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
@@ -575,7 +575,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
575575
if needs_mut {
576576
let trait_type = self.tcx.mk_ref(region, ty::TypeAndMut {
577577
ty: t_type,
578-
mutbl: mutability.not(),
578+
mutbl: mutability.invert(),
579579
});
580580
err.note(&format!("you need `{}` instead of `{}`", trait_type, rcvr_ty));
581581
}

0 commit comments

Comments
 (0)