diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs
index 634afacf5390..f7f842393084 100644
--- a/compiler/rustc_errors/src/emitter.rs
+++ b/compiler/rustc_errors/src/emitter.rs
@@ -2216,12 +2216,7 @@ impl HumanEmitter {
if let DisplaySuggestion::Diff | DisplaySuggestion::Underline | DisplaySuggestion::Add =
show_code_change
{
- for mut part in parts {
- // If this is a replacement of, e.g. `"a"` into `"ab"`, adjust the
- // suggestion and snippet to look as if we just suggested to add
- // `"b"`, which is typically much easier for the user to understand.
- part.trim_trivial_replacements(sm);
-
+ for part in parts {
let snippet = if let Ok(snippet) = sm.span_to_snippet(part.span) {
snippet
} else {
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index 0016dacc8b23..ceed0cd94fc9 100644
--- a/compiler/rustc_errors/src/lib.rs
+++ b/compiler/rustc_errors/src/lib.rs
@@ -403,7 +403,12 @@ impl CodeSuggestion {
// or deleted code in order to point at the correct column *after* substitution.
let mut acc = 0;
let mut only_capitalization = false;
- for part in &substitution.parts {
+ for part in &mut substitution.parts {
+ // If this is a replacement of, e.g. `"a"` into `"ab"`, adjust the
+ // suggestion and snippet to look as if we just suggested to add
+ // `"b"`, which is typically much easier for the user to understand.
+ part.trim_trivial_replacements(sm);
+
only_capitalization |= is_case_difference(sm, &part.snippet, part.span);
let cur_lo = sm.lookup_char_pos(part.span.lo());
if prev_hi.line == cur_lo.line {
diff --git a/src/tools/clippy/tests/ui/async_yields_async.stderr b/src/tools/clippy/tests/ui/async_yields_async.stderr
index 474914299d06..8c023d0d61f4 100644
--- a/src/tools/clippy/tests/ui/async_yields_async.stderr
+++ b/src/tools/clippy/tests/ui/async_yields_async.stderr
@@ -14,9 +14,9 @@ LL | | };
= help: to override `-D warnings` add `#[allow(clippy::async_yields_async)]`
help: consider awaiting this value
|
-LL ~ async {
-LL + 3
-LL + }.await
+LL | async {
+LL | 3
+LL ~ }.await
|
error: an async construct yields a type which is itself awaitable
@@ -46,9 +46,9 @@ LL | | };
|
help: consider awaiting this value
|
-LL ~ async {
-LL + 3
-LL + }.await
+LL | async {
+LL | 3
+LL ~ }.await
|
error: an async construct yields a type which is itself awaitable
diff --git a/src/tools/clippy/tests/ui/fn_to_numeric_cast_any.stderr b/src/tools/clippy/tests/ui/fn_to_numeric_cast_any.stderr
index 895297a04006..0238e3a91369 100644
--- a/src/tools/clippy/tests/ui/fn_to_numeric_cast_any.stderr
+++ b/src/tools/clippy/tests/ui/fn_to_numeric_cast_any.stderr
@@ -152,7 +152,7 @@ LL | f as usize
help: did you mean to invoke the function?
|
LL | f() as usize
- |
+ | ++
error: casting function pointer `T::static_method` to `usize`
--> tests/ui/fn_to_numeric_cast_any.rs:62:5
@@ -163,7 +163,7 @@ LL | T::static_method as usize
help: did you mean to invoke the function?
|
LL | T::static_method() as usize
- |
+ | ++
error: casting function pointer `(clos as fn(u32) -> u32)` to `usize`
--> tests/ui/fn_to_numeric_cast_any.rs:69:13
diff --git a/src/tools/clippy/tests/ui/implicit_return.stderr b/src/tools/clippy/tests/ui/implicit_return.stderr
index 7ea72307450c..936a779fa747 100644
--- a/src/tools/clippy/tests/ui/implicit_return.stderr
+++ b/src/tools/clippy/tests/ui/implicit_return.stderr
@@ -9,7 +9,7 @@ LL | true
help: add `return` as shown
|
LL | return true
- |
+ | ++++++
error: missing `return` statement
--> tests/ui/implicit_return.rs:19:15
@@ -122,7 +122,7 @@ LL | format!("test {}", "test")
help: add `return` as shown
|
LL | return format!("test {}", "test")
- |
+ | ++++++
error: missing `return` statement
--> tests/ui/implicit_return.rs:90:5
@@ -133,7 +133,7 @@ LL | m!(true, false)
help: add `return` as shown
|
LL | return m!(true, false)
- |
+ | ++++++
error: missing `return` statement
--> tests/ui/implicit_return.rs:96:13
@@ -169,10 +169,8 @@ LL | | }
|
help: add `return` as shown
|
-LL ~ return loop {
-LL + m!(true);
-LL + }
- |
+LL | return loop {
+ | ++++++
error: missing `return` statement
--> tests/ui/implicit_return.rs:130:5
@@ -183,7 +181,7 @@ LL | true
help: add `return` as shown
|
LL | return true
- |
+ | ++++++
error: aborting due to 16 previous errors
diff --git a/src/tools/clippy/tests/ui/manual_flatten.stderr b/src/tools/clippy/tests/ui/manual_flatten.stderr
index cf1b0a1c8bbf..93f7f11b5e64 100644
--- a/src/tools/clippy/tests/ui/manual_flatten.stderr
+++ b/src/tools/clippy/tests/ui/manual_flatten.stderr
@@ -196,11 +196,9 @@ LL | | }
| |_________^
help: try
|
-LL ~ for n in vec![
-LL +
-LL + Some(1),
-LL + Some(2),
-LL + Some(3)
+LL | for n in vec![
+...
+LL | Some(3)
LL ~ ].iter().flatten() {
|
diff --git a/src/tools/clippy/tests/ui/too_long_first_doc_paragraph-fix.stderr b/src/tools/clippy/tests/ui/too_long_first_doc_paragraph-fix.stderr
index 6ef333f0cfd2..84a574017a9b 100644
--- a/src/tools/clippy/tests/ui/too_long_first_doc_paragraph-fix.stderr
+++ b/src/tools/clippy/tests/ui/too_long_first_doc_paragraph-fix.stderr
@@ -12,7 +12,7 @@ LL | | /// 200 characters so I needed to write something longeeeeeeer.
= help: to override `-D warnings` add `#[allow(clippy::too_long_first_doc_paragraph)]`
help: add an empty line
|
-LL ~ /// A very short summary.
+LL | /// A very short summary.
LL + ///
|
diff --git a/src/tools/clippy/tests/ui/too_long_first_doc_paragraph.stderr b/src/tools/clippy/tests/ui/too_long_first_doc_paragraph.stderr
index 95f42349b9b3..8bc853132ec0 100644
--- a/src/tools/clippy/tests/ui/too_long_first_doc_paragraph.stderr
+++ b/src/tools/clippy/tests/ui/too_long_first_doc_paragraph.stderr
@@ -12,8 +12,8 @@ LL | | //! 200 characters so I needed to write something longeeeeeeer.
= help: to override `-D warnings` add `#[allow(clippy::too_long_first_doc_paragraph)]`
help: add an empty line
|
-LL ~ //! A very short summary.
-LL + //!
+LL | //! A very short summary.
+LL ~ //!
LL ~ //! A much longer explanation that goes into a lot more detail about
|
diff --git a/tests/ui/coverage-attr/bad-attr-ice.feat.stderr b/tests/ui/coverage-attr/bad-attr-ice.feat.stderr
index 50e1c39d4f8b..dc84394fe3c0 100644
--- a/tests/ui/coverage-attr/bad-attr-ice.feat.stderr
+++ b/tests/ui/coverage-attr/bad-attr-ice.feat.stderr
@@ -7,9 +7,9 @@ LL | #[coverage]
help: the following are the possible correct uses
|
LL | #[coverage(off)]
- |
+ | +++++
LL | #[coverage(on)]
- |
+ | ++++
error: aborting due to 1 previous error
diff --git a/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr b/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr
index e8bdd99c9b9b..49b8974bfdfb 100644
--- a/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr
+++ b/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr
@@ -7,9 +7,9 @@ LL | #[coverage]
help: the following are the possible correct uses
|
LL | #[coverage(off)]
- |
+ | +++++
LL | #[coverage(on)]
- |
+ | ++++
error[E0658]: the `#[coverage]` attribute is an experimental feature
--> $DIR/bad-attr-ice.rs:11:1
diff --git a/tests/ui/coverage-attr/word-only.stderr b/tests/ui/coverage-attr/word-only.stderr
index bad50b0c961d..612301885dcc 100644
--- a/tests/ui/coverage-attr/word-only.stderr
+++ b/tests/ui/coverage-attr/word-only.stderr
@@ -7,9 +7,9 @@ LL | #[coverage]
help: the following are the possible correct uses
|
LL | #[coverage(off)]
- |
+ | +++++
LL | #[coverage(on)]
- |
+ | ++++
error: malformed `coverage` attribute input
--> $DIR/word-only.rs:17:5
@@ -20,9 +20,9 @@ LL | #![coverage]
help: the following are the possible correct uses
|
LL | #![coverage(off)]
- |
+ | +++++
LL | #![coverage(on)]
- |
+ | ++++
error: malformed `coverage` attribute input
--> $DIR/word-only.rs:21:1
@@ -33,9 +33,9 @@ LL | #[coverage]
help: the following are the possible correct uses
|
LL | #[coverage(off)]
- |
+ | +++++
LL | #[coverage(on)]
- |
+ | ++++
error: malformed `coverage` attribute input
--> $DIR/word-only.rs:29:5
@@ -46,9 +46,9 @@ LL | #[coverage]
help: the following are the possible correct uses
|
LL | #[coverage(off)]
- |
+ | +++++
LL | #[coverage(on)]
- |
+ | ++++
error: malformed `coverage` attribute input
--> $DIR/word-only.rs:26:1
@@ -59,9 +59,9 @@ LL | #[coverage]
help: the following are the possible correct uses
|
LL | #[coverage(off)]
- |
+ | +++++
LL | #[coverage(on)]
- |
+ | ++++
error: malformed `coverage` attribute input
--> $DIR/word-only.rs:39:5
@@ -72,9 +72,9 @@ LL | #[coverage]
help: the following are the possible correct uses
|
LL | #[coverage(off)]
- |
+ | +++++
LL | #[coverage(on)]
- |
+ | ++++
error: malformed `coverage` attribute input
--> $DIR/word-only.rs:44:5
@@ -85,9 +85,9 @@ LL | #[coverage]
help: the following are the possible correct uses
|
LL | #[coverage(off)]
- |
+ | +++++
LL | #[coverage(on)]
- |
+ | ++++
error: malformed `coverage` attribute input
--> $DIR/word-only.rs:35:1
@@ -98,9 +98,9 @@ LL | #[coverage]
help: the following are the possible correct uses
|
LL | #[coverage(off)]
- |
+ | +++++
LL | #[coverage(on)]
- |
+ | ++++
error: malformed `coverage` attribute input
--> $DIR/word-only.rs:53:5
@@ -111,9 +111,9 @@ LL | #[coverage]
help: the following are the possible correct uses
|
LL | #[coverage(off)]
- |
+ | +++++
LL | #[coverage(on)]
- |
+ | ++++
error: malformed `coverage` attribute input
--> $DIR/word-only.rs:58:5
@@ -124,9 +124,9 @@ LL | #[coverage]
help: the following are the possible correct uses
|
LL | #[coverage(off)]
- |
+ | +++++
LL | #[coverage(on)]
- |
+ | ++++
error: malformed `coverage` attribute input
--> $DIR/word-only.rs:50:1
@@ -137,9 +137,9 @@ LL | #[coverage]
help: the following are the possible correct uses
|
LL | #[coverage(off)]
- |
+ | +++++
LL | #[coverage(on)]
- |
+ | ++++
error: malformed `coverage` attribute input
--> $DIR/word-only.rs:64:1
@@ -150,9 +150,9 @@ LL | #[coverage]
help: the following are the possible correct uses
|
LL | #[coverage(off)]
- |
+ | +++++
LL | #[coverage(on)]
- |
+ | ++++
error[E0788]: coverage attribute not allowed here
--> $DIR/word-only.rs:21:1
diff --git a/tests/ui/error-codes/E0259.stderr b/tests/ui/error-codes/E0259.stderr
index 975d1a161a01..1833fe90f3d5 100644
--- a/tests/ui/error-codes/E0259.stderr
+++ b/tests/ui/error-codes/E0259.stderr
@@ -11,7 +11,7 @@ LL | extern crate test as alloc;
help: you can use `as` to change the binding name of the import
|
LL | extern crate test as other_alloc;
- |
+ | ++++++
error: aborting due to 1 previous error
diff --git a/tests/ui/error-codes/E0260.stderr b/tests/ui/error-codes/E0260.stderr
index 35698c653590..10811d1f3187 100644
--- a/tests/ui/error-codes/E0260.stderr
+++ b/tests/ui/error-codes/E0260.stderr
@@ -11,7 +11,7 @@ LL | mod alloc {
help: you can use `as` to change the binding name of the import
|
LL | extern crate alloc as other_alloc;
- |
+ | ++++++++++++++
error: aborting due to 1 previous error
diff --git a/tests/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr b/tests/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr
index 54bde98b57f9..d9acdbea3fc0 100644
--- a/tests/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr
+++ b/tests/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr
@@ -12,11 +12,8 @@ LL | | )) {}
= note: `#[warn(anonymous_parameters)]` on by default
help: try naming the parameter or explicitly ignoring it
|
-LL ~ fn test(x: u32, _: (
-LL +
-LL +
-LL ~ )) {}
- |
+LL | fn test(x: u32, _: (
+ | ++
warning: 1 warning emitted
diff --git a/tests/ui/fn/issue-3044.stderr b/tests/ui/fn/issue-3044.stderr
index 8351818dc897..787eeec09cc2 100644
--- a/tests/ui/fn/issue-3044.stderr
+++ b/tests/ui/fn/issue-3044.stderr
@@ -11,8 +11,8 @@ note: method defined here
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
help: provide the argument
|
-LL ~ needlesArr.iter().fold(|x, y| {
-LL +
+LL | needlesArr.iter().fold(|x, y| {
+LL |
LL ~ }, /* f */);
|
diff --git a/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr b/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr
index 80cea1a83d93..2621f913186e 100644
--- a/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr
+++ b/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr
@@ -8,7 +8,7 @@ LL | extern crate std;
help: you can use `as` to change the binding name of the import
|
LL | extern crate std as other_std;
- |
+ | ++++++++++++
error: aborting due to 1 previous error
diff --git a/tests/ui/imports/issue-45829/rename-extern-vs-use.stderr b/tests/ui/imports/issue-45829/rename-extern-vs-use.stderr
index 8f2f7bbac0c9..f33b093725f0 100644
--- a/tests/ui/imports/issue-45829/rename-extern-vs-use.stderr
+++ b/tests/ui/imports/issue-45829/rename-extern-vs-use.stderr
@@ -10,7 +10,7 @@ LL | extern crate issue_45829_b as bar;
help: you can use `as` to change the binding name of the import
|
LL | extern crate issue_45829_b as other_bar;
- |
+ | ++++++
error: aborting due to 1 previous error
diff --git a/tests/ui/imports/issue-45829/rename-extern.stderr b/tests/ui/imports/issue-45829/rename-extern.stderr
index 46560ef9244e..2a3a05d1e7b4 100644
--- a/tests/ui/imports/issue-45829/rename-extern.stderr
+++ b/tests/ui/imports/issue-45829/rename-extern.stderr
@@ -10,7 +10,7 @@ LL | extern crate issue_45829_b as issue_45829_a;
help: you can use `as` to change the binding name of the import
|
LL | extern crate issue_45829_b as other_issue_45829_a;
- |
+ | ++++++
error: aborting due to 1 previous error
diff --git a/tests/ui/imports/multiple-extern-by-macro-for-buitlin.stderr b/tests/ui/imports/multiple-extern-by-macro-for-buitlin.stderr
index a84a6c42aa8d..bc9755732813 100644
--- a/tests/ui/imports/multiple-extern-by-macro-for-buitlin.stderr
+++ b/tests/ui/imports/multiple-extern-by-macro-for-buitlin.stderr
@@ -15,7 +15,7 @@ LL | m!();
help: you can use `as` to change the binding name of the import
|
LL | extern crate std as other_core;
- |
+ | ++++++
error: aborting due to 1 previous error
diff --git a/tests/ui/imports/multiple-extern-by-macro-for-custom.stderr b/tests/ui/imports/multiple-extern-by-macro-for-custom.stderr
index 556d75a4dbb5..f1b60bbe39d5 100644
--- a/tests/ui/imports/multiple-extern-by-macro-for-custom.stderr
+++ b/tests/ui/imports/multiple-extern-by-macro-for-custom.stderr
@@ -15,7 +15,7 @@ LL | m!();
help: you can use `as` to change the binding name of the import
|
LL | extern crate std as other_empty;
- |
+ | ++++++
error: aborting due to 1 previous error
diff --git a/tests/ui/imports/multiple-extern-by-macro-for-inexist.stderr b/tests/ui/imports/multiple-extern-by-macro-for-inexist.stderr
index ec34489f2323..13e1aaacd702 100644
--- a/tests/ui/imports/multiple-extern-by-macro-for-inexist.stderr
+++ b/tests/ui/imports/multiple-extern-by-macro-for-inexist.stderr
@@ -21,7 +21,7 @@ LL | m!();
help: you can use `as` to change the binding name of the import
|
LL | extern crate std as other_non_existent;
- |
+ | ++++++
error: aborting due to 2 previous errors
diff --git a/tests/ui/on-unimplemented/bad-annotation.stderr b/tests/ui/on-unimplemented/bad-annotation.stderr
index 9bb9423788c2..4ceea779b29d 100644
--- a/tests/ui/on-unimplemented/bad-annotation.stderr
+++ b/tests/ui/on-unimplemented/bad-annotation.stderr
@@ -7,9 +7,9 @@ LL | #[rustc_on_unimplemented]
help: the following are the possible correct uses
|
LL | #[rustc_on_unimplemented = "message"]
- |
+ | +++++++++++
LL | #[rustc_on_unimplemented(/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...")]
- |
+ | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
error[E0230]: there is no parameter `C` on trait `BadAnnotation2`
--> $DIR/bad-annotation.rs:22:1
diff --git a/tests/ui/panic-handler/weak-lang-item.stderr b/tests/ui/panic-handler/weak-lang-item.stderr
index de351d2c3e4a..5dcb37df6892 100644
--- a/tests/ui/panic-handler/weak-lang-item.stderr
+++ b/tests/ui/panic-handler/weak-lang-item.stderr
@@ -8,7 +8,7 @@ LL | extern crate core;
help: you can use `as` to change the binding name of the import
|
LL | extern crate core as other_core;
- |
+ | +++++++++++++
error: `#[panic_handler]` function required, but not found
diff --git a/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr
index 23821decd6e4..d241f417553f 100644
--- a/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr
+++ b/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr
@@ -37,7 +37,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match ref_never {
LL + _ => todo!(),
-LL + }
+LL ~ }
|
error: unreachable pattern
@@ -100,7 +100,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match res_u32_never {
LL + Ok(_) => todo!(),
-LL + }
+LL ~ }
|
error: unreachable pattern
@@ -374,7 +374,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match slice_never {
LL + _ => todo!(),
-LL + }
+LL ~ }
|
error[E0004]: non-exhaustive patterns: `&[]` not covered
@@ -415,7 +415,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match *slice_never {
LL + _ => todo!(),
-LL + }
+LL ~ }
|
error: unreachable pattern
@@ -462,7 +462,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match array_0_never {
LL + _ => todo!(),
-LL + }
+LL ~ }
|
error: unreachable pattern
diff --git a/tests/ui/pattern/usefulness/empty-types.never_pats.stderr b/tests/ui/pattern/usefulness/empty-types.never_pats.stderr
index 84aefe7d9637..ea63d7ba1afd 100644
--- a/tests/ui/pattern/usefulness/empty-types.never_pats.stderr
+++ b/tests/ui/pattern/usefulness/empty-types.never_pats.stderr
@@ -46,7 +46,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match ref_never {
LL + _ => todo!(),
-LL + }
+LL ~ }
|
error: unreachable pattern
@@ -76,7 +76,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match res_u32_never {
LL + Ok(_) => todo!(),
-LL + }
+LL ~ }
|
error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered
@@ -321,7 +321,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match slice_never {
LL + _ => todo!(),
-LL + }
+LL ~ }
|
error[E0004]: non-exhaustive patterns: `&[!, ..]` not covered
@@ -376,7 +376,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match *slice_never {
LL + _ => todo!(),
-LL + }
+LL ~ }
|
error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty
@@ -390,7 +390,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match array_0_never {
LL + _ => todo!(),
-LL + }
+LL ~ }
|
error: unreachable pattern
@@ -502,7 +502,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match *ref_tuple_half_never {
LL + _ => todo!(),
-LL + }
+LL ~ }
|
error: unreachable pattern
diff --git a/tests/ui/pattern/usefulness/empty-types.normal.stderr b/tests/ui/pattern/usefulness/empty-types.normal.stderr
index f3af74c16c30..a1a44e777442 100644
--- a/tests/ui/pattern/usefulness/empty-types.normal.stderr
+++ b/tests/ui/pattern/usefulness/empty-types.normal.stderr
@@ -37,7 +37,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match ref_never {
LL + _ => todo!(),
-LL + }
+LL ~ }
|
error: unreachable pattern
@@ -67,7 +67,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match res_u32_never {
LL + Ok(_) => todo!(),
-LL + }
+LL ~ }
|
error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered
@@ -312,7 +312,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match slice_never {
LL + _ => todo!(),
-LL + }
+LL ~ }
|
error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered
@@ -367,7 +367,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match *slice_never {
LL + _ => todo!(),
-LL + }
+LL ~ }
|
error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty
@@ -381,7 +381,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match array_0_never {
LL + _ => todo!(),
-LL + }
+LL ~ }
|
error: unreachable pattern
@@ -493,7 +493,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match *ref_tuple_half_never {
LL + _ => todo!(),
-LL + }
+LL ~ }
|
error: unreachable pattern
diff --git a/tests/ui/pattern/usefulness/impl-trait.stderr b/tests/ui/pattern/usefulness/impl-trait.stderr
index 34f8eb1e1635..c3e1c267b614 100644
--- a/tests/ui/pattern/usefulness/impl-trait.stderr
+++ b/tests/ui/pattern/usefulness/impl-trait.stderr
@@ -36,7 +36,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match return_never_rpit(x) {
LL + _ => todo!(),
-LL + }
+LL ~ }
|
error: unreachable pattern
@@ -118,7 +118,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match return_never_tait(x) {
LL + _ => todo!(),
-LL + }
+LL ~ }
|
error: unreachable pattern
diff --git a/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr b/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr
index 914c6ed60c83..7caee64a33fb 100644
--- a/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr
+++ b/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr
@@ -154,7 +154,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match 7usize {
LL + _ => todo!(),
-LL + }
+LL ~ }
|
error: aborting due to 12 previous errors
diff --git a/tests/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.stderr b/tests/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.stderr
index 2acde8496506..c37a9a515790 100644
--- a/tests/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.stderr
+++ b/tests/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.stderr
@@ -15,7 +15,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match a {
LL + _ => todo!(),
-LL + }
+LL ~ }
|
error: aborting due to 1 previous error
diff --git a/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr b/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr
index 999e9a47d6c5..a9b45a18af39 100644
--- a/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr
+++ b/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr
@@ -4,7 +4,7 @@ error[E0259]: the name `std` is defined multiple times
help: you can use `as` to change the binding name of the import
|
LL | extern crate std as other_std;
- |
+ | ++++++++++++
error: aborting due to 1 previous error
diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr
index 45a0ca01a560..100e0a501e01 100644
--- a/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr
@@ -38,7 +38,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match NonExhaustiveEnum::Unit {
LL + NonExhaustiveEnum::Unit | NonExhaustiveEnum::Tuple(_) | NonExhaustiveEnum::Struct { .. } => todo!(),
-LL + }
+LL ~ }
|
error[E0004]: non-exhaustive patterns: `NormalEnum::Unit`, `NormalEnum::Tuple(_)` and `NormalEnum::Struct { .. }` not covered
@@ -65,7 +65,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match NormalEnum::Unit {
LL + NormalEnum::Unit | NormalEnum::Tuple(_) | NormalEnum::Struct { .. } => todo!(),
-LL + }
+LL ~ }
|
error: aborting due to 3 previous errors
diff --git a/tests/ui/suggestions/incorrect-variant-literal.svg b/tests/ui/suggestions/incorrect-variant-literal.svg
index 68cd42deaea0..279fd30f2165 100644
--- a/tests/ui/suggestions/incorrect-variant-literal.svg
+++ b/tests/ui/suggestions/incorrect-variant-literal.svg
@@ -103,7 +103,7 @@
|
- LL | Enum::Tuple(/* i32 */);
+ LL | Enum::Tuple(/* i32 */);
| +++++++++
@@ -581,7 +581,7 @@
LL - Enum::tuple();
- LL + Enum::Tuple(/* i32 */);
+ LL + Enum::Tuple(/* i32 */);
|
diff --git a/tests/ui/suggestions/return-bindings.stderr b/tests/ui/suggestions/return-bindings.stderr
index 6f906c27ba94..8e396d17dc07 100644
--- a/tests/ui/suggestions/return-bindings.stderr
+++ b/tests/ui/suggestions/return-bindings.stderr
@@ -22,8 +22,8 @@ LL | | } else {
|
help: consider returning the local binding `s`
|
-LL ~ let s: String = if let Some(s) = opt_str {
-LL + s
+LL | let s: String = if let Some(s) = opt_str {
+LL ~ s
LL ~
|
@@ -54,8 +54,8 @@ LL | | } else {
|
help: consider returning the local binding `s`
|
-LL ~ let s: String = if let Some(s) = opt_str {
-LL + s
+LL | let s: String = if let Some(s) = opt_str {
+LL ~ s
LL ~
|
@@ -71,8 +71,8 @@ LL | String::new()
|
help: consider returning the local binding `s`
|
-LL ~ let s = if let Some(s) = opt_str {
-LL + s
+LL | let s = if let Some(s) = opt_str {
+LL ~ s
LL ~ } else {
|
diff --git a/tests/ui/type-alias-impl-trait/bad-tait-no-substs.stderr b/tests/ui/type-alias-impl-trait/bad-tait-no-substs.stderr
index 55df117d0664..38fbff9d59da 100644
--- a/tests/ui/type-alias-impl-trait/bad-tait-no-substs.stderr
+++ b/tests/ui/type-alias-impl-trait/bad-tait-no-substs.stderr
@@ -69,7 +69,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match x {
LL + UninhabitedVariants::Tuple(_) => todo!(),
-LL + }
+LL ~ }
|
error: aborting due to 5 previous errors
diff --git a/tests/ui/type-alias-impl-trait/unconstrained-due-to-bad-pattern.stderr b/tests/ui/type-alias-impl-trait/unconstrained-due-to-bad-pattern.stderr
index 6d9c8eabfad5..5c9a4688105f 100644
--- a/tests/ui/type-alias-impl-trait/unconstrained-due-to-bad-pattern.stderr
+++ b/tests/ui/type-alias-impl-trait/unconstrained-due-to-bad-pattern.stderr
@@ -9,7 +9,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
LL ~ match empty_opaque() {
LL + _ => todo!(),
-LL + }
+LL ~ }
|
error: aborting due to 1 previous error
diff --git a/tests/ui/typeck/issue-13853-5.stderr b/tests/ui/typeck/issue-13853-5.stderr
index 388d5ec746ce..4e483a0a58ef 100644
--- a/tests/ui/typeck/issue-13853-5.stderr
+++ b/tests/ui/typeck/issue-13853-5.stderr
@@ -14,8 +14,8 @@ LL | fn deserialize_token>(_x: D, _y: &'a str) -> &'a st
|
help: consider returning the local binding `_y`
|
-LL ~ fn deserialize_token>(_x: D, _y: &'a str) -> &'a str {
-LL + _y
+LL | fn deserialize_token>(_x: D, _y: &'a str) -> &'a str {
+LL ~ _y
LL ~
|