summary refs log tree commit diff
path: root/tests/run-make/crate-loading-crate-depends-on-itself/rmake.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run-make/crate-loading-crate-depends-on-itself/rmake.rs')
-rw-r--r--tests/run-make/crate-loading-crate-depends-on-itself/rmake.rs25
1 files changed, 12 insertions, 13 deletions
diff --git a/tests/run-make/crate-loading-crate-depends-on-itself/rmake.rs b/tests/run-make/crate-loading-crate-depends-on-itself/rmake.rs
index f52f3d791a7..57e0cab92f1 100644
--- a/tests/run-make/crate-loading-crate-depends-on-itself/rmake.rs
+++ b/tests/run-make/crate-loading-crate-depends-on-itself/rmake.rs
@@ -7,26 +7,25 @@
 // and traits of the different versions are mixed, we produce diagnostic output and not an ICE.
 // #133563
 
-use run_make_support::{rust_lib_name, rustc};
+use run_make_support::{diff, rust_lib_name, rustc};
 
 fn main() {
     rustc().input("foo-prev.rs").run();
 
-    rustc()
+    let out = rustc()
         .extra_filename("current")
         .metadata("current")
         .input("foo-current.rs")
         .extern_("foo", rust_lib_name("foo"))
         .run_fail()
-        .assert_stderr_contains(r#"
-note: there are multiple different versions of crate `foo` in the dependency graph
-  --> foo-current.rs:7:1
-   |
-4  | extern crate foo;
-   | ----------------- one version of crate `foo` is used here, as a direct dependency of the current crate
-5  |
-6  | pub struct Struct;
-   | ----------------- this type implements the required trait
-7  | pub trait Trait {}
-   | ^^^^^^^^^^^^^^^ this is the required trait"#);
+        .stderr_utf8();
+
+    // We don't remap the path of the `foo-prev` crate, so we remap it here.
+    let mut lines: Vec<_> = out.lines().collect();
+    for line in &mut lines {
+        if line.starts_with("  ::: ") {
+            *line = "  ::: foo-prev.rs:X:Y";
+        }
+    }
+    diff().expected_file("foo.stderr").actual_text("(rustc)", &lines.join("\n")).run();
 }