Skip to content

Commit d760df5

Browse files
committed
Auto merge of #63874 - spastorino:places-drive-by-cleanups, r=Centril
Places drive by cleanups Small fixes of things meanwhile I was doing the box part of Place 2.0, based on @Centril reviews.
2 parents 783469c + 53f4734 commit d760df5

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

src/librustc/mir/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,7 @@ pub struct Statement<'tcx> {
15551555
#[cfg(target_arch = "x86_64")]
15561556
static_assert_size!(Statement<'_>, 56);
15571557

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

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

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

2050-
impl<'tcx> Debug for Place<'tcx> {
2050+
impl Debug for Place<'_> {
20512051
fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
20522052
self.iterate(|_place_base, place_projections| {
20532053
// FIXME: remove this collect once we have migrated to slices

src/librustc/mir/visit.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -724,10 +724,6 @@ macro_rules! make_mir_visitor {
724724
}
725725

726726
match & $($mutability)? proj.elem {
727-
ProjectionElem::Deref => {
728-
}
729-
ProjectionElem::Subslice { from: _, to: _ } => {
730-
}
731727
ProjectionElem::Field(_field, ty) => {
732728
self.visit_ty(ty, TyContext::Location(location));
733729
}
@@ -738,11 +734,12 @@ macro_rules! make_mir_visitor {
738734
location
739735
);
740736
}
737+
ProjectionElem::Deref |
738+
ProjectionElem::Subslice { from: _, to: _ } |
741739
ProjectionElem::ConstantIndex { offset: _,
742740
min_length: _,
743-
from_end: _ } => {
744-
}
745-
ProjectionElem::Downcast(_name, _variant_index) => {
741+
from_end: _ } |
742+
ProjectionElem::Downcast(_, _) => {
746743
}
747744
}
748745
}

src/librustc_mir/borrow_check/prefixes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl<'cx, 'tcx> Iterator for Prefixes<'cx, 'tcx> {
136136
}
137137
PrefixSet::All => {
138138
// all prefixes: just blindly enqueue the base
139-
// of the projection
139+
// of the projection.
140140
self.next = Some(PlaceRef {
141141
base: cursor.base,
142142
projection: &proj.base,

src/librustc_mir/dataflow/move_paths/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ impl MovePathLookup {
240240
// alternative will *not* create a MovePath on the fly for an
241241
// unknown place, but will rather return the nearest available
242242
// parent.
243-
pub fn find(&self, place_ref: PlaceRef<'cx, 'tcx>) -> LookupResult {
243+
pub fn find(&self, place_ref: PlaceRef<'_, '_>) -> LookupResult {
244244
place_ref.iterate(|place_base, place_projection| {
245245
let mut result = match place_base {
246246
PlaceBase::Local(local) => self.locals[*local],

0 commit comments

Comments
 (0)