diff options
| author | bors <bors@rust-lang.org> | 2025-07-02 20:25:23 +0000 | 
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-07-02 20:25:23 +0000 | 
| commit | 6677875279b560442a07a08d5119b4cd6b3c5593 (patch) | |
| tree | 042116f02b557a7f5cdf876003e854d59bd2553c /compiler/rustc_codegen_ssa/src | |
| parent | 1ce9c977ffcff7c3b12bfe5629a682da0e74a7a1 (diff) | |
| parent | c572231fb911433fea2b5748da3e9bc1bf9cf2c2 (diff) | |
| download | rust-6677875279b560442a07a08d5119b4cd6b3c5593.tar.gz rust-6677875279b560442a07a08d5119b4cd6b3c5593.zip | |
Auto merge of #143337 - matthiaskrgr:rollup-lqwhe0i, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - rust-lang/rust#141847 (Explain `TOCTOU` on the top of `std::fs`, and reference it in functions) - rust-lang/rust#142138 (Add `Vec::into_chunks`) - rust-lang/rust#142321 (Expose elf abi on ppc64 targets) - rust-lang/rust#142886 (ci: aarch64-gnu: Stop skipping `panic_abort_doc_tests`) - rust-lang/rust#143194 (fix bitcast of single-element SIMD vectors) - rust-lang/rust#143231 (Suggest use another lifetime specifier instead of underscore lifetime) - rust-lang/rust#143232 ([COMPILETEST-UNTANGLE 3/N] Use "directives" consistently within compiletest) - rust-lang/rust#143258 (Don't recompute `DisambiguatorState` for every RPITIT in trait definition) - rust-lang/rust#143274 (ci: support optional jobs) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mir/rvalue.rs | 10 | 
1 files changed, 2 insertions, 8 deletions
| diff --git a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs index 7ef04213d32..60cf4e28b5a 100644 --- a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs +++ b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs @@ -1117,7 +1117,7 @@ pub(super) fn transmute_immediate<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>( // While optimizations will remove no-op transmutes, they might still be // there in debug or things that aren't no-op in MIR because they change // the Rust type but not the underlying layout/niche. - if from_scalar == to_scalar { + if from_scalar == to_scalar && from_backend_ty == to_backend_ty { return imm; } @@ -1136,13 +1136,7 @@ pub(super) fn transmute_immediate<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>( assume_scalar_range(bx, imm, from_scalar, from_backend_ty); imm = match (from_scalar.primitive(), to_scalar.primitive()) { - (Int(..) | Float(_), Int(..) | Float(_)) => { - if from_backend_ty == to_backend_ty { - imm - } else { - bx.bitcast(imm, to_backend_ty) - } - } + (Int(..) | Float(_), Int(..) | Float(_)) => bx.bitcast(imm, to_backend_ty), (Pointer(..), Pointer(..)) => bx.pointercast(imm, to_backend_ty), (Int(..), Pointer(..)) => bx.ptradd(bx.const_null(bx.type_ptr()), imm), (Pointer(..), Int(..)) => { | 
