Skip to content

Rollup of 13 pull requests #142213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
56c606c
Remove rustc's notion of "preferred" alignment AKA `__alignof`
workingjubilee Feb 12, 2025
f00a7ff
compiler: add Deref to AbiAlign to ease transition
workingjubilee Jun 4, 2025
27f8efb
Bump object
heiher Jun 4, 2025
387dae9
Move canonicalization into current_dll_path
bjorn3 Jun 5, 2025
dff8ee5
Replace all uses of sysroot_candidates with get_or_default_sysroot
bjorn3 Jun 5, 2025
38d69c3
Add new Tier-3 targets: `loongarch32-unknown-none*`
heiher Jan 9, 2025
d945c85
compiler: Add track_caller to AbiMapping::unwrap
workingjubilee Jun 6, 2025
e4c4c4c
Fix review comments
bjorn3 Jun 6, 2025
17946c2
const-eval error: always say in which item the error occurred
RalfJung Jun 7, 2025
bafe406
UnsafePinned: update get() docs and signature to allow shared mutation
RalfJung Jun 7, 2025
bd0a81e
centralize aliasing rules discussion in UnsafeCell docs
RalfJung Jun 7, 2025
a50bd7c
store `target.min_global_align` as an `Align`
folkertdev Jun 7, 2025
3380a91
cleaned up some tests
Kivooeo Jun 6, 2025
143354c
added test for 30904
Kivooeo Jun 7, 2025
85ce9ee
cleaned up some tests
Kivooeo Jun 7, 2025
9223704
Remove all unused feature gates from the compiler
bjorn3 Jun 8, 2025
b189d29
Do not free disk space in the `mingw-check-tidy` job
Kobzol Jun 8, 2025
e82630c
Run `mingw-check-tidy` on auto builds
Kobzol Jun 8, 2025
fb3eacf
Rollup merge of #141803 - workingjubilee:remove-pref-align, r=bjorn3
workingjubilee Jun 8, 2025
4e9cd5f
Rollup merge of #142008 - RalfJung:const-eval-error-here, r=oli-obk
workingjubilee Jun 8, 2025
a1d735a
Rollup merge of #142053 - heiher:loong32-none, r=wesleywiser
workingjubilee Jun 8, 2025
762622b
Rollup merge of #142089 - bjorn3:sysroot_handling_cleanup3, r=petroch…
workingjubilee Jun 8, 2025
cd104df
Rollup merge of #142108 - workingjubilee:track-caller-in-abi-map, r=j…
workingjubilee Jun 8, 2025
103da86
Rollup merge of #142132 - Kivooeo:tf6, r=workingjubilee
workingjubilee Jun 8, 2025
f82d81b
Rollup merge of #142162 - RalfJung:unsafe-pinned-get, r=workingjubile…
workingjubilee Jun 8, 2025
d04d502
Rollup merge of #142171 - Kivooeo:tf7, r=workingjubilee
workingjubilee Jun 8, 2025
917d225
Rollup merge of #142179 - folkertdev:min-global-align-parse, r=workin…
workingjubilee Jun 8, 2025
1ef5f19
Rollup merge of #142183 - Kivooeo:30904-test, r=compiler-errors
workingjubilee Jun 8, 2025
969f157
Rollup merge of #142194 - bjorn3:less_unstable_features, r=jieyouxu
workingjubilee Jun 8, 2025
5533db4
Rollup merge of #142199 - Kobzol:tidy-speed-up, r=Mark-Simulacrum
workingjubilee Jun 8, 2025
bf5ea18
Rollup merge of #142210 - Kobzol:tidy-auto-builds, r=Mark-Simulacrum
workingjubilee Jun 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
47 changes: 30 additions & 17 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01667f6f40216b9a0b2945e05fed5f1ad0ab6470e69cb9378001e37b1c0668e4"
dependencies = [
"object",
"object 0.36.7",
]

[[package]]
Expand Down Expand Up @@ -235,7 +235,7 @@ dependencies = [
"cfg-if",
"libc",
"miniz_oxide",
"object",
"object 0.36.7",
"rustc-demangle",
"windows-targets 0.52.6",
]
Expand Down Expand Up @@ -2509,7 +2509,19 @@ dependencies = [
"indexmap",
"memchr",
"ruzstd",
"wasmparser 0.222.1",
]

[[package]]
name = "object"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6273adb7096cf9ab4335f258e627d8230e69d40d45567d678f552dcec6245215"
dependencies = [
"crc32fast",
"hashbrown",
"indexmap",
"memchr",
"wasmparser 0.232.0",
]

