Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't redundantly repeat field names #80487

Merged
merged 1 commit into from
Dec 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/src/graph/scc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ where
successors_len: 0,
min_depth: depth,
min_cycle_root: successor_node,
successor_node: successor_node,
successor_node,
});
continue 'recurse;
}
Expand Down
5 changes: 1 addition & 4 deletions compiler/rustc_middle/src/hir/place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,7 @@ impl<'tcx> PlaceWithHirId<'tcx> {
base: PlaceBase,
projections: Vec<Projection<'tcx>>,
) -> PlaceWithHirId<'tcx> {
PlaceWithHirId {
hir_id: hir_id,
place: Place { base_ty: base_ty, base: base, projections: projections },
}
PlaceWithHirId { hir_id, place: Place { base_ty, base, projections } }
}
}

Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/mir/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,13 @@ macro_rules! make_mir_visitor {

let mut index = 0;
for statement in statements {
let location = Location { block: block, statement_index: index };
let location = Location { block, statement_index: index };
self.visit_statement(statement, location);
index += 1;
}

if let Some(terminator) = terminator {
let location = Location { block: block, statement_index: index };
let location = Location { block, statement_index: index };
self.visit_terminator(terminator, location);
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1634,7 +1634,7 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {

let layout = tcx.intern_layout(Layout {
variants: Variants::Multiple {
tag: tag,
tag,
tag_encoding: TagEncoding::Direct,
tag_field: tag_index,
variants,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/check/upvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {

let min_cap_list = match root_var_min_capture_list.get_mut(&var_hir_id) {
None => {
let min_cap_list = vec![ty::CapturedPlace { place: place, info: capture_info }];
let min_cap_list = vec![ty::CapturedPlace { place, info: capture_info }];
root_var_min_capture_list.insert(var_hir_id, min_cap_list);
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/mem_categorization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ impl<'a, 'tcx> MemCategorizationContext<'a, 'tcx> {
kind: ProjectionKind,
) -> PlaceWithHirId<'tcx> {
let mut projections = base_place.place.projections;
projections.push(Projection { kind: kind, ty: ty });
projections.push(Projection { kind, ty });
let ret = PlaceWithHirId::new(
node.hir_id(),
base_place.place.base_ty,
Expand Down