about summary refs log tree commit diff
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2024-06-05 17:31:01 +1000
committerZalathar <Zalathar@users.noreply.github.com>2024-06-07 00:41:31 +1000
commitdc91ad05e374c0f5de7f669e5003c2ab9ceaaf46 (patch)
tree3938f5a2868f417b3e31ec48afc382f7481c355a
parent67caf52fbc4f10cdf427f04e6cbb35c8b9d96bb7 (diff)
downloadrust-dc91ad05e374c0f5de7f669e5003c2ab9ceaaf46.tar.gz
rust-dc91ad05e374c0f5de7f669e5003c2ab9ceaaf46.zip
Port `tests/run-make-fulldeps/obtain-borrowck` to ui-fulldeps
-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