diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-07-08 19:29:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-08 19:29:41 +0200 |
| commit | 38bfba612411dbb2f7687bfe11a06f5e3e534611 (patch) | |
| tree | 4e2cc195e4ebed6ed3150870a00c87fdd6b1bc64 | |
| parent | a15162061bf41b621f1908b622f4d531dbbd0444 (diff) | |
| parent | 62951c2e07dea61ec20fd6f6e849400f4cd194c3 (diff) | |
| download | rust-38bfba612411dbb2f7687bfe11a06f5e3e534611.tar.gz rust-38bfba612411dbb2f7687bfe11a06f5e3e534611.zip | |
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```
| -rw-r--r-- | compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs index 28d572b303a..cd3e6c4bc54 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs @@ -1933,7 +1933,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { StringPart::highlighted("multiple different versions".to_string()), StringPart::normal(" of crate `".to_string()), StringPart::highlighted(format!("{crate_name}")), - StringPart::normal("` in the dependency graph\n".to_string()), + StringPart::normal("` in the dependency graph".to_string()), ], ); if points_at_type { |
