diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-05-14 13:51:02 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-05-14 13:51:02 +0200 |
| commit | 1c4ab86955fad6e63bcd07861226758461d57c33 (patch) | |
| tree | 095786e5cc3f13ed1eed38872a1b2bf0216c80a4 /compiler/rustc_codegen_gcc/tests/lang_tests_common.rs | |
| parent | 414482f6a0d4e7290f614300581a0b55442552a3 (diff) | |
| parent | 6ba33f5e1189a5ae58fb96ce3546e76b13d090f5 (diff) | |
| download | rust-1c4ab86955fad6e63bcd07861226758461d57c33.tar.gz rust-1c4ab86955fad6e63bcd07861226758461d57c33.zip | |
Merge commit '6ba33f5e1189a5ae58fb96ce3546e76b13d090f5' into subtree-update_cg_gcc_2025-05-14
Diffstat (limited to 'compiler/rustc_codegen_gcc/tests/lang_tests_common.rs')
| -rw-r--r-- | compiler/rustc_codegen_gcc/tests/lang_tests_common.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_gcc/tests/lang_tests_common.rs b/compiler/rustc_codegen_gcc/tests/lang_tests_common.rs index d5a0d71c4b2..bdcf14b4b26 100644 --- a/compiler/rustc_codegen_gcc/tests/lang_tests_common.rs +++ b/compiler/rustc_codegen_gcc/tests/lang_tests_common.rs @@ -42,7 +42,9 @@ pub fn main_inner(profile: Profile) { .expect("failed to get absolute path of `gcc-path`") .display() .to_string(); - env::set_var("LD_LIBRARY_PATH", gcc_path); + unsafe { + env::set_var("LD_LIBRARY_PATH", gcc_path); + } fn rust_filter(path: &Path) -> bool { path.is_file() && path.extension().expect("extension").to_str().expect("to_str") == "rs" @@ -67,15 +69,14 @@ pub fn main_inner(profile: Profile) { .test_dir("tests/run") .test_path_filter(filter) .test_extract(|path| { - let lines = std::fs::read_to_string(path) + std::fs::read_to_string(path) .expect("read file") .lines() .skip_while(|l| !l.starts_with("//")) .take_while(|l| l.starts_with("//")) .map(|l| &l[2..]) .collect::<Vec<_>>() - .join("\n"); - lines + .join("\n") }) .test_cmds(move |path| { // Test command 1: Compile `x.rs` into `tempdir/x`. |
