Skip to content

Commit

Permalink
Auto merge of #63874 - spastorino:places-drive-by-cleanups, r=Centril
Browse files Browse the repository at this point in the history
Places drive by cleanups

Small fixes of things meanwhile I was doing the box part of Place 2.0, based on @Centril reviews.
  • Loading branch information
bors committed Aug 25, 2019
2 parents 783469c + 53f4734 commit d760df5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/librustc/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ pub struct Statement<'tcx> {
#[cfg(target_arch = "x86_64")]
static_assert_size!(Statement<'_>, 56);

impl<'tcx> Statement<'tcx> {
impl Statement<'_> {
/// Changes a statement to a nop. This is both faster than deleting instructions and avoids
/// invalidating statement indices in `Location`s.
pub fn make_nop(&mut self) {
Expand Down Expand Up @@ -1677,7 +1677,7 @@ pub struct InlineAsm<'tcx> {
pub inputs: Box<[(Span, Operand<'tcx>)]>,
}

impl<'tcx> Debug for Statement<'tcx> {
impl Debug for Statement<'_> {
fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
use self::StatementKind::*;
match self.kind {
Expand Down Expand Up @@ -2047,7 +2047,7 @@ impl<'p, 'tcx> Iterator for ProjectionsIter<'p, 'tcx> {

impl<'p, 'tcx> FusedIterator for ProjectionsIter<'p, 'tcx> {}

impl<'tcx> Debug for Place<'tcx> {
impl Debug for Place<'_> {
fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
self.iterate(|_place_base, place_projections| {
// FIXME: remove this collect once we have migrated to slices
Expand Down
11 changes: 4 additions & 7 deletions src/librustc/mir/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -724,10 +724,6 @@ macro_rules! make_mir_visitor {
}

match & $($mutability)? proj.elem {
ProjectionElem::Deref => {
}
ProjectionElem::Subslice { from: _, to: _ } => {
}
ProjectionElem::Field(_field, ty) => {
self.visit_ty(ty, TyContext::Location(location));
}
Expand All @@ -738,11 +734,12 @@ macro_rules! make_mir_visitor {
location
);
}
ProjectionElem::Deref |
ProjectionElem::Subslice { from: _, to: _ } |
ProjectionElem::ConstantIndex { offset: _,
min_length: _,
from_end: _ } => {
}
ProjectionElem::Downcast(_name, _variant_index) => {
from_end: _ } |
ProjectionElem::Downcast(_, _) => {
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/borrow_check/prefixes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl<'cx, 'tcx> Iterator for Prefixes<'cx, 'tcx> {
}
PrefixSet::All => {
// all prefixes: just blindly enqueue the base
// of the projection
// of the projection.
self.next = Some(PlaceRef {
base: cursor.base,
projection: &proj.base,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/dataflow/move_paths/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl MovePathLookup {
// alternative will *not* create a MovePath on the fly for an
// unknown place, but will rather return the nearest available
// parent.
pub fn find(&self, place_ref: PlaceRef<'cx, 'tcx>) -> LookupResult {
pub fn find(&self, place_ref: PlaceRef<'_, '_>) -> LookupResult {
place_ref.iterate(|place_base, place_projection| {
let mut result = match place_base {
PlaceBase::Local(local) => self.locals[*local],
Expand Down

0 comments on commit d760df5

Please sign in to comment.