about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-07-29 06:23:53 +0000
committerbors <bors@rust-lang.org>2025-07-29 06:23:53 +0000
commit552904134b564a74489db50aebe7070fdcce895c (patch)
treebf7659c12573dcb77c14ce7309ac2a8a1878c226 /compiler
parentcb6785f73df1aa3f558796a22a4ab9652cf38e26 (diff)
parentcac55bdd688f4a1bd84263e603ddb34e7d176b51 (diff)
Auto merge of #144624 - Zalathar:rollup-w803jmq, r=Zalathar
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#143883 (Add `--link-targets-dir` argument to linkchecker)
 - rust-lang/rust#144236 (Add `core::mem::DropGuard`)
 - rust-lang/rust#144367 (Move dist-apple-various from x86_64 to aarch64)
 - rust-lang/rust#144539 (constify with_exposed_provenance)
 - rust-lang/rust#144569 (rustc-dev-guide subtree update)
 - rust-lang/rust#144573 (Raw Pointers are Constant PatKinds too)
 - rust-lang/rust#144575 (fixed typo chunks->as_chunks)
 - rust-lang/rust#144578 (Ensure correct aligement of rustc_hir::Lifetime on platforms with lower default alignments.)
 - rust-lang/rust#144582 (fix `Atomic*::as_ptr` wording)
 - rust-lang/rust#144616 (coverage: Regression test for "function name is empty" bug)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_hir/src/hir.rs5
-rw-r--r--compiler/rustc_middle/src/thir.rs2
2 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs
index 96501844264..4ccc2e5a97c 100644
--- a/compiler/rustc_hir/src/hir.rs
+++ b/compiler/rustc_hir/src/hir.rs
@@ -148,6 +148,11 @@ impl From<Ident> for LifetimeSyntax {
 /// `LifetimeSource::OutlivesBound` or `LifetimeSource::PreciseCapturing`
 /// — there's no way to "elide" these lifetimes.
 #[derive(Debug, Copy, Clone, HashStable_Generic)]
+// Raise the aligement to at least 4 bytes - this is relied on in other parts of the compiler(for pointer tagging):
+// https://github.com/rust-lang/rust/blob/ce5fdd7d42aba9a2925692e11af2bd39cf37798a/compiler/rustc_data_structures/src/tagged_ptr.rs#L163
+// Removing this `repr(4)` will cause the compiler to not build on platforms like `m68k` Linux, where the aligement of u32 and usize is only 2.
+// Since `repr(align)` may only raise aligement, this has no effect on platforms where the aligement is already sufficient.
+#[repr(align(4))]
 pub struct Lifetime {
     #[stable_hasher(ignore)]
     pub hir_id: HirId,
diff --git a/compiler/rustc_middle/src/thir.rs b/compiler/rustc_middle/src/thir.rs
index 730c1147684..3dd6d2c8928 100644
--- a/compiler/rustc_middle/src/thir.rs
+++ b/compiler/rustc_middle/src/thir.rs
@@ -838,6 +838,8 @@ pub enum PatKind<'tcx> {
     /// * integer, bool, char or float (represented as a valtree), which will be handled by
     ///   exhaustiveness to cover exactly its own value, similar to `&str`, but these values are
     ///   much simpler.
+    /// * raw pointers derived from integers, other raw pointers will have already resulted in an
+    //    error.
     /// * `String`, if `string_deref_patterns` is enabled.
     Constant {
         value: mir::Const<'tcx>,