Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1d49df6
Stabilize `VecDeque::retain_back` from `truncate_front`
cammeresi Jan 19, 2026
9566dad
reproduction of miscompilation
dingxiangfei2009 Jun 30, 2026
401dc21
fix remapping in indexing and self-assignments
dingxiangfei2009 Jul 1, 2026
2efdc66
Carry the `b_offset` inside `BackendRepr::ScalarPair`
scottmcm Jul 1, 2026
ad575fe
Oh yeah, clippy too
scottmcm Jul 1, 2026
ef6ad0d
Oh, miri for a different target
scottmcm Jul 1, 2026
6b205c6
Update `browser-ui-test` version to `0.24.1`
GuillaumeGomez Jul 7, 2026
9e394da
Update wasm-component-ld to 0.5.26
alexcrichton Jul 7, 2026
ab783ad
accept extern calls to compiler-builtin functions
folkertdev Jun 23, 2026
47acba7
remove `-Zmiri-force-intrinsic-fallback` test run
folkertdev Jul 4, 2026
63bec90
intrinsics: Add a fallback for non-const libm float functions
tgross35 Jan 10, 2026
7a28eed
wrapping_sh* methods: clarify underspecified reference
RalfJung Jul 7, 2026
594e737
std: support real fd methods on Emscripten
guybedford Jul 8, 2026
47a510b
Tweak `write_immediate_to_mplace_no_validate` to be more consistent w…
scottmcm Jul 7, 2026
bb74b02
Rollup merge of #150946 - tgross35:float-intrinsic-fallback, r=RalfJu…
jhpratt Jul 8, 2026
4d684ce
Rollup merge of #158655 - dingxiangfei2009:fix-remapping, r=cjgillot
jhpratt Jul 8, 2026
193233b
Rollup merge of #158666 - scottmcm:scalar-but-packed, r=workingjubilee
jhpratt Jul 8, 2026
0758f54
Rollup merge of #158920 - alexcrichton:update-wasm-component-ld, r=lqd
jhpratt Jul 8, 2026
1c1b7dd
Rollup merge of #158926 - RalfJung:wrapping_sh, r=Darksonn
jhpratt Jul 8, 2026
4f43818
Rollup merge of #151379 - cammeresi:20260119-trunc, r=clarfonthey
jhpratt Jul 8, 2026
eaa7e12
Rollup merge of #158913 - GuillaumeGomez:update-browser-ui-test, r=ji…
jhpratt Jul 8, 2026
787853d
Rollup merge of #158935 - guybedford:emscripten-owned-fd, r=jhpratt
jhpratt Jul 8, 2026
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
60 changes: 30 additions & 30 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6213,9 +6213,9 @@ dependencies = [

[[package]]
name = "wasi-preview1-component-adapter-provider"
version = "44.0.2"
version = "46.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2211ca2d69a88055eefb06bad741dde3180c9d4020f7e42fea72caba83f9c10c"
checksum = "1b6c48003fe59c201c97a7786ff55feabe6b6f83b598aa9ff5bcc4f94d940bf3"

[[package]]
name = "wasip2"
Expand Down Expand Up @@ -6282,9 +6282,9 @@ dependencies = [

[[package]]
name = "wasm-component-ld"
version = "0.5.25"
version = "0.5.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee72c06c556db23aca2d29e1e183d96efdffa7110b24915629a5091de600a894"
checksum = "51a12709376d4ce64f472699500db3b0e5902cc2bef16fb6ca3098bfdac032fa"
dependencies = [
"anyhow",
"clap",
Expand All @@ -6293,12 +6293,12 @@ dependencies = [
"libc",
"tempfile",
"wasi-preview1-component-adapter-provider",
"wasmparser 0.252.0",
"wasmparser 0.253.0",
"wat",
"windows-sys 0.61.2",
"winsplit",
"wit-component 0.252.0",
"wit-parser 0.252.0",
"wit-component 0.253.0",
"wit-parser 0.253.0",
]

[[package]]
Expand Down Expand Up @@ -6330,12 +6330,12 @@ dependencies = [

[[package]]
name = "wasm-encoder"
version = "0.252.0"
version = "0.253.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8185ae345fa5687c054626ff9a50e7089797a343d9904d1dc9820eb4c4d3196f"
checksum = "59972d6cd272259de647b7c1f1912e45e289c75ffd4be04e10695507cd7e1b59"
dependencies = [
"leb128fmt",
"wasmparser 0.252.0",
"wasmparser 0.253.0",
]

[[package]]
Expand All @@ -6352,14 +6352,14 @@ dependencies = [

[[package]]
name = "wasm-metadata"
version = "0.252.0"
version = "0.253.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b7e08e02a3cd55bf778009d4cd6faae50da011f293644daf78a531a32d6d142"
checksum = "b3f45816ef616806f48498bcd831377de578c4fa51db0c83ab8ceb78cc13523b"
dependencies = [
"anyhow",
"indexmap",
"wasm-encoder 0.252.0",
"wasmparser 0.252.0",
"wasm-encoder 0.253.0",
"wasmparser 0.253.0",
]

[[package]]
Expand Down Expand Up @@ -6396,9 +6396,9 @@ dependencies = [

[[package]]
name = "wasmparser"
version = "0.252.0"
version = "0.253.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3eb099dcadcde5be9eef55e3a337128efd4e44b4c93122487e4d2e4e1c6627c"
checksum = "19db11f87d2486580e1e8b6f494c54df7e0566b87d0b599db843c24019667339"
dependencies = [
"bitflags",
"hashbrown 0.17.0",
Expand All @@ -6409,22 +6409,22 @@ dependencies = [

[[package]]
name = "wast"
version = "252.0.0"
version = "253.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "942a3449d6a593fccc111a6241c8df52bda168af30e40bf9580d4394d7374c65"
checksum = "d3264542f8965c5d84fb1085d924bfba9a6314bb228eff13a2de14d7627664d0"
dependencies = [
"bumpalo",
"leb128fmt",
"memchr",
"unicode-width 0.2.2",
"wasm-encoder 0.252.0",
"wasm-encoder 0.253.0",
]

[[package]]
name = "wat"
version = "1.252.0"
version = "1.253.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c72a4ba7088f7bac94cf516e49882bdf97068904a563768cf249efc839ec42cb"
checksum = "4bfc5ce906144200c972ec617470aa35bd847472e170b26dde3e80541c674055"
dependencies = [
"wast",
]
Expand Down Expand Up @@ -6872,9 +6872,9 @@ dependencies = [

[[package]]
name = "wit-component"
version = "0.252.0"
version = "0.253.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76db0662b590f45d33d0e363fa13539a5a1eecd35d5a12fe208c335461c1053d"
checksum = "dbbd2500ac3488489ee8c6e59b79d7e47e6da5bfb019efd35d5dca57b78af624"
dependencies = [
"anyhow",
"bitflags",
Expand All @@ -6883,10 +6883,10 @@ dependencies = [
"serde",
"serde_derive",
"serde_json",
"wasm-encoder 0.252.0",
"wasm-metadata 0.252.0",
"wasmparser 0.252.0",
"wit-parser 0.252.0",
"wasm-encoder 0.253.0",
"wasm-metadata 0.253.0",
"wasmparser 0.253.0",
"wit-parser 0.253.0",
]

[[package]]
Expand All @@ -6909,9 +6909,9 @@ dependencies = [

[[package]]
name = "wit-parser"
version = "0.252.0"
version = "0.253.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4266bea110371c620ccf3201c5023676046bc4556e5c7cfb5d500bda5ebc162d"
checksum = "4d997b8e5920fcbeec742b58e583325d6419a6aca617ae8075c406a61c65ba8a"
dependencies = [
"anyhow",
"hashbrown 0.17.0",
Expand All @@ -6923,7 +6923,7 @@ dependencies = [
"serde_derive",
"serde_json",
"unicode-ident",
"wasmparser 0.252.0",
"wasmparser 0.253.0",
]

[[package]]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_abi/src/callconv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
unreachable!("`homogeneous_aggregate` should not be called for scalable vectors")
}

BackendRepr::ScalarPair(..) | BackendRepr::Memory { sized: true } => {
BackendRepr::ScalarPair { .. } | BackendRepr::Memory { sized: true } => {
// Helper for computing `homogeneous_aggregate`, allowing a custom
// starting offset (used below for handling variants).
let from_fields_at =
Expand Down
24 changes: 16 additions & 8 deletions compiler/rustc_abi/src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
Err(AbiMismatch) | Ok(None) => BackendRepr::Memory { sized: true },
Ok(Some((repr, _))) => match repr {
// Mismatched alignment (e.g. union is #[repr(packed)]): disable opt
BackendRepr::Scalar(_) | BackendRepr::ScalarPair(_, _)
BackendRepr::Scalar(_) | BackendRepr::ScalarPair { .. }
if repr.scalar_platform_align(dl).unwrap() != align =>
{
BackendRepr::Memory { sized: true }
Expand All @@ -489,7 +489,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
}
// the alignment tests passed and we can use this
BackendRepr::Scalar(..)
| BackendRepr::ScalarPair(..)
| BackendRepr::ScalarPair { .. }
| BackendRepr::SimdVector { .. }
| BackendRepr::SimdScalableVector { .. }
| BackendRepr::Memory { .. } => repr,
Expand Down Expand Up @@ -558,7 +558,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
};
match &mut st.backend_repr {
BackendRepr::Scalar(scalar) => hide_niches(scalar),
BackendRepr::ScalarPair(a, b) => {
BackendRepr::ScalarPair { a, b, b_offset: _ } => {
hide_niches(a);
hide_niches(b);
}
Expand Down Expand Up @@ -701,13 +701,21 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
// When the total alignment and size match, we can use the
// same ABI as the scalar variant with the reserved niche.
BackendRepr::Scalar(_) => BackendRepr::Scalar(niche_scalar),
BackendRepr::ScalarPair(first, second) => {
BackendRepr::ScalarPair { a: first, b: second, b_offset } => {
// Only the niche is guaranteed to be initialised,
// so use union layouts for the other primitive.
if niche_offset == Size::ZERO {
BackendRepr::ScalarPair(niche_scalar, second.to_union())
BackendRepr::ScalarPair {
a: niche_scalar,
b: second.to_union(),
b_offset,
}
} else {
BackendRepr::ScalarPair(first.to_union(), niche_scalar)
BackendRepr::ScalarPair {
a: first.to_union(),
b: niche_scalar,
b_offset,
}
}
}
_ => BackendRepr::Memory { sized: true },
Expand Down Expand Up @@ -1037,7 +1045,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
// If we pick a "clever" (by-value) ABI, we might have to adjust the ABI of the
// variants to ensure they are consistent. This is because a downcast is
// semantically a NOP, and thus should not affect layout.
if matches!(abi, BackendRepr::Scalar(..) | BackendRepr::ScalarPair(..)) {
if matches!(abi, BackendRepr::Scalar(..) | BackendRepr::ScalarPair { .. }) {
for variant in &mut layout_variants {
// We only do this for variants with fields; the others are not accessed anyway.
// Also do not overwrite any already existing "clever" ABIs.
Expand Down Expand Up @@ -1354,7 +1362,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
}
// But scalar pairs are Rust-specific and get
// treated as aggregates by C ABIs anyway.
BackendRepr::ScalarPair(..) => {
BackendRepr::ScalarPair { .. } => {
abi = field.backend_repr;
}
_ => {}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_abi/src/layout/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl<FieldIdx: Idx, VariantIdx: Idx> LayoutData<FieldIdx, VariantIdx> {
offsets: [Size::ZERO, b_offset].into(),
in_memory_order: [FieldIdx::new(0), FieldIdx::new(1)].into(),
},
backend_repr: BackendRepr::ScalarPair(a, b),
backend_repr: BackendRepr::ScalarPair { a, b, b_offset },
largest_niche,
uninhabited: false,
align: AbiAlign::new(align),
Expand Down
38 changes: 23 additions & 15 deletions compiler/rustc_abi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1796,14 +1796,18 @@ impl IntoDiagArg for NumScalableVectors {
pub enum BackendRepr {
Scalar(Scalar),
/// The data contained in this type can be entirely represented by two scalars.
/// The two scalars are listed in *memory* order, so the first is at offset zero
/// and the second at a non-zero offset.
/// The two scalars are listed in *memory* order, so `a` is at offset zero
/// and `b` is at non-zero offset `b_offset`.
/// These need not be `FieldIdx(0)` and `FieldIdx(1)`.
///
/// As of June 2026 the offset to the second scalar is the size of the first
/// scalar rounded up to the platform alignment of the second scalar.
/// As of June 2026 the `b_offset` is always the size of the `a`
/// scalar rounded up to the platform alignment of the `b` scalar.
/// That may soon change, however; see MCP#1007.
ScalarPair(Scalar, Scalar),
ScalarPair {
a: Scalar,
b: Scalar,
b_offset: Size,
},
SimdScalableVector {
element: Scalar,
count: u64,
Expand All @@ -1826,7 +1830,7 @@ impl BackendRepr {
pub fn is_unsized(&self) -> bool {
match *self {
BackendRepr::Scalar(_)
| BackendRepr::ScalarPair(..)
| BackendRepr::ScalarPair { .. }
// FIXME(rustc_scalable_vector): Scalable vectors are `Sized` while the
// `sized_hierarchy` feature is not yet fully implemented. After `sized_hierarchy` is
// fully implemented, scalable vectors will remain `Sized`, they just won't be
Expand Down Expand Up @@ -1875,7 +1879,7 @@ impl BackendRepr {
pub fn scalar_platform_align<C: HasDataLayout>(&self, cx: &C) -> Option<Align> {
match *self {
BackendRepr::Scalar(s) => Some(s.default_align(cx).abi),
BackendRepr::ScalarPair(s1, s2) => {
BackendRepr::ScalarPair { a: s1, b: s2, b_offset: _ } => {
Some(s1.default_align(cx).max(s2.default_align(cx)).abi)
}
// The align of a Vector can vary in surprising ways
Expand All @@ -1893,8 +1897,7 @@ impl BackendRepr {
// No padding in scalars.
BackendRepr::Scalar(s) => Some(s.size(cx)),
// May have some padding between the pair.
BackendRepr::ScalarPair(s1, s2) => {
let field2_offset = s1.size(cx).align_to(s2.default_align(cx).abi);
BackendRepr::ScalarPair { a: _, b: s2, b_offset: field2_offset } => {
let size = (field2_offset + s2.size(cx)).align_to(
self.scalar_platform_align(cx)
// We absolutely must have an answer here or everything is FUBAR.
Expand All @@ -1913,8 +1916,8 @@ impl BackendRepr {
pub fn to_union(&self) -> Self {
match *self {
BackendRepr::Scalar(s) => BackendRepr::Scalar(s.to_union()),
BackendRepr::ScalarPair(s1, s2) => {
BackendRepr::ScalarPair(s1.to_union(), s2.to_union())
BackendRepr::ScalarPair { a: s1, b: s2, b_offset } => {
BackendRepr::ScalarPair { a: s1.to_union(), b: s2.to_union(), b_offset }
}
BackendRepr::SimdVector { element, count } => {
BackendRepr::SimdVector { element: element.to_union(), count }
Expand All @@ -1939,8 +1942,13 @@ impl BackendRepr {
BackendRepr::SimdVector { element: element_l, count: count_l },
BackendRepr::SimdVector { element: element_r, count: count_r },
) => element_l.primitive() == element_r.primitive() && count_l == count_r,
(BackendRepr::ScalarPair(l1, l2), BackendRepr::ScalarPair(r1, r2)) => {
l1.primitive() == r1.primitive() && l2.primitive() == r2.primitive()
(
BackendRepr::ScalarPair { a: l1, b: l2, b_offset: l_offset },
BackendRepr::ScalarPair { a: r1, b: r2, b_offset: r_offset },
) => {
l1.primitive() == r1.primitive()
&& l2.primitive() == r2.primitive()
&& l_offset == r_offset
}
// Everything else must be strictly identical.
_ => self == other,
Expand Down Expand Up @@ -2180,7 +2188,7 @@ impl<FieldIdx: Idx, VariantIdx: Idx> LayoutData<FieldIdx, VariantIdx> {
BackendRepr::Scalar(_)
| BackendRepr::SimdVector { .. }
| BackendRepr::SimdScalableVector { .. } => false,
BackendRepr::ScalarPair(..) | BackendRepr::Memory { .. } => true,
BackendRepr::ScalarPair { .. } | BackendRepr::Memory { .. } => true,
}
}

Expand Down Expand Up @@ -2294,7 +2302,7 @@ impl<FieldIdx: Idx, VariantIdx: Idx> LayoutData<FieldIdx, VariantIdx> {
pub fn is_zst(&self) -> bool {
match self.backend_repr {
BackendRepr::Scalar(_)
| BackendRepr::ScalarPair(..)
| BackendRepr::ScalarPair { .. }
| BackendRepr::SimdScalableVector { .. }
| BackendRepr::SimdVector { .. } => false,
BackendRepr::Memory { sized } => sized && self.size.bytes() == 0,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/src/abi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ fn make_local_place<'tcx>(
);
}
let place = if is_ssa {
if let BackendRepr::ScalarPair(_, _) = layout.backend_repr {
if let BackendRepr::ScalarPair { a: _, b: _, b_offset: _ } = layout.backend_repr {
CPlace::new_var_pair(fx, local, layout)
} else {
CPlace::new_var(fx, local, layout)
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_cranelift/src/abi/pass_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl<'tcx> ArgAbiExt<'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
_ => unreachable!("{:?}", self.layout.backend_repr),
},
PassMode::Pair(attrs_a, attrs_b) => match self.layout.backend_repr {
BackendRepr::ScalarPair(a, b) => {
BackendRepr::ScalarPair { a, b, b_offset: _ } => {
let a = scalar_to_clif_type(tcx, a);
let b = scalar_to_clif_type(tcx, b);
smallvec![
Expand Down Expand Up @@ -167,7 +167,7 @@ impl<'tcx> ArgAbiExt<'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
_ => unreachable!("{:?}", self.layout.backend_repr),
},
PassMode::Pair(attrs_a, attrs_b) => match self.layout.backend_repr {
BackendRepr::ScalarPair(a, b) => {
BackendRepr::ScalarPair { a, b, b_offset: _ } => {
let a = scalar_to_clif_type(tcx, a);
let b = scalar_to_clif_type(tcx, b);
(
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ fn codegen_stmt<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, cur_block: Block, stmt:
}
UnOp::PtrMetadata => match layout.backend_repr {
BackendRepr::Scalar(_) => CValue::zst(dest_layout),
BackendRepr::ScalarPair(_, _) => {
BackendRepr::ScalarPair { a: _, b: _, b_offset: _ } => {
CValue::by_val(operand.load_scalar_pair(fx).1, dest_layout)
}
_ => bug!("Unexpected `PtrToMetadata` operand: {operand:?}"),
Expand Down
Loading
Loading