Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 767e12b

Browse files
committedMay 28, 2024
Auto merge of rust-lang#125663 - matthiaskrgr:rollup-ej3yuxm, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - rust-lang#117671 (NVPTX: Avoid PassMode::Direct for args in C abi) - rust-lang#124251 (Add an intrinsic for `ptr::metadata`) - rust-lang#125573 (Migrate `run-make/allow-warnings-cmdline-stability` to `rmake.rs`) - rust-lang#125590 (Add a "Setup Python" action for github-hosted runners and remove unnecessary `CUSTOM_MINGW` environment variable) - rust-lang#125598 (Make `ProofTreeBuilder` actually generic over `Interner`) - rust-lang#125637 (rustfmt fixes) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 7717a30 + 2c7d9ce commit 767e12b

File tree

74 files changed

+1311
-330
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1311
-330
lines changed
 

‎compiler/rustc_mir_transform/src/instsimplify.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,8 @@ impl<'tcx> InstSimplifyContext<'tcx, '_> {
219219
for (i, field) in variant.fields.iter_enumerated() {
220220
let field_ty = field.ty(self.tcx, args);
221221
if field_ty == *cast_ty {
222-
let place = place.project_deeper(
223-
&[ProjectionElem::Field(i, *cast_ty)],
224-
self.tcx,
225-
);
222+
let place = place
223+
.project_deeper(&[ProjectionElem::Field(i, *cast_ty)], self.tcx);
226224
let operand = if operand.is_move() {
227225
Operand::Move(place)
228226
} else {

‎compiler/rustc_mir_transform/src/lower_intrinsics.rs

+17
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,23 @@ impl<'tcx> MirPass<'tcx> for LowerIntrinsics {
316316

317317
terminator.kind = TerminatorKind::Goto { target };
318318
}
319+
sym::ptr_metadata => {
320+
let Ok([ptr]) = <[_; 1]>::try_from(std::mem::take(args)) else {
321+
span_bug!(
322+
terminator.source_info.span,
323+
"Wrong number of arguments for ptr_metadata intrinsic",
324+
);
325+
};
326+
let target = target.unwrap();
327+
block.statements.push(Statement {
328+
source_info: terminator.source_info,
329+
kind: StatementKind::Assign(Box::new((
330+
*destination,
331+
Rvalue::UnaryOp(UnOp::PtrMetadata, ptr.node),
332+
))),
333+
});
334+
terminator.kind = TerminatorKind::Goto { target };
335+
}
319336
_ => {}
320337
}
321338
}

‎compiler/rustc_mir_transform/src/promote_consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ impl<'tcx> Validator<'_, 'tcx> {
464464
Rvalue::UnaryOp(op, operand) => {
465465
match op {
466466
// These operations can never fail.
467-
UnOp::Neg | UnOp::Not => {}
467+
UnOp::Neg | UnOp::Not | UnOp::PtrMetadata => {}
468468
}
469469

470470
self.validate_operand(operand)?;
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.