Skip to content

Commit 75808c9

Browse files
committed
Use 2PB less in rustc
1 parent a40646c commit 75808c9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/librustc_codegen_llvm/abi.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@ impl ArgTypeExt<'ll, 'tcx> for ArgType<'tcx, Ty<'tcx>> {
276276
OperandValue::Ref(next(), Some(next()), self.layout.align.abi).store(bx, dst);
277277
}
278278
PassMode::Direct(_) | PassMode::Indirect(_, None) | PassMode::Cast(_) => {
279-
self.store(bx, next(), dst);
279+
let next_param = next();
280+
self.store(bx, next_param, dst);
280281
}
281282
}
282283
}

src/librustc_mir/transform/add_retag.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ impl MirPass for AddRetag {
174174
let src_ty = src.ty(&*local_decls, tcx);
175175
if src_ty.is_region_ptr() {
176176
// The only `Misc` casts on references are those creating raw pointers.
177+
let src = src.clone();
177178
assert!(dest_ty.is_unsafe_ptr());
178179
// Insert escape-to-raw before the cast. We are not concerned
179180
// with stability here: Our EscapeToRaw will not change the value
@@ -184,7 +185,7 @@ impl MirPass for AddRetag {
184185
let source_info = block_data.statements[i].source_info;
185186
block_data.statements.insert(i, Statement {
186187
source_info,
187-
kind: StatementKind::EscapeToRaw(src.clone()),
188+
kind: StatementKind::EscapeToRaw(src),
188189
});
189190
}
190191
}
@@ -194,9 +195,10 @@ impl MirPass for AddRetag {
194195
StatementKind::Assign(ref place, _) if needs_retag(place) => {
195196
// Insert a retag after the assignment.
196197
let source_info = block_data.statements[i].source_info;
198+
let place = place.clone();
197199
block_data.statements.insert(i+1, Statement {
198200
source_info,
199-
kind: StatementKind::Retag { fn_entry: false, place: place.clone() },
201+
kind: StatementKind::Retag { fn_entry: false, place },
200202
});
201203
}
202204
// Do nothing for the rest

0 commit comments

Comments
 (0)