about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJubilee <46493976+workingjubilee@users.noreply.github.com>2024-06-06 14:46:24 -0700
committerGitHub <noreply@github.com>2024-06-06 14:46:24 -0700
commit30bb51fd0654e9dfa5b1776bc8cd96ed5cb113f8 (patch)
tree741b7bb3edfaa09d6d8cc3af9e8a5e409cfe70c9
parentf4016e2bf5ad92f7de71238d0266e8a810d66d6f (diff)
parentdc91ad05e374c0f5de7f669e5003c2ab9ceaaf46 (diff)
downloadrust-30bb51fd0654e9dfa5b1776bc8cd96ed5cb113f8.tar.gz
rust-30bb51fd0654e9dfa5b1776bc8cd96ed5cb113f8.zip
Rollup merge of #126073 - Zalathar:fulldeps-borrowck, r=jieyouxu
Port `tests/run-make-fulldeps/obtain-borrowck` to ui-fulldeps

Thanks to `{{sysroot-base}}` from #126008, this was also pretty straightforward to port over.
-rw-r--r--tests/run-make-fulldeps/obtain-borrowck/Makefile26
-rw-r--r--tests/ui-fulldeps/auxiliary/obtain-borrowck-input.rs (renamed from tests/run-make-fulldeps/obtain-borrowck/test.rs)2
-rw-r--r--tests/ui-fulldeps/obtain-borrowck.rs (renamed from tests/run-make-fulldeps/obtain-borrowck/driver.rs)7
-rw-r--r--tests/ui-fulldeps/obtain-borrowck.run.stdout (renamed from tests/run-make-fulldeps/obtain-borrowck/output.stdout)0
4 files changed, 9 insertions, 26 deletions
diff --git a/tests/run-make-fulldeps/obtain-borrowck/Makefile b/tests/run-make-fulldeps/obtain-borrowck/Makefile
deleted file mode 100644
index 233f5c9eaf4..00000000000
--- a/tests/run-make-fulldeps/obtain-borrowck/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-include ../../run-make/tools.mk
-
-# This example shows how to implement a rustc driver that retrieves MIR bodies
-# together with the borrow checker information.
-
-# How to run this
-# $ ./x.py test tests/run-make-fulldeps/obtain-borrowck
-
-DRIVER_BINARY := "$(TMPDIR)"/driver
-SYSROOT := $(shell $(RUSTC) --print sysroot)
-
-ifdef IS_WINDOWS
-LIBSTD := -L "$(SYSROOT)\\lib\\rustlib\\$(TARGET)\\lib"
-else
-LIBSTD :=
-endif
-
-all:
-	$(RUSTC) driver.rs -o "$(DRIVER_BINARY)"
-	$(TARGET_RPATH_ENV) "$(DRIVER_BINARY)" --sysroot $(SYSROOT) $(LIBSTD) test.rs -o "$(TMPDIR)/driver_test" > "$(TMPDIR)"/output.stdout
-
-ifdef RUSTC_BLESS_TEST
-	cp "$(TMPDIR)"/output.stdout output.stdout
-else
-	$(DIFF) output.stdout "$(TMPDIR)"/output.stdout
-endif
diff --git a/tests/run-make-fulldeps/obtain-borrowck/test.rs b/tests/ui-fulldeps/auxiliary/obtain-borrowck-input.rs
index f7b4b41feaf..7213e06792a 100644
--- a/tests/run-make-fulldeps/obtain-borrowck/test.rs
+++ b/tests/ui-fulldeps/auxiliary/obtain-borrowck-input.rs
@@ -1,3 +1,5 @@
+#![allow(dead_code)]
+
 trait X {
     fn provided(&self) -> usize {
         5
diff --git a/tests/run-make-fulldeps/obtain-borrowck/driver.rs b/tests/ui-fulldeps/obtain-borrowck.rs
index e67ec8690f8..e6c703addd9 100644
--- a/tests/run-make-fulldeps/obtain-borrowck/driver.rs
+++ b/tests/ui-fulldeps/obtain-borrowck.rs
@@ -1,3 +1,10 @@
+//@ edition: 2021
+//@ run-pass
+//@ check-run-results
+//@ run-flags: --sysroot {{sysroot-base}} --edition=2021 {{src-base}}/auxiliary/obtain-borrowck-input.rs
+//@ ignore-stage1 (requires matching sysroot built with in-tree compiler)
+// ignore-tidy-linelength
+
 #![feature(rustc_private)]
 
 //! This program implements a rustc driver that retrieves MIR bodies with
diff --git a/tests/run-make-fulldeps/obtain-borrowck/output.stdout b/tests/ui-fulldeps/obtain-borrowck.run.stdout
index e011622e6b2..e011622e6b2 100644
--- a/tests/run-make-fulldeps/obtain-borrowck/output.stdout
+++ b/tests/ui-fulldeps/obtain-borrowck.run.stdout