1
Fork 0

mir/borrowck: remove redundant returns

This commit is contained in:
ljedrz 2018-10-16 15:25:18 +02:00
parent cd03f5d1e0
commit f53d2b257c

View file

@ -1589,7 +1589,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
Place::Local(_) => panic!("should have move path for every Local"), Place::Local(_) => panic!("should have move path for every Local"),
Place::Projection(_) => panic!("PrefixSet::All meant don't stop for Projection"), Place::Projection(_) => panic!("PrefixSet::All meant don't stop for Projection"),
Place::Promoted(_) | Place::Promoted(_) |
Place::Static(_) => return Err(NoMovePathFound::ReachedStatic), Place::Static(_) => Err(NoMovePathFound::ReachedStatic),
} }
} }
@ -1881,7 +1881,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
} }
// at this point, we have set up the error reporting state. // at this point, we have set up the error reporting state.
if previously_initialized { return if previously_initialized {
self.report_mutability_error( self.report_mutability_error(
place, place,
span, span,
@ -1889,10 +1889,10 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
error_access, error_access,
location, location,
); );
return true; true
} else { } else {
return false; false
} };
} }
fn is_local_ever_initialized(&self, fn is_local_ever_initialized(&self,
@ -1907,7 +1907,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
return Some(index); return Some(index);
} }
} }
return None; None
} }
/// Adds the place into the used mutable variables set /// Adds the place into the used mutable variables set