about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-04-04 15:05:44 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2025-04-04 22:26:10 +0200
commit2b533e6b49e6c918389f7a38e6b6e7e030f30fed (patch)
treee5ff2c6aa1941315cdbc0e623d93adfbb3da2ac7
parent13400c2c10f04fe49f1765ceb2de837c86b6f915 (diff)
downloadrust-2b533e6b49e6c918389f7a38e6b6e7e030f30fed.tar.gz
rust-2b533e6b49e6c918389f7a38e6b6e7e030f30fed.zip
bootstrap: Only add `rustc_randomized_layouts` if the crate has it
-rw-r--r--library/Cargo.lock5
-rw-r--r--library/proc_macro/Cargo.toml2
-rw-r--r--library/proc_macro/src/lib.rs1
-rw-r--r--src/bootstrap/src/lib.rs2
4 files changed, 8 insertions, 2 deletions
diff --git a/library/Cargo.lock b/library/Cargo.lock
index 23d9d926eba..c45a84b2e34 100644
--- a/library/Cargo.lock
+++ b/library/Cargo.lock
@@ -235,6 +235,7 @@ name = "proc_macro"
 version = "0.0.0"
 dependencies = [
  "core",
+ "rustc-literal-escaper",
  "std",
 ]
 
@@ -311,6 +312,10 @@ dependencies = [
 ]
 
 [[package]]
+name = "rustc-literal-escaper"
+version = "0.0.1"
+
+[[package]]
 name = "rustc-std-workspace-alloc"
 version = "1.99.0"
 dependencies = [
diff --git a/library/proc_macro/Cargo.toml b/library/proc_macro/Cargo.toml
index f65c5e1a330..b8bc2a3af4c 100644
--- a/library/proc_macro/Cargo.toml
+++ b/library/proc_macro/Cargo.toml
@@ -9,4 +9,4 @@ std = { path = "../std" }
 # `core` when resolving doc links. Without this line a different `core` will be
 # loaded from sysroot causing duplicate lang items and other similar errors.
 core = { path = "../core" }
-rustc-literal-escaper = "0.0.1"
+rustc-literal-escaper = { version = "0.0.2", features = ["rustc-dep-of-std"] }
diff --git a/library/proc_macro/src/lib.rs b/library/proc_macro/src/lib.rs
index 35a8af03ba4..f1cf0c5a2db 100644
--- a/library/proc_macro/src/lib.rs
+++ b/library/proc_macro/src/lib.rs
@@ -27,6 +27,7 @@
 #![feature(panic_can_unwind)]
 #![feature(restricted_std)]
 #![feature(rustc_attrs)]
+#![feature(stmt_expr_attributes)]
 #![feature(extend_one)]
 #![recursion_limit = "256"]
 #![allow(internal_features)]
diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
index 843d474f92d..7c60e042142 100644
--- a/src/bootstrap/src/lib.rs
+++ b/src/bootstrap/src/lib.rs
@@ -748,7 +748,7 @@ impl Build {
             features.push("llvm");
         }
         // keep in sync with `bootstrap/compile.rs:rustc_cargo_env`
-        if self.config.rust_randomize_layout {
+        if self.config.rust_randomize_layout && check("rustc_randomized_layouts") {
             features.push("rustc_randomized_layouts");
         }