Skip to content

Commit 334ba81

Browse files
committed
Auto merge of #142220 - workingjubilee:rollup-idgfpof, r=workingjubilee
Rollup of 12 pull requests Successful merges: - #141803 (Remove rustc's notion of "preferred" alignment AKA `__alignof`) - #142053 (Add new Tier-3 targets: `loongarch32-unknown-none*`) - #142089 (Replace all uses of sysroot_candidates with get_or_default_sysroot) - #142108 (compiler: Add track_caller to AbiMapping::unwrap) - #142132 (`tests/ui`: A New Order [6/N]) - #142162 (UnsafePinned: update get() docs and signature to allow shared mutation) - #142171 (`tests/ui`: A New Order [7/N]) - #142179 (store `target.min_global_align` as an `Align`) - #142183 (Added test for 30904) - #142194 (Remove all unused feature gates from the compiler) - #142199 (Do not free disk space in the `mingw-check-tidy` job) - #142210 (Run `mingw-check-tidy` on auto builds) r? `@ghost` `@rustbot` modify labels: rollup
2 parents c31cccb + e91f985 commit 334ba81

File tree

128 files changed

+629
-773
lines changed

Some content is hidden

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

128 files changed

+629
-773
lines changed

Cargo.lock

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ version = "0.4.2"
162162
source = "registry+https://github.com/rust-lang/crates.io-index"
163163
checksum = "01667f6f40216b9a0b2945e05fed5f1ad0ab6470e69cb9378001e37b1c0668e4"
164164
dependencies = [
165-
"object",
165+
"object 0.36.7",
166166
]
167167

168168
[[package]]
@@ -235,7 +235,7 @@ dependencies = [
235235
"cfg-if",
236236
"libc",
237237
"miniz_oxide",
238-
"object",
238+
"object 0.36.7",
239239
"rustc-demangle",
240240
"windows-targets 0.52.6",
241241
]
@@ -2509,7 +2509,19 @@ dependencies = [
25092509
"indexmap",
25102510
"memchr",
25112511
"ruzstd",
2512-
"wasmparser 0.222.1",
2512+
]
2513+
2514+
[[package]]
2515+
name = "object"
2516+
version = "0.37.0"
2517+
source = "registry+https://github.com/rust-lang/crates.io-index"
2518+
checksum = "6273adb7096cf9ab4335f258e627d8230e69d40d45567d678f552dcec6245215"
2519+
dependencies = [
2520+
"crc32fast",
2521+
"hashbrown",
2522+
"indexmap",
2523+
"memchr",
2524+
"wasmparser 0.232.0",
25132525
]
25142526

