about summary refs log tree commit diff
path: root/tests/ui-fulldeps/run-compiler-twice.rs
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2025-06-20 18:52:13 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2025-06-24 16:00:04 +0300
commit0be37cab97cf330d0470cf6e7db383d944a90975 (patch)
tree12f53b8cd0369d4612795ebc81d76eabdf934e7a /tests/ui-fulldeps/run-compiler-twice.rs
parente4b9d0141fdd210fcceebd2b67f7be113401c461 (diff)
downloadrust-0be37cab97cf330d0470cf6e7db383d944a90975.tar.gz
rust-0be37cab97cf330d0470cf6e7db383d944a90975.zip
rustc_session: Add a structure for keeping both explicit and default sysroots
Also avoid creating and cloning sysroot unnecessarily.

Diffstat (limited to 'tests/ui-fulldeps/run-compiler-twice.rs')
-rw-r--r--tests/ui-fulldeps/run-compiler-twice.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/ui-fulldeps/run-compiler-twice.rs b/tests/ui-fulldeps/run-compiler-twice.rs
index fa651baa7bc..87504b8301f 100644
--- a/tests/ui-fulldeps/run-compiler-twice.rs
+++ b/tests/ui-fulldeps/run-compiler-twice.rs
@@ -18,7 +18,7 @@ extern crate rustc_span;
 use std::path::{Path, PathBuf};
 
 use rustc_interface::{Linker, interface};
-use rustc_session::config::{Input, Options, OutFileName, OutputType, OutputTypes};
+use rustc_session::config::{Input, Options, OutFileName, OutputType, OutputTypes, Sysroot};
 use rustc_span::FileName;
 
 fn main() {
@@ -32,7 +32,7 @@ fn main() {
         panic!("expected sysroot (and optional linker)");
     }
 
-    let sysroot = PathBuf::from(&args[1]);
+    let sysroot = Sysroot::new(Some(PathBuf::from(&args[1])));
     let linker = args.get(2).map(PathBuf::from);
 
     // compiletest sets the current dir to `output_base_dir` when running.
@@ -43,7 +43,7 @@ fn main() {
     compile(src.to_string(), tmpdir.join("out"), sysroot.clone(), linker.as_deref());
 }
 
-fn compile(code: String, output: PathBuf, sysroot: PathBuf, linker: Option<&Path>) {
+fn compile(code: String, output: PathBuf, sysroot: Sysroot, linker: Option<&Path>) {
     let mut opts = Options::default();
     opts.output_types = OutputTypes::new(&[(OutputType::Exe, None)]);
     opts.sysroot = sysroot;