Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Aug 6, 2024
1 parent 5e26c8d commit 6fdc364
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
6 changes: 6 additions & 0 deletions compiler/rustc_errors/src/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,12 @@ impl HumanEmitter {
);
line += 1;
}
// We add lines above, but if the last line has no explicit newline (which would
// yield an empty line), then we revert one line up to continue with the next
// styled text chunk on the same line as the last one from the prior one. Otherwise
// every `text` would appear on their own line (because even though they didn't end
// in '\n', they advanced `line` by one).
line -= 1;
}
if self.short_message {
let labels = msp
Expand Down
26 changes: 11 additions & 15 deletions tests/run-make/crate-loading/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,15 @@ fn main() {
.input("multiple-dep-versions.rs")
.extern_("dependency", rust_lib_name("dependency"))
.extern_("dep_2_reexport", rust_lib_name("dependency2"))
.inspect(|cmd| eprintln!("{cmd:?}"))
.run_fail();
let stderr = out.stderr_utf8();
assert_contains(
&stderr,
"you have multiple different versions of crate `dependency` in your dependency graph",
);
assert_contains(
&stderr,
"two types coming from two different versions of the same crate are different types even \
if they look the same",
);
assert_contains(&stderr, "this type doesn't implement the required trait");
assert_contains(&stderr, "this type implements the required trait");
assert_contains(&stderr, "this is the required trait");
.run_fail()
.assert_stderr_contains(
"you have multiple different versions of crate `dependency` in your dependency graph",
)
.assert_stderr_contains(
"two types coming from two different versions of the same crate are different types \
even if they look the same",
)
.assert_stderr_contains("this type doesn't implement the required trait")
.assert_stderr_contains("this type implements the required trait")
.assert_stderr_contains("this is the required trait");
}

0 comments on commit 6fdc364

Please sign in to comment.