Skip to content

Commit 38117b1

Browse files
authored
Rollup merge of #143620 - Muscraft:remove-newline, r=compiler-errors
fix: Remove newline from multiple crate versions note While working on getting `annotate-snippets` to match `rustc`, `annotate-snippets` was adding an extra new line after [this line](https://github.com/rust-lang/rust/blob/a2d45f73c70d9dec57140c9412f83586eda895f8/tests/run-make/crate-loading/multiple-dep-versions.stderr#L9) for [`run-make/crate-loading/multiple-dep-versions.rs`](https://github.com/rust-lang/rust/blob/a2d45f73c70d9dec57140c9412f83586eda895f8/tests/run-make/crate-loading/multiple-dep-versions.rs). I found out this was because there was an explicit `\n` in the message that `annotate-snippets` was respecting, while `rustc` was [skipping it](https://github.com/rust-lang/rust/blob/2f8eeb2bba86b8f457ec602c578473c711f85628/compiler/rustc_errors/src/emitter.rs#L1542). After talking with ``@estebank,`` I was told to remove the newline from the error message. r? ``@estebank``
2 parents 448ca15 + 62951c2 commit 38117b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1933,7 +1933,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
19331933
StringPart::highlighted("multiple different versions".to_string()),
19341934
StringPart::normal(" of crate `".to_string()),
19351935
StringPart::highlighted(format!("{crate_name}")),
1936-
StringPart::normal("` in the dependency graph\n".to_string()),
1936+
StringPart::normal("` in the dependency graph".to_string()),
19371937
],
19381938
);
19391939
if points_at_type {

0 commit comments

Comments
 (0)