about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-04-13 16:47:39 +0000
committerbors <bors@rust-lang.org>2023-04-13 16:47:39 +0000
commitffb0dd98de5b31fa7989398043c5d0e40941677f (patch)
tree0977d16ab56ed0027a600f3fd100b5a7aeb967af /src/tools
parentb4ea41452f4910261720a6a5511ea4a79679723a (diff)
parent6c8cf4e6afb1b5c5159b09ea43288da0af9a5464 (diff)
downloadrust-ffb0dd98de5b31fa7989398043c5d0e40941677f.tar.gz
rust-ffb0dd98de5b31fa7989398043c5d0e40941677f.zip
Auto merge of #2833 - oli-obk:ui_test_bump, r=RalfJung
Update to new ui_test crate
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/miri/Cargo.lock24
-rw-r--r--src/tools/miri/Cargo.toml2
-rw-r--r--src/tools/miri/tests/compiletest.rs9
-rw-r--r--src/tools/miri/tests/fail/terminate-terminator.rs3
-rw-r--r--src/tools/miri/tests/fail/terminate-terminator.stderr2
-rw-r--r--src/tools/miri/tests/pass/stacked-borrows/int-to-ptr.rs8
6 files changed, 32 insertions, 16 deletions
diff --git a/src/tools/miri/Cargo.lock b/src/tools/miri/Cargo.lock
index 46deebf2cdd..1c44a11f505 100644
--- a/src/tools/miri/Cargo.lock
+++ b/src/tools/miri/Cargo.lock
@@ -27,6 +27,12 @@ dependencies = [
 ]
 
 [[package]]
+name = "anyhow"
+version = "1.0.70"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4"
+
+[[package]]
 name = "atty"
 version = "0.2.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -571,6 +577,18 @@ dependencies = [
 ]
 
 [[package]]
