diff options
| -rw-r--r-- | src/tools/compiletest/src/common.rs | 2 | ||||
| -rw-r--r-- | src/tools/compiletest/src/main.rs | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index 41fc67a66f4..365b47447f2 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -101,7 +101,7 @@ pub enum CompareMode { } impl CompareMode { - fn to_str(&self) -> &'static str { + pub(crate) fn to_str(&self) -> &'static str { match *self { CompareMode::Nll => "nll" } diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs index ae4f4aa4046..f61ab7bae45 100644 --- a/src/tools/compiletest/src/main.rs +++ b/src/tools/compiletest/src/main.rs @@ -728,7 +728,11 @@ pub fn make_test_name(config: &Config, testpaths: &TestPaths) -> test::TestName let path = PathBuf::from(config.src_base.file_name().unwrap()) .join(&testpaths.relative_dir) .join(&testpaths.file.file_name().unwrap()); - test::DynTestName(format!("[{}] {}", config.mode, path.display())) + let mode_suffix = match config.compare_mode { + Some(ref mode) => format!(" ({})", mode.to_str()), + None => format!(""), + }; + test::DynTestName(format!("[{}{}] {}", config.mode, mode_suffix, path.display())) } pub fn make_test_closure(config: &Config, testpaths: &TestPaths) -> test::TestFn { |
