fix test · rust-lang/rust@034b73b (original) (raw)

File tree

2 files changed

lines changed

2 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -1365,6 +1365,14 @@ impl HumanEmitter {
1365 1365 );
1366 1366 line += 1;
1367 1367 }
1368 +// We add lines above, but if the last line has no explicit newline (which would
1369 +// yield an empty line), then we revert one line up to continue with the next
1370 +// styled text chunk on the same line as the last one from the prior one. Otherwise
1371 +// every `text` would appear on their own line (because even though they didn't end
1372 +// in '\n', they advanced `line` by one).
1373 +if line > 0 {
1374 + line -= 1;
1375 +}
1368 1376 }
1369 1377 if self.short_message {
1370 1378 let labels = msp
Original file line number Diff line number Diff line change
@@ -13,19 +13,15 @@ fn main() {
13 13 .input("multiple-dep-versions.rs")
14 14 .extern_("dependency", rust_lib_name("dependency"))
15 15 .extern_("dep_2_reexport", rust_lib_name("dependency2"))
16 -.inspect(|cmd
17 -.run_fail();
18 -let stderr = out.stderr_utf8();
19 -assert_contains(
20 -&stderr,
21 -"you have multiple different versions of crate `dependency` in your dependency graph",
22 -);
23 -assert_contains(
24 -&stderr,
25 -"two types coming from two different versions of the same crate are different types even \
26 - if they look the same",
27 -);
28 -assert_contains(&stderr, "this type doesn't implement the required trait");
29 -assert_contains(&stderr, "this type implements the required trait");
30 -assert_contains(&stderr, "this is the required trait");
16 +.run_fail()
17 +.assert_stderr_contains(
18 +"you have multiple different versions of crate `dependency` in your dependency graph",
19 +)
20 +.assert_stderr_contains(
21 +"two types coming from two different versions of the same crate are different types \
22 + even if they look the same",
23 +)
24 +.assert_stderr_contains("this type doesn't implement the required trait")
25 +.assert_stderr_contains("this type implements the required trait")
26 +.assert_stderr_contains("this is the required trait");
31 27 }