[[package]]
Expand Down Expand Up @@ -3109,7 +3121,7 @@ dependencies = [
"build_helper",
"gimli",
"libc",
"object",
"object 0.36.7",
"regex",
"serde_json",
"similar",
Expand Down Expand Up @@ -3422,7 +3434,7 @@ dependencies = [
"itertools",
"libc",
"measureme",
"object",
"object 0.37.0",
"rustc-demangle",
"rustc_abi",
"rustc_ast",
Expand Down Expand Up @@ -3463,7 +3475,7 @@ dependencies = [
"either",
"itertools",
"libc",
"object",
"object 0.37.0",
"pathdiff",
"regex",
"rustc_abi",
Expand Down Expand Up @@ -3640,6 +3652,7 @@ dependencies = [
"rustc_macros",
"rustc_serialize",
"rustc_span",
"smallvec",
"tracing",
"unic-langid",
]
Expand Down Expand Up @@ -4495,7 +4508,7 @@ name = "rustc_target"
version = "0.0.0"
dependencies = [
"bitflags",
"object",
"object 0.37.0",
"rustc_abi",
"rustc_data_structures",
"rustc_fs_util",
Expand Down Expand Up @@ -5247,7 +5260,7 @@ checksum = "9e9c1e705f82a260173f3eec93f2ff6d7807f23ad5a8cc2e7316a891733ea7a1"
dependencies = [
"gimli",
"hashbrown",
"object",
"object 0.36.7",
"tracing",
]

Expand Down Expand Up @@ -5908,15 +5921,6 @@ dependencies = [
"indexmap",
]

[[package]]
name = "wasmparser"
version = "0.222.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa210fd1788e6b37a1d1930f3389c48e1d6ebd1a013d34fa4b7f9e3e3bf03146"
dependencies = [
"bitflags",
]

[[package]]
name = "wasmparser"
version = "0.229.0"
Expand All @@ -5941,6 +5945,15 @@ dependencies = [
"semver",
]

[[package]]
name = "wasmparser"
version = "0.232.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "917739b33bb1eb0e9a49bcd2637a351931be4578d0cc4d37b908d7a797784fbb"
dependencies = [
"bitflags",
]

[[package]]
name = "wast"
version = "230.0.0"
Expand Down
20 changes: 7 additions & 13 deletions compiler/rustc_abi/src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rustc_index::bit_set::BitMatrix;
use tracing::debug;

use crate::{
AbiAndPrefAlign, Align, BackendRepr, FieldsShape, HasDataLayout, IndexSlice, IndexVec, Integer,
AbiAlign, Align, BackendRepr, FieldsShape, HasDataLayout, IndexSlice, IndexVec, Integer,
LayoutData, Niche, NonZeroUsize, Primitive, ReprOptions, Scalar, Size, StructKind, TagEncoding,
Variants, WrappingRange,
};
Expand Down Expand Up @@ -173,13 +173,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
// Non-power-of-two vectors have padding up to the next power-of-two.
// If we're a packed repr, remove the padding while keeping the alignment as close
// to a vector as possible.
(
BackendRepr::Memory { sized: true },
AbiAndPrefAlign {
abi: Align::max_aligned_factor(size),
pref: dl.llvmlike_vector_align(size).pref,
},
)
(BackendRepr::Memory { sized: true }, AbiAlign { abi: Align::max_aligned_factor(size) })
} else {
(BackendRepr::SimdVector { element: e_repr, count }, dl.llvmlike_vector_align(size))
};
Expand Down Expand Up @@ -435,13 +429,13 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
}

if let Some(pack) = repr.pack {
align = align.min(AbiAndPrefAlign::new(pack));
align = align.min(AbiAlign::new(pack));
}
// The unadjusted ABI alignment does not include repr(align), but does include repr(pack).
// See documentation on `LayoutS::unadjusted_abi_align`.
let unadjusted_abi_align = align.abi;
if let Some(repr_align) = repr.align {
align = align.max(AbiAndPrefAlign::new(repr_align));
align = align.max(AbiAlign::new(repr_align));
}
// `align` must not be modified after this, or `unadjusted_abi_align` could be inaccurate.
let align = align;
Expand Down Expand Up @@ -1289,7 +1283,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
if let StructKind::Prefixed(prefix_size, prefix_align) = kind {
let prefix_align =
if let Some(pack) = pack { prefix_align.min(pack) } else { prefix_align };
align = align.max(AbiAndPrefAlign::new(prefix_align));
align = align.max(AbiAlign::new(prefix_align));
offset = prefix_size.align_to(prefix_align);
}
for &i in &inverse_memory_index {
Expand All @@ -1308,7 +1302,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {

// Invariant: offset < dl.obj_size_bound() <= 1<<61
let field_align = if let Some(pack) = pack {
field.align.min(AbiAndPrefAlign::new(pack))
field.align.min(AbiAlign::new(pack))
} else {
field.align
};
Expand Down Expand Up @@ -1342,7 +1336,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
// See documentation on `LayoutS::unadjusted_abi_align`.
let unadjusted_abi_align = align.abi;
if let Some(repr_align) = repr.align {
align = align.max(AbiAndPrefAlign::new(repr_align));
align = align.max(AbiAlign::new(repr_align));
}
// `align` must not be modified after this point, or `unadjusted_abi_align` could be inaccurate.
let align = align;
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_abi/src/layout/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rustc_data_structures::intern::Interned;
use rustc_macros::HashStable_Generic;

use crate::{
AbiAndPrefAlign, Align, BackendRepr, FieldsShape, Float, HasDataLayout, LayoutData, Niche,
AbiAlign, Align, BackendRepr, FieldsShape, Float, HasDataLayout, LayoutData, Niche,
PointeeInfo, Primitive, Scalar, Size, TargetDataLayout, Variants,
};

Expand Down Expand Up @@ -100,7 +100,7 @@ impl<'a> Layout<'a> {
self.0.0.largest_niche
}

pub fn align(self) -> AbiAndPrefAlign {
pub fn align(self) -> AbiAlign {
self.0.0.align
}

Expand Down
Loading
Loading