Skip to content

Commit f81c76a

Browse files
committed
Auto merge of #2833 - oli-obk:ui_test_bump, r=RalfJung
Update to new ui_test crate
2 parents 5665ff8 + 162d6e7 commit f81c76a

File tree

6 files changed

+32
-16
lines changed

6 files changed

+32
-16
lines changed

Cargo.lock

+22-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ libloading = "0.7"
3939

4040
[dev-dependencies]
4141
colored = "2"
42-
ui_test = "0.5"
42+
ui_test = "0.6.2"
4343
rustc_version = "0.4"
4444
# Features chosen to match those required by env_logger, to avoid rebuilds
4545
regex = { version = "1.5.5", default-features = false, features = ["perf", "std"] }

tests/compiletest.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use colored::*;
22
use regex::bytes::Regex;
33
use std::path::{Path, PathBuf};
44
use std::{env, process::Command};
5-
use ui_test::{color_eyre::Result, Config, Mode, OutputConflictHandling};
5+
use ui_test::{color_eyre::Result, Config, Match, Mode, OutputConflictHandling};
66

77
fn miri_path() -> PathBuf {
88
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
5252
mode,
5353
program: miri_path(),
5454
quiet: false,
55+
edition: Some("2018".into()),
5556
..Config::default()
5657
};
5758

5859
let in_rustc_test_suite = option_env!("RUSTC_STAGE").is_some();
5960

6061
// Add some flags we always want.
61-
config.args.push("--edition".into());
62-
config.args.push("2018".into());
6362
if in_rustc_test_suite {
6463
// Less aggressive warnings to make the rustc toolstate management less painful.
6564
// (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
141140

142141
macro_rules! regexes {
143142
($name:ident: $($regex:expr => $replacement:expr,)*) => {lazy_static::lazy_static! {
144-
static ref $name: Vec<(Regex, &'static [u8])> = vec![
145-
$((Regex::new($regex).unwrap(), $replacement.as_bytes()),)*
143+
static ref $name: Vec<(Match, &'static [u8])> = vec![
144+
$((Regex::new($regex).unwrap().into(), $replacement.as_bytes()),)*
146145
];
147146
}};
148147
}

tests/fail/terminate-terminator.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ impl Drop for Foo {
1212

1313
#[inline(always)]
1414
fn has_cleanup() {
15-
//~^ ERROR: panic in a function that cannot unwind
16-
// FIXME(nbdd0121): The error should be reported at the call site.
1715
let _f = Foo;
1816
panic!();
1917
}
2018

2119
extern "C" fn panic_abort() {
2220
has_cleanup();
21+
//~^ ERROR: panic in a function that cannot unwind
2322
}
2423

2524
fn main() {

tests/fail/terminate-terminator.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ error: abnormal termination: panic in a function that cannot unwind
66
--> $DIR/terminate-terminator.rs:LL:CC
77
|
88
LL | / fn has_cleanup() {
9-
LL | |
10-
LL | | // FIXME(nbdd0121): The error should be reported at the call site.
119
LL | | let _f = Foo;
1210
LL | | panic!();
1311
LL | | }

tests/pass/stacked-borrows/int-to-ptr.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ fn example(variant: bool) {
2323
let mut c = 42u32;
2424

2525
let x_unique1 = &mut c;
26-
// [..., Unique(1)]
26+
// stack: [..., Unique(1)]
2727

2828
let x_raw2 = x_unique1 as *mut u32;
2929
let x_raw2_addr = x_raw2.expose_addr();
30-
// [..., Unique(1), SharedRW(2)]
30+
// stack: [..., Unique(1), SharedRW(2)]
3131

3232
let x_unique3 = &mut *x_raw2;
33-
// [.., Unique(1), SharedRW(2), Unique(3)]
33+
// stack: [.., Unique(1), SharedRW(2), Unique(3)]
3434

3535
assert_eq!(not_so_innocent(x_unique3), x_raw2_addr);
36-
// [.., Unique(1), SharedRW(2), Unique(3), ..., SharedRW(4)]
36+
// stack: [.., Unique(1), SharedRW(2), Unique(3), ..., SharedRW(4)]
3737

3838
// Do an int2ptr cast. This can pick tag 2 or 4 (the two previously exposed tags).
3939
// 4 is the "obvious" choice (topmost tag, what we used to do with untagged pointers).

0 commit comments

Comments
 (0)