Skip to content

Commit 3c74e99

Browse files
estebankjneem
authored andcommitted
Change tests to support rustc wording changes
Between rust-lang/rust#126810 and rust-lang/rust#126810 the output of `rustc` for resolution errors is going to change in such a way that some existing cargo tests will fail. Change them to support both the current and future output, so that those PRs can land in `rustc`.
1 parent a4ebae2 commit 3c74e99

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

tests/testsuite/check.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ fn rustc_check_err() {
347347
.with_status(101)
348348
.with_stderr_contains("[CHECKING] bar [..]")
349349
.with_stderr_contains("[CHECKING] foo [..]")
350-
.with_stderr_contains("[..]cannot find function `qux` in [..] `bar`")
350+
.with_stderr_contains("[..]cannot find function `qux`[..]")
351+
.with_stderr_contains("[..]in crate `bar`")
351352
.run();
352353
}
353354

tests/testsuite/message_format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ test src/lib.rs - bar (line 1) ... FAILED
138138
failures:
139139
140140
---- src/lib.rs - bar (line 1) stdout ----
141-
src/lib.rs:2:1: error[E0425]: cannot find function `bar` in this scope
141+
src/lib.rs:2:1: error[E0425]: cannot find function `bar`[..]
142142
[ERROR] aborting due to 1 previous error
143143
Couldn't compile the test.
144144

tests/testsuite/metabuild.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ fn metabuild_failed_build_json() {
765765
"children": "{...}",
766766
"code": "{...}",
767767
"level": "error",
768-
"message": "cannot find function `metabuild` in [..] `mb`",
768+
"message": "cannot find function `metabuild`[..]",
769769
"rendered": "{...}",
770770
"spans": "{...}"
771771
},

tests/testsuite/replace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@ fn override_respects_spec_metadata() {
14431443
[DOWNLOADED] bar v0.1.0+a (registry `dummy-registry`)
14441444
[CHECKING] bar v0.1.0+a
14451445
[CHECKING] foo v0.0.1 ([ROOT]/foo)
1446-
error[E0425]: cannot find function `bar` in crate `bar`
1446+
error[E0425]: cannot find function `bar`[..]
14471447
...
14481448
[ERROR] could not compile `foo` (lib) due to 1 previous error
14491449

0 commit comments

Comments
 (0)