about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-06-21 11:26:49 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2023-06-21 11:29:45 +1000
commit1da13489247ed5b0b6694b2aabb0184f16b50afd (patch)
treead13726c058b2d50d41fcb71ef50fba719311e0b /tests
parentc696307a87cffb6eafee9469858450f116b26988 (diff)
downloadrust-1da13489247ed5b0b6694b2aabb0184f16b50afd.tar.gz
rust-1da13489247ed5b0b6694b2aabb0184f16b50afd.zip
Remove Queries::ongoing_codegen.
There's no need to store it in `Queries`. We can just use a local
variable, because it's always used shortly after it's produced.

The commit also removes the `tcx.analysis()` call in `ongoing_codegen`,
because it's easy to ensure that's done beforehand.

All this makes the dataflow within `run_compiler` easier to follow, at
the cost of making one test slightly more verbose, which I think is a
good tradeoff.
Diffstat (limited to 'tests')
-rw-r--r--tests/run-make-fulldeps/issue-19371/foo.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/run-make-fulldeps/issue-19371/foo.rs b/tests/run-make-fulldeps/issue-19371/foo.rs
index 6d08cfd07f8..9cca6200050 100644
--- a/tests/run-make-fulldeps/issue-19371/foo.rs
+++ b/tests/run-make-fulldeps/issue-19371/foo.rs
@@ -63,10 +63,11 @@ fn compile(code: String, output: PathBuf, sysroot: PathBuf) {
     };
 
     interface::run_compiler(config, |compiler| {
-        // This runs all the passes prior to linking, too.
-        let linker = compiler.enter(|queries| queries.linker());
-        if let Ok(linker) = linker {
-            linker.link();
-        }
+        let linker = compiler.enter(|queries| {
+            queries.global_ctxt()?.enter(|tcx| tcx.analysis(()))?;
+            let ongoing_codegen = queries.ongoing_codegen()?;
+            queries.linker(ongoing_codegen)
+        });
+        linker.unwrap().link();
     });
 }