-
Notifications
You must be signed in to change notification settings - Fork 14k
crater experiment: do not promote function calls in const/static items #148952
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
Conversation
|
@bors try |
crater experiment: do not promote function calls in const/static items
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Lol, this time we can't build clippy.^^ owo-colors fails. This seems to have been fixed a year ago (owo-colors/owo-colors#131), but we depend on an ancient version of owo-colors via prettydiff. A newer prettydiff is available that would fix that, but the latest ui_test depends on an old prettydiff. |
|
@craterbot check |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
Fun, the cranelift backend has a whole bunch of cases of this. Cc @bjorn3 |
|
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
Would this work? diff --git a/build_system/abi_cafe.rs b/build_system/abi_cafe.rs
index 5a393a21..762b2be8 100644
--- a/build_system/abi_cafe.rs
+++ b/build_system/abi_cafe.rs
@@ -11,7 +11,7 @@
"abi-cafe",
);
-static ABI_CAFE: CargoProject = CargoProject::new(&ABI_CAFE_REPO.source_dir(), "abi_cafe_target");
+static ABI_CAFE: CargoProject = CargoProject::new(ABI_CAFE_REPO.source_dir(), "abi_cafe_target");
pub(crate) fn run(
sysroot_kind: SysrootKind,
diff --git a/build_system/build_backend.rs b/build_system/build_backend.rs
index b9fa0ff2..ad6743a6 100644
--- a/build_system/build_backend.rs
+++ b/build_system/build_backend.rs
@@ -6,7 +6,7 @@
use crate::shared_utils::{rustflags_from_env, rustflags_to_cmd_env};
use crate::utils::{CargoProject, Compiler, LogGroup};
-static CG_CLIF: CargoProject = CargoProject::new(&RelPath::source("."), "cg_clif");
+static CG_CLIF: CargoProject = CargoProject::new(RelPath::source("."), "cg_clif");
pub(crate) fn build_backend(
dirs: &Dirs,
diff --git a/build_system/build_sysroot.rs b/build_system/build_sysroot.rs
index 70504ee8..804d50e2 100644
--- a/build_system/build_sysroot.rs
+++ b/build_system/build_sysroot.rs
@@ -140,7 +140,7 @@ fn install_into_sysroot(&self, sysroot: &Path) {
static STDLIB_SRC: RelPath = RelPath::build("stdlib");
static STANDARD_LIBRARY: CargoProject =
- CargoProject::new(&RelPath::build("stdlib/library/sysroot"), "stdlib_target");
+ CargoProject::new(RelPath::build("stdlib/library/sysroot"), "stdlib_target");
fn build_sysroot_for_triple(
dirs: &Dirs,
diff --git a/build_system/tests.rs b/build_system/tests.rs
index dd8cf929..3b6a2e7a 100644
--- a/build_system/tests.rs
+++ b/build_system/tests.rs
@@ -129,7 +129,7 @@ const fn jit_bin(config: &'static str, source: &'static str, args: &'static str)
"rand",
);
-static RAND: CargoProject = CargoProject::new(&RAND_REPO.source_dir(), "rand_target");
+static RAND: CargoProject = CargoProject::new(RAND_REPO.source_dir(), "rand_target");
pub(crate) static REGEX_REPO: GitRepo = GitRepo::github(
"rust-lang",
@@ -139,15 +139,15 @@ const fn jit_bin(config: &'static str, source: &'static str, args: &'static str)
"regex",
);
-static REGEX: CargoProject = CargoProject::new(®EX_REPO.source_dir(), "regex_target");
+static REGEX: CargoProject = CargoProject::new(REGEX_REPO.source_dir(), "regex_target");
static PORTABLE_SIMD_SRC: RelPath = RelPath::build("portable-simd");
-static PORTABLE_SIMD: CargoProject = CargoProject::new(&PORTABLE_SIMD_SRC, "portable-simd_target");
+static PORTABLE_SIMD: CargoProject = CargoProject::new(PORTABLE_SIMD_SRC, "portable-simd_target");
static SYSROOT_TESTS_SRC: RelPath = RelPath::build("sysroot_tests");
-static SYSROOT_TESTS: CargoProject = CargoProject::new(&SYSROOT_TESTS_SRC, "sysroot_tests_target");
+static SYSROOT_TESTS: CargoProject = CargoProject::new(SYSROOT_TESTS_SRC, "sysroot_tests_target");
const EXTENDED_SYSROOT_SUITE: &[TestCase] = &[
TestCase::custom("test.rust-random/rand", &|runner| {
diff --git a/build_system/utils.rs b/build_system/utils.rs
index 3266aa0c..5c7cefa1 100644
--- a/build_system/utils.rs
+++ b/build_system/utils.rs
@@ -75,12 +75,12 @@ pub(crate) fn run_with_runner(&self, program: impl AsRef<OsStr>) -> Command {
}
pub(crate) struct CargoProject {
- source: &'static RelPath,
+ source: RelPath,
target: &'static str,
}
impl CargoProject {
- pub(crate) const fn new(path: &'static RelPath, target: &'static str) -> CargoProject {
+ pub(crate) const fn new(path: RelPath, target: &'static str) -> CargoProject {
CargoProject { source: path, target }
}
Edit: Committed as rust-lang/rustc_codegen_cranelift@2017344 |
|
That should help, yeah. Alternatively, replacing |
|
🎉 Experiment
Footnotes
|
|
We got the data, nothing left to do here. |
This repeats the experiment from #122819. Back then, not even cargo built; since then, time-rs/time#704 has landed so maybe we get a bit further this time.
See #124328 for context.