review comments
This commit is contained in:
parent
4fcaa4a283
commit
2c6bcac535
@ -1054,7 +1054,7 @@ impl Mutability {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn not(self) -> Self {
|
||||
pub fn invert(self) -> Self {
|
||||
match self {
|
||||
MutMutable => MutImmutable,
|
||||
MutImmutable => MutMutable,
|
||||
|
@ -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,
|
||||
|
@ -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));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user