Change:
Some run-make tests refer to stdlib sources with which seems not ideal. suggested that we should introduce a helper to make this less fragile.
There is already the env var set by compiletest for the source root.
I'm actually dumb, we even already have in the support library:
That's a very descriptive environment variable name, lol

Discussion:
pub fn htmldocck() -> Command { let mut python = python_command(); <del> python.arg(source_path().join("src/etc/htmldocck.py")); </del> <ins> python.arg(source_root().join("src/etc/htmldocck.py")); </ins> python } <del> pub fn source_path() -> PathBuf { </del> <ins> /// Path to the root rust-lang/rust source checkout. pub fn source_root() -> PathBuf { </ins> env_var("S").into() }

// when the unstable no_global_oom_handling feature is turned on. // See https://github.com/rust-lang/rust/pull/84266 <del> use run_make_support::rustc; </del> <ins> use run_make_support::{rustc, source_root}; </ins> fn main() { rustc() .edition("2021") .arg("-Dwarnings") .crate_type("rlib") <del> .input("../../../library/alloc/src/lib.rs") </del> <ins> .input(source_root().join("library/alloc/src/lib.rs")) </ins> .cfg("no_global_oom_handling") .run(); }

// when the unstable no_rc feature is turned on. // See https://github.com/rust-lang/rust/pull/84266 <del> use run_make_support::rustc; </del> <ins> use run_make_support::{rustc, source_root}; </ins> fn main() { rustc() .edition("2021") .arg("-Dwarnings") .crate_type("rlib") <del> .input("../../../library/alloc/src/lib.rs") </del> <ins> .input(source_root().join("library/alloc/src/lib.rs")) </ins> .cfg("no_rc") .run(); }

// when the unstable no_sync feature is turned on. // See https://github.com/rust-lang/rust/pull/84266 <del> use run_make_support::rustc; </del> <ins> use run_make_support::{rustc, source_root}; </ins> fn main() { rustc() .edition("2021") .arg("-Dwarnings") .crate_type("rlib") <del> .input("../../../library/alloc/src/lib.rs") </del> <ins> .input(source_root().join("library/alloc/src/lib.rs")) </ins> .cfg("no_sync") .run(); }

// This test checks that the core library of Rust can be compiled without enabling // support for formatting and parsing floating-point numbers. <del> use run_make_support::rustc; </del> <ins> use run_make_support::{rustc, source_root}; </ins> fn main() { rustc() .edition("2021") .arg("-Dwarnings") .crate_type("rlib") <del> .input("../../../library/core/src/lib.rs") </del> <ins> .input(source_root().join("library/core/src/lib.rs")) </ins> .cfg("no_fp_fmt_parse") .run(); }

// when the no_global_oom_handling feature is turned on. // See https://github.com/rust-lang/rust/pull/110649 <del> use run_make_support::{rustc, tmp_dir}; </del> <ins> use run_make_support::{rustc, source_root, tmp_dir}; </ins> fn main() { rustc() .edition("2021") .arg("-Dwarnings") .crate_type("rlib") <del> .input("../../../library/core/src/lib.rs") </del> <ins> .input(source_root().join("library/core/src/lib.rs")) </ins> .sysroot(tmp_dir().join("fakeroot")) .cfg("no_global_oom_handling") .run();

<del> use run_make_support::{htmldocck, rustc, rustdoc, source_path, tmp_dir}; </del> <ins> use run_make_support::{htmldocck, rustc, rustdoc, source_root, tmp_dir}; </ins> use std::fs::read_dir; use std::path::Path;

// Test that rustdoc will properly load in a theme file and display it in the theme selector. <del> use run_make_support::{htmldocck, rustdoc, source_path, tmp_dir}; </del> <ins> use run_make_support::{htmldocck, rustdoc, source_root, tmp_dir}; </ins> fn main() { let out_dir = tmp_dir().join("rustdoc-themes"); let test_css = out_dir.join("test.css"); let no_script = <del> std::fs::read_to_string(source_path().join("src/librustdoc/html/static/css/noscript.css")) </del> <ins> std::fs::read_to_string(source_root().join("src/librustdoc/html/static/css/noscript.css")) </ins> .unwrap(); let mut test_content = String::new();