Skip to content

Commit

Permalink
1.54.0: regenerate rustc patches
Browse files Browse the repository at this point in the history
Fixes: #298.
  • Loading branch information
fanquake authored and thepowersgang committed Jul 16, 2023
1 parent ea15e39 commit b6754f5
Showing 1 changed file with 99 additions and 46 deletions.
145 changes: 99 additions & 46 deletions rustc-1.54.0-src.patch
Original file line number Diff line number Diff line change
Expand Up @@ -28,51 +28,111 @@
rustc_data_structures::static_assert_size!(ForeignItemKind, 72);

impl From<ForeignItemKind> for ItemKind {

--- compiler/rustc_hir/src/hir.rs
+++ compiler/rustc_hir/src/hir.rs
@@ -3050,3 +3050,3 @@
@@ -3048,7 +3048,7 @@ impl<'hir> Node<'hir> {
}

// Some nodes are used a lot. Make sure they don't unintentionally get bigger.
-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
+#[cfg(all(not(rust_compiler="mrustc"),target_arch = "x86_64", target_pointer_width = "64"))]
mod size_asserts {
rustc_data_structures::static_assert_size!(super::Block<'static>, 48);
rustc_data_structures::static_assert_size!(super::Expr<'static>, 64);

--- compiler/rustc_middle/src/mir/interpret/error.rs
+++ compiler/rustc_middle/src/mir/interpret/error.rs
@@ -452,2 +452,2 @@
@@ -449,7 +449,7 @@ impl dyn MachineStopType {
}
}

-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
+#[cfg(all(not(rust_compiler="mrustc"), target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(InterpError<'_>, 64);

pub enum InterpError<'tcx> {

--- compiler/rustc_middle/src/mir/mod.rs
+++ compiler/rustc_middle/src/mir/mod.rs
@@ -2203,2 +2203,2 @@
@@ -2200,7 +2200,7 @@ pub enum AggregateKind<'tcx> {
Generator(DefId, SubstsRef<'tcx>, hir::Movability),
}

-#[cfg(target_arch = "x86_64")]
+#[cfg(all(not(rust_compiler="mrustc"), target_arch = "x86_64"))]
static_assert_size!(AggregateKind<'_>, 48);

#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, TyEncodable, TyDecodable, Hash, HashStable)]

--- compiler/rustc_middle/src/thir.rs
+++ compiler/rustc_middle/src/thir.rs
@@ -147,2 +147,2 @@
@@ -144,7 +144,7 @@ pub enum StmtKind<'tcx> {
}

// `Expr` is used a lot. Make sure it doesn't unintentionally get bigger.
-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
+#[cfg(all(not(rust_compiler="mrustc"), target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(Expr<'_>, 144);
--- compiler/rustc_mir/src/interpret/place.rs
+++ compiler/rustc_mir/src/interpret/place.rs
@@ -91,2 +91,2 @@
-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
+#[cfg(all(not(rust_compiler = "mrustc"), target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(Place, 64);
@@ -100,2 +100,2 @@
-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
+#[cfg(all(not(rust_compiler = "mrustc"), target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(PlaceTy<'_>, 80);

/// The Thir trait implementor lowers their expressions (`&'tcx H::Expr`)

--- compiler/rustc_mir/src/interpret/operand.rs
+++ compiler/rustc_mir/src/interpret/operand.rs
@@ -35,2 +35,2 @@
@@ -32,7 +32,7 @@ pub enum Immediate<Tag = ()> {
ScalarPair(ScalarMaybeUninit<Tag>, ScalarMaybeUninit<Tag>),
}

-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
+#[cfg(all(not(rust_compiler = "mrustc"), target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(Immediate, 56);
@@ -90,2 +90,2 @@

impl<Tag> From<ScalarMaybeUninit<Tag>> for Immediate<Tag> {
@@ -87,7 +87,7 @@ pub struct ImmTy<'tcx, Tag = ()> {
pub layout: TyAndLayout<'tcx>,
}

-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
+#[cfg(all(not(rust_compiler = "mrustc"), target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(ImmTy<'_>, 72);

impl<Tag: Copy> std::fmt::Display for ImmTy<'tcx, Tag> {

--- compiler/rustc_mir/src/interpret/place.rs
+++ compiler/rustc_mir/src/interpret/place.rs
@@ -88,7 +88,7 @@ pub enum Place<Tag = ()> {
Local { frame: usize, local: mir::Local },
}

-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
+#[cfg(all(not(rust_compiler = "mrustc"), target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(Place, 64);

#[derive(Copy, Clone, Debug)]
@@ -97,7 +97,7 @@ pub struct PlaceTy<'tcx, Tag = ()> {
pub layout: TyAndLayout<'tcx>,
}

-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
+#[cfg(all(not(rust_compiler = "mrustc"), target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(PlaceTy<'_>, 80);

impl<'tcx, Tag> std::ops::Deref for PlaceTy<'tcx, Tag> {

#
# Disable std_detect's detection logic (use the same logic as miri)
#
--- library/stdarch/crates/std_detect/src/detect/mod.rs
+++ library/stdarch/crates/std_detect/src/detect/mod.rs
@@ -86,7 +86,7 @@ mod bit;
mod cache;

cfg_if! {
- if #[cfg(miri)] {
+ if #[cfg(any(miri, rust_compiler = "mrustc"))] {
// When running under miri all target-features that are not enabled at
// compile-time are reported as disabled at run-time.
//

#
# Disable crc32fast's use of stdarch
Expand All @@ -87,40 +147,10 @@
any(target_arch = "x86", target_arch = "x86_64")
))] {

#
# Disable std_detect's detection logic (use the same logic as miri)
#
--- library/stdarch/crates/std_detect/src/detect/mod.rs
+++ library/stdarch/crates/std_detect/src/detect/mod.rs
@@ -88,2 +88,2 @@
cfg_if! {
- if #[cfg(miri)] {
+ if #[cfg(any(miri, rust_compiler = "mrustc"))] {

# PPV-Lite also needs to know that we're pretending to be miri
--- vendor/ppv-lite86/src/lib.rs
+++ vendor/ppv-lite86/src/lib.rs
@@ -12,9 +12,9 @@
-#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri)))]
+#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri), not(rust_compiler = "mrustc")))]
pub mod x86_64;
-#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri)))]
+#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri), not(rust_compiler = "mrustc")))]
use self::x86_64 as arch;

-#[cfg(any(miri, not(all(feature = "simd", any(target_arch = "x86_64")))))]
+#[cfg(any(miri, rust_compiler = "mrustc", not(all(feature = "simd", any(target_arch = "x86_64")))))]
pub mod generic;
-#[cfg(any(miri, not(all(feature = "simd", any(target_arch = "x86_64")))))]
+#[cfg(any(miri, rust_compiler = "mrustc", not(all(feature = "simd", any(target_arch = "x86_64")))))]
use self::generic as arch;

#
# Backport which is required to support arm64 on macOS 12
# See: https://github.com/alexcrichton/curl-rust/commit/0aea09c428b9bc2bcf46da0fc33959fe3f03c74a
#
diff --git vendor/curl/src/lib.rs vendor/curl/src/lib.rs
index 9f2e50ea9b..50eaba742b 100644
--- vendor/curl/src/lib.rs
+++ vendor/curl/src/lib.rs
@@ -82,6 +82,9 @@ pub mod easy;
Expand Down Expand Up @@ -249,3 +279,26 @@ index 9f2e50ea9b..50eaba742b 100644
+ assert!(INITIALIZED.load(std::sync::atomic::Ordering::SeqCst));
+ }
+}

# PPV-Lite also needs to know that we're pretending to be miri
--- vendor/ppv-lite86/src/lib.rs
+++ vendor/ppv-lite86/src/lib.rs
@@ -9,14 +9,14 @@ mod soft;
mod types;
pub use self::types::*;

-#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri)))]
+#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri), not(rust_compiler = "mrustc")))]
pub mod x86_64;
-#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri)))]
+#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri), not(rust_compiler = "mrustc")))]
use self::x86_64 as arch;

-#[cfg(any(miri, not(all(feature = "simd", any(target_arch = "x86_64")))))]
+#[cfg(any(miri, rust_compiler = "mrustc", not(all(feature = "simd", any(target_arch = "x86_64")))))]
pub mod generic;
-#[cfg(any(miri, not(all(feature = "simd", any(target_arch = "x86_64")))))]
+#[cfg(any(miri, rust_compiler = "mrustc", not(all(feature = "simd", any(target_arch = "x86_64")))))]
use self::generic as arch;

pub use self::arch::{vec128_storage, vec256_storage, vec512_storage};

0 comments on commit b6754f5

Please sign in to comment.