Registry Mirror
Skip to content

File tree

Some content is hidden

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

‎Cargo.lock‎

Lines changed: 44 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,16 +1556,6 @@ version = "1.3.0"
15561556
source = "registry+https://github.com/rust-lang/crates.io-index"
15571557
checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
15581558

1559-
[[package]]
1560-
name = "futf"
1561-
version = "0.1.5"
1562-
source = "registry+https://github.com/rust-lang/crates.io-index"
1563-
checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843"
1564-
dependencies = [
1565-
"mac",
1566-
"new_debug_unreachable",
1567-
]
1568-
15691559
[[package]]
15701560
name = "generate-copyright"
15711561
version = "0.1.0"
@@ -1791,14 +1781,12 @@ dependencies = [
17911781

17921782
[[package]]
17931783
name = "html5ever"
1794-
version = "0.29.1"
1784+
version = "0.39.0"
17951785
source = "registry+https://github.com/rust-lang/crates.io-index"
1796-
checksum = "3b7410cae13cbc75623c98ac4cbfd1f0bedddf3227afc24f370cf0f50a44a11c"
1786+
checksum = "46a1761807faccc9a19e86944bbf40610014066306f96edcdedc2fb714bcb7b8"
17971787
dependencies = [
17981788
"log",
1799-
"mac",
18001789
"markup5ever",
1801-
"match_token",
18021790
]
18031791

18041792
[[package]]
@@ -2424,35 +2412,15 @@ dependencies = [
24242412
"pkg-config",
24252413
]
24262414

2427-
[[package]]
2428-
name = "mac"
2429-
version = "0.1.1"
2430-
source = "registry+https://github.com/rust-lang/crates.io-index"
2431-
checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"
2432-
24332415
[[package]]
24342416
name = "markup5ever"
2435-
version = "0.14.1"
2417+
version = "0.39.0"
24362418
source = "registry+https://github.com/rust-lang/crates.io-index"
2437-
checksum = "c7a7213d12e1864c0f002f52c2923d4556935a43dec5e71355c2760e0f6e7a18"
2419+
checksum = "7122d987ec5f704ee56f6e5b41a7d93722e9aae27ae07cafa4036c4d3f9757de"
24382420
dependencies = [
24392421
"log",
2440-
"phf 0.11.3",
2441-
"phf_codegen",
2442-
"string_cache",
2443-
"string_cache_codegen",
24442422
"tendril",
2445-
]
2446-
2447-
[[package]]
2448-
name = "match_token"
2449-
version = "0.1.0"
2450-
source = "registry+https://github.com/rust-lang/crates.io-index"
2451-
checksum = "88a9689d8d44bf9964484516275f5cd4c9b59457a6940c1d5d0ecbb94510a36b"
2452-
dependencies = [
2453-
"proc-macro2",
2454-
"quote",
2455-
"syn",
2423+
"web_atoms",
24562424
]
24572425

24582426
[[package]]
@@ -2986,56 +2954,57 @@ dependencies = [
29862954

29872955
[[package]]
29882956
name = "phf"
2989-
version = "0.11.3"
2957+
version = "0.12.1"
29902958
source = "registry+https://github.com/rust-lang/crates.io-index"
2991-
checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078"
2959+
checksum = "913273894cec178f401a31ec4b656318d95473527be05c0752cc41cdc32be8b7"
29922960
dependencies = [
2993-
"phf_shared 0.11.3",
2961+
"phf_shared 0.12.1",
29942962
]
29952963

29962964
[[package]]
29972965
name = "phf"
2998-
version = "0.12.1"
2966+
version = "0.13.1"
29992967
source = "registry+https://github.com/rust-lang/crates.io-index"
3000-
checksum = "913273894cec178f401a31ec4b656318d95473527be05c0752cc41cdc32be8b7"
2968+
checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf"
30012969
dependencies = [
3002-
"phf_shared 0.12.1",
2970+
"phf_shared 0.13.1",
2971+
"serde",
30032972
]
30042973

30052974
[[package]]
30062975
name = "phf_codegen"
3007-
version = "0.11.3"
2976+
version = "0.13.1"
30082977
source = "registry+https://github.com/rust-lang/crates.io-index"
3009-
checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a"
2978+
checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1"
30102979
dependencies = [
30112980
"phf_generator",
3012-
"phf_shared 0.11.3",
2981+
"phf_shared 0.13.1",
30132982
]
30142983

30152984
[[package]]
30162985
name = "phf_generator"
3017-
version = "0.11.3"
2986+
version = "0.13.1"
30182987
source = "registry+https://github.com/rust-lang/crates.io-index"
3019-
checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d"
2988+
checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737"
30202989
dependencies = [
3021-
"phf_shared 0.11.3",
3022-
"rand 0.8.5",
2990+
"fastrand",
2991+
"phf_shared 0.13.1",
30232992
]
30242993

30252994
[[package]]
30262995
name = "phf_shared"
3027-
version = "0.11.3"
2996+
version = "0.12.1"
30282997
source = "registry+https://github.com/rust-lang/crates.io-index"
3029-
checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5"
2998+
checksum = "06005508882fb681fd97892ecff4b7fd0fee13ef1aa569f8695dae7ab9099981"
30302999
dependencies = [
30313000
"siphasher",
30323001
]
30333002

30343003
[[package]]
30353004
name = "phf_shared"
3036-
version = "0.12.1"
3005+
version = "0.13.1"
30373006
source = "registry+https://github.com/rust-lang/crates.io-index"
3038-
checksum = "06005508882fb681fd97892ecff4b7fd0fee13ef1aa569f8695dae7ab9099981"
3007+
checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266"
30393008
dependencies = [
30403009
"siphasher",
30413010
]
@@ -5425,25 +5394,24 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
54255394

54265395
[[package]]
54275396
name = "string_cache"
5428-
version = "0.8.9"
5397+
version = "0.9.0"
54295398
source = "registry+https://github.com/rust-lang/crates.io-index"
5430-
checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f"
5399+
checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901"
54315400
dependencies = [
54325401
"new_debug_unreachable",
54335402
"parking_lot",
5434-
"phf_shared 0.11.3",
5403+
"phf_shared 0.13.1",
54355404
"precomputed-hash",
5436-
"serde",
54375405
]
54385406

54395407
[[package]]
54405408
name = "string_cache_codegen"
5441-
version = "0.5.4"
5409+
version = "0.6.1"
54425410
source = "registry+https://github.com/rust-lang/crates.io-index"
5443-
checksum = "c711928715f1fe0fe509c53b43e993a9a557babc2d0a3567d0a3006f1ac931a0"
5411+
checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69"
54445412
dependencies = [
54455413
"phf_generator",
5446-
"phf_shared 0.11.3",
5414+
"phf_shared 0.13.1",
54475415
"proc-macro2",
54485416
"quote",
54495417
]
@@ -5533,12 +5501,11 @@ dependencies = [
55335501

55345502
[[package]]
55355503
name = "tendril"
5536-
version = "0.4.3"
5504+
version = "0.5.0"
55375505
source = "registry+https://github.com/rust-lang/crates.io-index"
5538-
checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0"
5506+
checksum = "c4790fc369d5a530f4b544b094e31388b9b3a37c0f4652ade4505945f5660d24"
55395507
dependencies = [
5540-
"futf",
5541-
"mac",
5508+
"new_debug_unreachable",
55425509
"utf-8",
55435510
]
55445511

@@ -6503,6 +6470,18 @@ dependencies = [
65036470
"wasm-bindgen",
65046471
]
65056472

6473+
[[package]]
6474+
name = "web_atoms"
6475+
version = "0.2.5"
6476+
source = "registry+https://github.com/rust-lang/crates.io-index"
6477+
checksum = "075474b12bcb3d2e3d4546580e9de478eeeead668a1761e2a8860c836b7ef297"
6478+
dependencies = [
6479+
"phf 0.13.1",
6480+
"phf_codegen",
6481+
"string_cache",
6482+
"string_cache_codegen",
6483+
]
6484+
65066485
[[package]]
65076486
name = "winapi-util"
65086487
version = "0.1.11"

‎compiler/rustc_abi/src/layout.rs‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,12 +477,14 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
477477
Ok(Some((repr, _))) => match repr {
478478
// Mismatched alignment (e.g. union is #[repr(packed)]): disable opt
479479
BackendRepr::Scalar(_) | BackendRepr::ScalarPair(_, _)
480-
if repr.scalar_align(dl).unwrap() != align =>
480+
if repr.scalar_platform_align(dl).unwrap() != align =>
481481
{
482482
BackendRepr::Memory { sized: true }
483483
}
484484
// Vectors require at least element alignment, else disable the opt
485-
BackendRepr::SimdVector { element, count: _ } if element.align(dl).abi > align => {
485+
BackendRepr::SimdVector { element, count: _ }
486+
if element.default_align(dl).abi > align =>
487+
{
486488
BackendRepr::Memory { sized: true }
487489
}
488490
// the alignment tests passed and we can use this
@@ -986,7 +988,8 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
986988
// roundtripping pointers through ptrtoint/inttoptr.
987989
(p @ Primitive::Pointer(_), i @ Primitive::Int(..))
988990
| (i @ Primitive::Int(..), p @ Primitive::Pointer(_))
989-
if p.size(dl) == i.size(dl) && p.align(dl) == i.align(dl) =>
991+
if p.size(dl) == i.size(dl)
992+
&& p.default_align(dl) == i.default_align(dl) =>
990993
{
991994
p
992995
}

‎compiler/rustc_abi/src/layout/simple.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl<FieldIdx: Idx, VariantIdx: Idx> LayoutData<FieldIdx, VariantIdx> {
4949
pub fn scalar<C: HasDataLayout>(cx: &C, scalar: Scalar) -> Self {
5050
let largest_niche = Niche::from_scalar(cx, Size::ZERO, scalar);
5151
let size = scalar.size(cx);
52-
let align = scalar.align(cx);
52+
let align = scalar.default_align(cx);
5353

5454
let range = scalar.valid_range(cx);
5555

@@ -90,8 +90,8 @@ impl<FieldIdx: Idx, VariantIdx: Idx> LayoutData<FieldIdx, VariantIdx> {
9090

9191
pub fn scalar_pair<C: HasDataLayout>(cx: &C, a: Scalar, b: Scalar) -> Self {
9292
let dl = cx.data_layout();
93-
let b_align = b.align(dl).abi;
94-
let align = a.align(dl).abi.max(b_align).max(dl.aggregate_align);
93+
let b_align = b.default_align(dl).abi;
94+
let align = a.default_align(dl).abi.max(b_align).max(dl.aggregate_align);
9595
let b_offset = a.size(dl).align_to(b_align);
9696
let size = (b_offset + b.size(dl)).align_to(align);
9797

‎compiler/rustc_abi/src/lib.rs‎

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,7 +1404,11 @@ impl Primitive {
14041404
}
14051405
}
14061406

1407-
pub fn align<C: HasDataLayout>(self, cx: &C) -> AbiAlign {
1407+
/// The *platform-specific* ABI alignment of this primitive.
1408+
///
1409+
/// This is the type alignment for the corresponding built-in.
1410+
/// In other contexts it might have different alignment.
1411+
pub fn default_align<C: HasDataLayout>(self, cx: &C) -> AbiAlign {
14081412
use Primitive::*;
14091413
let dl = cx.data_layout();
14101414

@@ -1579,8 +1583,12 @@ impl Scalar {
15791583
}
15801584
}
15811585

1582-
pub fn align(self, cx: &impl HasDataLayout) -> AbiAlign {
1583-
self.primitive().align(cx)
1586+
/// The *platform-specific* ABI alignment of this scalar.
1587+
///
1588+
/// This is the type alignment for the corresponding built-in.
1589+
/// This is *not* necessarily the correct alignment for a type that has this `BackendRepr::Scalar`!
1590+
pub fn default_align(self, cx: &impl HasDataLayout) -> AbiAlign {
1591+
self.primitive().default_align(cx)
15841592
}
15851593

15861594
pub fn size(self, cx: &impl HasDataLayout) -> Size {
@@ -1792,6 +1800,14 @@ impl IntoDiagArg for NumScalableVectors {
17921800
#[cfg_attr(feature = "nightly", derive(StableHash))]
17931801
pub enum BackendRepr {
17941802
Scalar(Scalar),
1803+
/// The data contained in this type can be entirely represented by two scalars.
1804+
/// The two scalars are listed in *memory* order, so the first is at offset zero
1805+
/// and the second at a non-zero offset.
1806+
/// These need not be `FieldIdx(0)` and `FieldIdx(1)`.
1807+
///
1808+
/// As of June 2026 the offset to the second scalar is the size of the first
1809+
/// scalar rounded up to the platform alignment of the second scalar.
1810+
/// That may soon change, however; see MCP#1007.
17951811
ScalarPair(Scalar, Scalar),
17961812
SimdScalableVector {
17971813
element: Scalar,
@@ -1857,10 +1873,16 @@ impl BackendRepr {
18571873
/// The psABI alignment for a `Scalar` or `ScalarPair`
18581874
///
18591875
/// `None` for other variants.
1860-
pub fn scalar_align<C: HasDataLayout>(&self, cx: &C) -> Option<Align> {
1876+
///
1877+
/// It's unclear whether this is a meaningful operation, and MCP#1007 proposes changes.
1878+
/// You should generally be using the alignment of the place or the type,
1879+
/// not calculating something from the `Scalar`s.
1880+
pub fn scalar_platform_align<C: HasDataLayout>(&self, cx: &C) -> Option<Align> {
18611881
match *self {
1862-
BackendRepr::Scalar(s) => Some(s.align(cx).abi),
1863-
BackendRepr::ScalarPair(s1, s2) => Some(s1.align(cx).max(s2.align(cx)).abi),
1882+
BackendRepr::Scalar(s) => Some(s.default_align(cx).abi),
1883+
BackendRepr::ScalarPair(s1, s2) => {
1884+
Some(s1.default_align(cx).max(s2.default_align(cx)).abi)
1885+
}
18641886
// The align of a Vector can vary in surprising ways
18651887
BackendRepr::SimdVector { .. }
18661888
| BackendRepr::Memory { .. }
@@ -1877,9 +1899,9 @@ impl BackendRepr {
18771899
BackendRepr::Scalar(s) => Some(s.size(cx)),
18781900
// May have some padding between the pair.
18791901
BackendRepr::ScalarPair(s1, s2) => {
1880-
let field2_offset = s1.size(cx).align_to(s2.align(cx).abi);
1902+
let field2_offset = s1.size(cx).align_to(s2.default_align(cx).abi);
18811903
let size = (field2_offset + s2.size(cx)).align_to(
1882-
self.scalar_align(cx)
1904+
self.scalar_platform_align(cx)
18831905
// We absolutely must have an answer here or everything is FUBAR.
18841906
.unwrap(),
18851907
);

‎compiler/rustc_codegen_cranelift/src/value_and_place.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fn codegen_field<'tcx>(
5656
}
5757

5858
fn scalar_pair_calculate_b_offset(tcx: TyCtxt<'_>, a_scalar: Scalar, b_scalar: Scalar) -> Offset32 {
59-
let b_offset = a_scalar.size(&tcx).align_to(b_scalar.align(&tcx).abi);
59+
let b_offset = a_scalar.size(&tcx).align_to(b_scalar.default_align(&tcx).abi);
6060
Offset32::new(b_offset.bytes().try_into().unwrap())
6161
}
6262

‎compiler/rustc_codegen_gcc/src/builder.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
10651065
},
10661066
)
10671067
} else if let abi::BackendRepr::ScalarPair(ref a, ref b) = place.layout.backend_repr {
1068-
let b_offset = a.size(self).align_to(b.align(self).abi);
1068+
let b_offset = a.size(self).align_to(b.default_align(self).abi);
10691069

10701070
let mut load = |i, scalar: &abi::Scalar, align| {
10711071
let ptr = if i == 0 {

‎compiler/rustc_codegen_gcc/src/type_of.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,8 @@ impl<'tcx> LayoutGccExt<'tcx> for TyAndLayout<'tcx> {
325325
return cx.type_i1();
326326
}
327327

328-
let offset = if index == 0 { Size::ZERO } else { a.size(cx).align_to(b.align(cx).abi) };
328+
let offset =
329+
if index == 0 { Size::ZERO } else { a.size(cx).align_to(b.default_align(cx).abi) };
329330
self.scalar_gcc_type_at(cx, scalar, offset)
330331
}
331332

‎compiler/rustc_codegen_llvm/src/builder.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
794794
});
795795
OperandValue::Immediate(llval)
796796
} else if let abi::BackendRepr::ScalarPair(a, b) = place.layout.backend_repr {
797-
let b_offset = a.size(self).align_to(b.align(self).abi);
797+
let b_offset = a.size(self).align_to(b.default_align(self).abi);
798798

799799
let mut load = |i, scalar: abi::Scalar, layout, align, offset| {
800800
let llptr = if i == 0 {

0 commit comments

Comments
 (0)