25152527
[[package]]
@@ -3109,7 +3121,7 @@ dependencies = [
31093121
"build_helper",
31103122
"gimli",
31113123
"libc",
3112-
"object",
3124+
"object 0.36.7",
31133125
"regex",
31143126
"serde_json",
31153127
"similar",
@@ -3422,7 +3434,7 @@ dependencies = [
34223434
"itertools",
34233435
"libc",
34243436
"measureme",
3425-
"object",
3437+
"object 0.37.0",
34263438
"rustc-demangle",
34273439
"rustc_abi",
34283440
"rustc_ast",
@@ -3463,7 +3475,7 @@ dependencies = [
34633475
"either",
34643476
"itertools",
34653477
"libc",
3466-
"object",
3478+
"object 0.37.0",
34673479
"pathdiff",
34683480
"regex",
34693481
"rustc_abi",
@@ -3640,6 +3652,7 @@ dependencies = [
36403652
"rustc_macros",
36413653
"rustc_serialize",
36423654
"rustc_span",
3655+
"smallvec",
36433656
"tracing",
36443657
"unic-langid",
36453658
]
@@ -4495,7 +4508,7 @@ name = "rustc_target"
44954508
version = "0.0.0"
44964509
dependencies = [
44974510
"bitflags",
4498-
"object",
4511+
"object 0.37.0",
44994512
"rustc_abi",
45004513
"rustc_data_structures",
45014514
"rustc_fs_util",
@@ -5247,7 +5260,7 @@ checksum = "9e9c1e705f82a260173f3eec93f2ff6d7807f23ad5a8cc2e7316a891733ea7a1"
52475260
dependencies = [
52485261
"gimli",
52495262
"hashbrown",
5250-
"object",
5263+
"object 0.36.7",
52515264
"tracing",
52525265
]
52535266

@@ -5908,15 +5921,6 @@ dependencies = [
59085921
"indexmap",
59095922
]
59105923

5911-
[[package]]
5912-
name = "wasmparser"
5913-
version = "0.222.1"
5914-
source = "registry+https://github.com/rust-lang/crates.io-index"
5915-
checksum = "fa210fd1788e6b37a1d1930f3389c48e1d6ebd1a013d34fa4b7f9e3e3bf03146"
5916-
dependencies = [
5917-
"bitflags",
5918-
]
5919-
59205924
[[package]]
59215925
name = "wasmparser"
59225926
version = "0.229.0"
@@ -5941,6 +5945,15 @@ dependencies = [
59415945
"semver",
59425946
]
59435947

5948+
[[package]]
5949+
name = "wasmparser"
5950+
version = "0.232.0"
5951+
source = "registry+https://github.com/rust-lang/crates.io-index"
5952+
checksum = "917739b33bb1eb0e9a49bcd2637a351931be4578d0cc4d37b908d7a797784fbb"
5953+
dependencies = [
5954+
"bitflags",
5955+
]
5956+
59445957
[[package]]
59455958
name = "wast"
59465959
version = "230.0.0"

compiler/rustc_abi/src/layout.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_index::bit_set::BitMatrix;
88
use tracing::debug;
99

1010
use crate::{
11-
AbiAndPrefAlign, Align, BackendRepr, FieldsShape, HasDataLayout, IndexSlice, IndexVec, Integer,
11+
AbiAlign, Align, BackendRepr, FieldsShape, HasDataLayout, IndexSlice, IndexVec, Integer,
1212
LayoutData, Niche, NonZeroUsize, Primitive, ReprOptions, Scalar, Size, StructKind, TagEncoding,
1313
Variants, WrappingRange,
1414
};
@@ -173,13 +173,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
173173
// Non-power-of-two vectors have padding up to the next power-of-two.
174174
// If we're a packed repr, remove the padding while keeping the alignment as close
175175
// to a vector as possible.
176-
(
177-
BackendRepr::Memory { sized: true },
178-
AbiAndPrefAlign {
179-
abi: Align::max_aligned_factor(size),
180-
pref: dl.llvmlike_vector_align(size).pref,
181-
},
182-
)
176+
(BackendRepr::Memory { sized: true }, AbiAlign { abi: Align::max_aligned_factor(size) })
183177
} else {
184178
(BackendRepr::SimdVector { element: e_repr, count }, dl.llvmlike_vector_align(size))
185179
};
@@ -435,13 +429,13 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
435429
}
436430

437431
if let Some(pack) = repr.pack {
438-
align = align.min(AbiAndPrefAlign::new(pack));
432+
align = align.min(AbiAlign::new(pack));
439433
}
440434
// The unadjusted ABI alignment does not include repr(align), but does include repr(pack).
441435
// See documentation on `LayoutS::unadjusted_abi_align`.
442436
let unadjusted_abi_align = align.abi;
443437
if let Some(repr_align) = repr.align {
444-
align = align.max(AbiAndPrefAlign::new(repr_align));
438+
align = align.max(AbiAlign::new(repr_align));
445439
}
446440
// `align` must not be modified after this, or `unadjusted_abi_align` could be inaccurate.
447441
let align = align;
@@ -1289,7 +1283,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
12891283
if let StructKind::Prefixed(prefix_size, prefix_align) = kind {
12901284
let prefix_align =
12911285
if let Some(pack) = pack { prefix_align.min(pack) } else { prefix_align };
1292-
align = align.max(AbiAndPrefAlign::new(prefix_align));
1286+
align = align.max(AbiAlign::new(prefix_align));
12931287
offset = prefix_size.align_to(prefix_align);
12941288
}
12951289
for &i in &inverse_memory_index {
@@ -1308,7 +1302,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
13081302

13091303
// Invariant: offset < dl.obj_size_bound() <= 1<<61
13101304
let field_align = if let Some(pack) = pack {
1311-
field.align.min(AbiAndPrefAlign::new(pack))
1305+
field.align.min(AbiAlign::new(pack))
13121306
} else {
13131307
field.align
13141308
};
@@ -1342,7 +1336,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
13421336
// See documentation on `LayoutS::unadjusted_abi_align`.
13431337
let unadjusted_abi_align = align.abi;
13441338
if let Some(repr_align) = repr.align {
1345-
align = align.max(AbiAndPrefAlign::new(repr_align));
1339+
align = align.max(AbiAlign::new(repr_align));
13461340
}
13471341
// `align` must not be modified after this point, or `unadjusted_abi_align` could be inaccurate.
13481342
let align = align;

compiler/rustc_abi/src/layout/ty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_data_structures::intern::Interned;
55
use rustc_macros::HashStable_Generic;
66

77
use crate::{
8-
AbiAndPrefAlign, Align, BackendRepr, FieldsShape, Float, HasDataLayout, LayoutData, Niche,
8+
AbiAlign, Align, BackendRepr, FieldsShape, Float, HasDataLayout, LayoutData, Niche,
99
PointeeInfo, Primitive, Scalar, Size, TargetDataLayout, Variants,
1010
};
1111

@@ -100,7 +100,7 @@ impl<'a> Layout<'a> {
100100
self.0.0.largest_niche
101101
}
102102

103-
pub fn align(self) -> AbiAndPrefAlign {
103+
pub fn align(self) -> AbiAlign {
104104
self.0.0.align
105105
}
106106

0 commit comments

Comments
 (0)