+name = "rustfix"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ecd2853d9e26988467753bd9912c3a126f642d05d229a4b53f5752ee36c56481"
+dependencies = [
+ "anyhow",
+ "log",
+ "serde",
+ "serde_json",
+]
+
+[[package]]
 name = "ryu"
 version = "1.0.12"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -744,11 +762,12 @@ dependencies = [
 
 [[package]]
 name = "ui_test"
-version = "0.5.0"
+version = "0.6.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "54ddb6f31025943e2f9d59237f433711c461a43d9415974c3eb3a4902edc1c1f"
+checksum = "3e10f5f88ce8c331a388deda1e6e2bd533c73ca89cc5f539a3df02ed35c8efba"
 dependencies = [
  "bstr",
+ "cargo-platform",
  "cargo_metadata",
  "color-eyre",
  "colored",
@@ -757,6 +776,7 @@ dependencies = [
  "lazy_static",
  "regex",
  "rustc_version",
+ "rustfix",
  "serde",
  "serde_json",
  "tempfile",
diff --git a/src/tools/miri/Cargo.toml b/src/tools/miri/Cargo.toml
index 6705bf7b007..b962d0c1096 100644
--- a/src/tools/miri/Cargo.toml
+++ b/src/tools/miri/Cargo.toml
@@ -39,7 +39,7 @@ libloading = "0.7"
 
 [dev-dependencies]
 colored = "2"
-ui_test = "0.5"
+ui_test = "0.6.2"
 rustc_version = "0.4"
 # Features chosen to match those required by env_logger, to avoid rebuilds
 regex = { version = "1.5.5", default-features = false, features = ["perf", "std"] }
diff --git a/src/tools/miri/tests/compiletest.rs b/src/tools/miri/tests/compiletest.rs
index 355f6f95310..52deba9108c 100644
--- a/src/tools/miri/tests/compiletest.rs
+++ b/src/tools/miri/tests/compiletest.rs
@@ -2,7 +2,7 @@ use colored::*;
 use regex::bytes::Regex;
 use std::path::{Path, PathBuf};
 use std::{env, process::Command};
-use ui_test::{color_eyre::Result, Config, Mode, OutputConflictHandling};
+use ui_test::{color_eyre::Result, Config, Match, Mode, OutputConflictHandling};
 
 fn miri_path() -> PathBuf {
     PathBuf::from(option_env!("MIRI").unwrap_or(env!("CARGO_BIN_EXE_miri")))
@@ -52,14 +52,13 @@ fn run_tests(mode: Mode, path: &str, target: &str, with_dependencies: bool) -> R
         mode,
         program: miri_path(),
         quiet: false,
+        edition: Some("2018".into()),
         ..Config::default()
     };
 
     let in_rustc_test_suite = option_env!("RUSTC_STAGE").is_some();
 
     // Add some flags we always want.
-    config.args.push("--edition".into());
-    config.args.push("2018".into());
     if in_rustc_test_suite {
         // Less aggressive warnings to make the rustc toolstate management less painful.
         // (We often get warnings when e.g. a feature gets stabilized or some lint gets added/improved.)
@@ -141,8 +140,8 @@ fn run_tests(mode: Mode, path: &str, target: &str, with_dependencies: bool) -> R
 
 macro_rules! regexes {
     ($name:ident: $($regex:expr => $replacement:expr,)*) => {lazy_static::lazy_static! {
-        static ref $name: Vec<(Regex, &'static [u8])> = vec![
-            $((Regex::new($regex).unwrap(), $replacement.as_bytes()),)*
+        static ref $name: Vec<(Match, &'static [u8])> = vec![
+            $((Regex::new($regex).unwrap().into(), $replacement.as_bytes()),)*
         ];
     }};
 }
diff --git a/src/tools/miri/tests/fail/terminate-terminator.rs b/src/tools/miri/tests/fail/terminate-terminator.rs
index f4931659fc8..22ffa1b2711 100644
--- a/src/tools/miri/tests/fail/terminate-terminator.rs
+++ b/src/tools/miri/tests/fail/terminate-terminator.rs
@@ -12,14 +12,13 @@ impl Drop for Foo {
 
 #[inline(always)]
 fn has_cleanup() {
-    //~^ ERROR: panic in a function that cannot unwind
-    // FIXME(nbdd0121): The error should be reported at the call site.
     let _f = Foo;
     panic!();
 }
 
 extern "C" fn panic_abort() {
     has_cleanup();
+    //~^ ERROR: panic in a function that cannot unwind
 }
 
 fn main() {
diff --git a/src/tools/miri/tests/fail/terminate-terminator.stderr b/src/tools/miri/tests/fail/terminate-terminator.stderr
index c046678f73f..8ce4bb7cbb5 100644
--- a/src/tools/miri/tests/fail/terminate-terminator.stderr
+++ b/src/tools/miri/tests/fail/terminate-terminator.stderr
@@ -6,8 +6,6 @@ error: abnormal termination: panic in a function that cannot unwind
   --> $DIR/terminate-terminator.rs:LL:CC
    |
 LL | / fn has_cleanup() {
-LL | |
-LL | |     // FIXME(nbdd0121): The error should be reported at the call site.
 LL | |     let _f = Foo;
 LL | |     panic!();
 LL | | }
diff --git a/src/tools/miri/tests/pass/stacked-borrows/int-to-ptr.rs b/src/tools/miri/tests/pass/stacked-borrows/int-to-ptr.rs
index c3e30627a7c..9e604f9abb8 100644
--- a/src/tools/miri/tests/pass/stacked-borrows/int-to-ptr.rs
+++ b/src/tools/miri/tests/pass/stacked-borrows/int-to-ptr.rs
@@ -23,17 +23,17 @@ fn example(variant: bool) {
         let mut c = 42u32;
 
         let x_unique1 = &mut c;
-        // [..., Unique(1)]
+        // stack: [..., Unique(1)]
 
         let x_raw2 = x_unique1 as *mut u32;
         let x_raw2_addr = x_raw2.expose_addr();
-        // [..., Unique(1), SharedRW(2)]
+        // stack: [..., Unique(1), SharedRW(2)]
 
         let x_unique3 = &mut *x_raw2;
-        // [.., Unique(1), SharedRW(2), Unique(3)]
+        // stack: [.., Unique(1), SharedRW(2), Unique(3)]
 
         assert_eq!(not_so_innocent(x_unique3), x_raw2_addr);
-        // [.., Unique(1), SharedRW(2), Unique(3), ..., SharedRW(4)]
+        // stack: [.., Unique(1), SharedRW(2), Unique(3), ..., SharedRW(4)]
 
         // Do an int2ptr cast. This can pick tag 2 or 4 (the two previously exposed tags).
         // 4 is the "obvious" choice (topmost tag, what we used to do with untagged pointers).