diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs index f9a1e1e11082..ae79394dfebe 100644 --- a/src/librustc_mir/borrow_check/mod.rs +++ b/src/librustc_mir/borrow_check/mod.rs @@ -1943,7 +1943,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> { } } - /// Whether this value be written or borrowed mutably. + /// Whether this value can be written or borrowed mutably. /// Returns the root place if the place passed in is a projection. fn is_mutable<'d>( &self, @@ -2021,14 +2021,14 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> { ty::RawPtr(tnm) => { match tnm.mutbl { // `*const` raw pointers are not mutable - hir::MutImmutable => return Err(place), + hir::MutImmutable => Err(place), // `*mut` raw pointers are always mutable, regardless of // context. The users have to check by themselves. hir::MutMutable => { - return Ok(RootPlace { + Ok(RootPlace { place, is_local_mutation_allowed, - }); + }) } } }