Trim suggestion part before generating highlights
This commit is contained in:
parent
0a7ab1d6df
commit
160905b625
36 changed files with 106 additions and 113 deletions
|
@ -2216,12 +2216,7 @@ impl HumanEmitter {
|
||||||
if let DisplaySuggestion::Diff | DisplaySuggestion::Underline | DisplaySuggestion::Add =
|
if let DisplaySuggestion::Diff | DisplaySuggestion::Underline | DisplaySuggestion::Add =
|
||||||
show_code_change
|
show_code_change
|
||||||
{
|
{
|
||||||
for mut part in parts {
|
for 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);
|
|
||||||
|
|
||||||
let snippet = if let Ok(snippet) = sm.span_to_snippet(part.span) {
|
let snippet = if let Ok(snippet) = sm.span_to_snippet(part.span) {
|
||||||
snippet
|
snippet
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -403,7 +403,12 @@ impl CodeSuggestion {
|
||||||
// or deleted code in order to point at the correct column *after* substitution.
|
// or deleted code in order to point at the correct column *after* substitution.
|
||||||
let mut acc = 0;
|
let mut acc = 0;
|
||||||
let mut only_capitalization = false;
|
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);
|
only_capitalization |= is_case_difference(sm, &part.snippet, part.span);
|
||||||
let cur_lo = sm.lookup_char_pos(part.span.lo());
|
let cur_lo = sm.lookup_char_pos(part.span.lo());
|
||||||
if prev_hi.line == cur_lo.line {
|
if prev_hi.line == cur_lo.line {
|
||||||
|
|
|
@ -14,9 +14,9 @@ LL | | };
|
||||||
= help: to override `-D warnings` add `#[allow(clippy::async_yields_async)]`
|
= help: to override `-D warnings` add `#[allow(clippy::async_yields_async)]`
|
||||||
help: consider awaiting this value
|
help: consider awaiting this value
|
||||||
|
|
|
|
||||||
LL ~ async {
|
LL | async {
|
||||||
LL + 3
|
LL | 3
|
||||||
LL + }.await
|
LL ~ }.await
|
||||||
|
|
|
|
||||||
|
|
||||||
error: an async construct yields a type which is itself awaitable
|
error: an async construct yields a type which is itself awaitable
|
||||||
|
@ -46,9 +46,9 @@ LL | | };
|
||||||
|
|
|
|
||||||
help: consider awaiting this value
|
help: consider awaiting this value
|
||||||
|
|
|
|
||||||
LL ~ async {
|
LL | async {
|
||||||
LL + 3
|
LL | 3
|
||||||
LL + }.await
|
LL ~ }.await
|
||||||
|
|
|
|
||||||
|
|
||||||
error: an async construct yields a type which is itself awaitable
|
error: an async construct yields a type which is itself awaitable
|
||||||
|
|
|
@ -152,7 +152,7 @@ LL | f as usize
|
||||||
help: did you mean to invoke the function?
|
help: did you mean to invoke the function?
|
||||||
|
|
|
|
||||||
LL | f() as usize
|
LL | f() as usize
|
||||||
|
|
| ++
|
||||||
|
|
||||||
error: casting function pointer `T::static_method` to `usize`
|
error: casting function pointer `T::static_method` to `usize`
|
||||||
--> tests/ui/fn_to_numeric_cast_any.rs:62:5
|
--> 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?
|
help: did you mean to invoke the function?
|
||||||
|
|
|
|
||||||
LL | T::static_method() as usize
|
LL | T::static_method() as usize
|
||||||
|
|
| ++
|
||||||
|
|
||||||
error: casting function pointer `(clos as fn(u32) -> u32)` to `usize`
|
error: casting function pointer `(clos as fn(u32) -> u32)` to `usize`
|
||||||
--> tests/ui/fn_to_numeric_cast_any.rs:69:13
|
--> tests/ui/fn_to_numeric_cast_any.rs:69:13
|
||||||
|
|
|
@ -9,7 +9,7 @@ LL | true
|
||||||
help: add `return` as shown
|
help: add `return` as shown
|
||||||
|
|
|
|
||||||
LL | return true
|
LL | return true
|
||||||
|
|
| ++++++
|
||||||
|
|
||||||
error: missing `return` statement
|
error: missing `return` statement
|
||||||
--> tests/ui/implicit_return.rs:19:15
|
--> tests/ui/implicit_return.rs:19:15
|
||||||
|
@ -122,7 +122,7 @@ LL | format!("test {}", "test")
|
||||||
help: add `return` as shown
|
help: add `return` as shown
|
||||||
|
|
|
|
||||||
LL | return format!("test {}", "test")
|
LL | return format!("test {}", "test")
|
||||||
|
|
| ++++++
|
||||||
|
|
||||||
error: missing `return` statement
|
error: missing `return` statement
|
||||||
--> tests/ui/implicit_return.rs:90:5
|
--> tests/ui/implicit_return.rs:90:5
|
||||||
|
@ -133,7 +133,7 @@ LL | m!(true, false)
|
||||||
help: add `return` as shown
|
help: add `return` as shown
|
||||||
|
|
|
|
||||||
LL | return m!(true, false)
|
LL | return m!(true, false)
|
||||||
|
|
| ++++++
|
||||||
|
|
||||||
error: missing `return` statement
|
error: missing `return` statement
|
||||||
--> tests/ui/implicit_return.rs:96:13
|
--> tests/ui/implicit_return.rs:96:13
|
||||||
|
@ -169,10 +169,8 @@ LL | | }
|
||||||
|
|
|
|
||||||
help: add `return` as shown
|
help: add `return` as shown
|
||||||
|
|
|
|
||||||
LL ~ return loop {
|
LL | return loop {
|
||||||
LL + m!(true);
|
| ++++++
|
||||||
LL + }
|
|
||||||
|
|
|
||||||
|
|
||||||
error: missing `return` statement
|
error: missing `return` statement
|
||||||
--> tests/ui/implicit_return.rs:130:5
|
--> tests/ui/implicit_return.rs:130:5
|
||||||
|
@ -183,7 +181,7 @@ LL | true
|
||||||
help: add `return` as shown
|
help: add `return` as shown
|
||||||
|
|
|
|
||||||
LL | return true
|
LL | return true
|
||||||
|
|
| ++++++
|
||||||
|
|
||||||
error: aborting due to 16 previous errors
|
error: aborting due to 16 previous errors
|
||||||
|
|
||||||
|
|
|
@ -196,11 +196,9 @@ LL | | }
|
||||||
| |_________^
|
| |_________^
|
||||||
help: try
|
help: try
|
||||||
|
|
|
|
||||||
LL ~ for n in vec![
|
LL | for n in vec![
|
||||||
LL +
|
...
|
||||||
LL + Some(1),
|
LL | Some(3)
|
||||||
LL + Some(2),
|
|
||||||
LL + Some(3)
|
|
||||||
LL ~ ].iter().flatten() {
|
LL ~ ].iter().flatten() {
|
||||||
|
|
|
|
||||||
|
|
||||||
|
|
|
@ -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: to override `-D warnings` add `#[allow(clippy::too_long_first_doc_paragraph)]`
|
||||||
help: add an empty line
|
help: add an empty line
|
||||||
|
|
|
|
||||||
LL ~ /// A very short summary.
|
LL | /// A very short summary.
|
||||||
LL + ///
|
LL + ///
|
||||||
|
|
|
|
||||||
|
|
||||||
|
|
|
@ -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: to override `-D warnings` add `#[allow(clippy::too_long_first_doc_paragraph)]`
|
||||||
help: add an empty line
|
help: add an empty line
|
||||||
|
|
|
|
||||||
LL ~ //! A very short summary.
|
LL | //! A very short summary.
|
||||||
LL + //!
|
LL ~ //!
|
||||||
LL ~ //! A much longer explanation that goes into a lot more detail about
|
LL ~ //! A much longer explanation that goes into a lot more detail about
|
||||||
|
|
|
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,9 @@ LL | #[coverage]
|
||||||
help: the following are the possible correct uses
|
help: the following are the possible correct uses
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
|
|
| +++++
|
||||||
LL | #[coverage(on)]
|
LL | #[coverage(on)]
|
||||||
|
|
| ++++
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,9 @@ LL | #[coverage]
|
||||||
help: the following are the possible correct uses
|
help: the following are the possible correct uses
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
|
|
| +++++
|
||||||
LL | #[coverage(on)]
|
LL | #[coverage(on)]
|
||||||
|
|
| ++++
|
||||||
|
|
||||||
error[E0658]: the `#[coverage]` attribute is an experimental feature
|
error[E0658]: the `#[coverage]` attribute is an experimental feature
|
||||||
--> $DIR/bad-attr-ice.rs:11:1
|
--> $DIR/bad-attr-ice.rs:11:1
|
||||||
|
|
|
@ -7,9 +7,9 @@ LL | #[coverage]
|
||||||
help: the following are the possible correct uses
|
help: the following are the possible correct uses
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
|
|
| +++++
|
||||||
LL | #[coverage(on)]
|
LL | #[coverage(on)]
|
||||||
|
|
| ++++
|
||||||
|
|
||||||
error: malformed `coverage` attribute input
|
error: malformed `coverage` attribute input
|
||||||
--> $DIR/word-only.rs:17:5
|
--> $DIR/word-only.rs:17:5
|
||||||
|
@ -20,9 +20,9 @@ LL | #![coverage]
|
||||||
help: the following are the possible correct uses
|
help: the following are the possible correct uses
|
||||||
|
|
|
|
||||||
LL | #![coverage(off)]
|
LL | #![coverage(off)]
|
||||||
|
|
| +++++
|
||||||
LL | #![coverage(on)]
|
LL | #![coverage(on)]
|
||||||
|
|
| ++++
|
||||||
|
|
||||||
error: malformed `coverage` attribute input
|
error: malformed `coverage` attribute input
|
||||||
--> $DIR/word-only.rs:21:1
|
--> $DIR/word-only.rs:21:1
|
||||||
|
@ -33,9 +33,9 @@ LL | #[coverage]
|
||||||
help: the following are the possible correct uses
|
help: the following are the possible correct uses
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
|
|
| +++++
|
||||||
LL | #[coverage(on)]
|
LL | #[coverage(on)]
|
||||||
|
|
| ++++
|
||||||
|
|
||||||
error: malformed `coverage` attribute input
|
error: malformed `coverage` attribute input
|
||||||
--> $DIR/word-only.rs:29:5
|
--> $DIR/word-only.rs:29:5
|
||||||
|
@ -46,9 +46,9 @@ LL | #[coverage]
|
||||||
help: the following are the possible correct uses
|
help: the following are the possible correct uses
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
|
|
| +++++
|
||||||
LL | #[coverage(on)]
|
LL | #[coverage(on)]
|
||||||
|
|
| ++++
|
||||||
|
|
||||||
error: malformed `coverage` attribute input
|
error: malformed `coverage` attribute input
|
||||||
--> $DIR/word-only.rs:26:1
|
--> $DIR/word-only.rs:26:1
|
||||||
|
@ -59,9 +59,9 @@ LL | #[coverage]
|
||||||
help: the following are the possible correct uses
|
help: the following are the possible correct uses
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
|
|
| +++++
|
||||||
LL | #[coverage(on)]
|
LL | #[coverage(on)]
|
||||||
|
|
| ++++
|
||||||
|
|
||||||
error: malformed `coverage` attribute input
|
error: malformed `coverage` attribute input
|
||||||
--> $DIR/word-only.rs:39:5
|
--> $DIR/word-only.rs:39:5
|
||||||
|
@ -72,9 +72,9 @@ LL | #[coverage]
|
||||||
help: the following are the possible correct uses
|
help: the following are the possible correct uses
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
|
|
| +++++
|
||||||
LL | #[coverage(on)]
|
LL | #[coverage(on)]
|
||||||
|
|
| ++++
|
||||||
|
|
||||||
error: malformed `coverage` attribute input
|
error: malformed `coverage` attribute input
|
||||||
--> $DIR/word-only.rs:44:5
|
--> $DIR/word-only.rs:44:5
|
||||||
|
@ -85,9 +85,9 @@ LL | #[coverage]
|
||||||
help: the following are the possible correct uses
|
help: the following are the possible correct uses
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
|
|
| +++++
|
||||||
LL | #[coverage(on)]
|
LL | #[coverage(on)]
|
||||||
|
|
| ++++
|
||||||
|
|
||||||
error: malformed `coverage` attribute input
|
error: malformed `coverage` attribute input
|
||||||
--> $DIR/word-only.rs:35:1
|
--> $DIR/word-only.rs:35:1
|
||||||
|
@ -98,9 +98,9 @@ LL | #[coverage]
|
||||||
help: the following are the possible correct uses
|
help: the following are the possible correct uses
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
|
|
| +++++
|
||||||
LL | #[coverage(on)]
|
LL | #[coverage(on)]
|
||||||
|
|
| ++++
|
||||||
|
|
||||||
error: malformed `coverage` attribute input
|
error: malformed `coverage` attribute input
|
||||||
--> $DIR/word-only.rs:53:5
|
--> $DIR/word-only.rs:53:5
|
||||||
|
@ -111,9 +111,9 @@ LL | #[coverage]
|
||||||
help: the following are the possible correct uses
|
help: the following are the possible correct uses
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
|
|
| +++++
|
||||||
LL | #[coverage(on)]
|
LL | #[coverage(on)]
|
||||||
|
|
| ++++
|
||||||
|
|
||||||
error: malformed `coverage` attribute input
|
error: malformed `coverage` attribute input
|
||||||
--> $DIR/word-only.rs:58:5
|
--> $DIR/word-only.rs:58:5
|
||||||
|
@ -124,9 +124,9 @@ LL | #[coverage]
|
||||||
help: the following are the possible correct uses
|
help: the following are the possible correct uses
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
|
|
| +++++
|
||||||
LL | #[coverage(on)]
|
LL | #[coverage(on)]
|
||||||
|
|
| ++++
|
||||||
|
|
||||||
error: malformed `coverage` attribute input
|
error: malformed `coverage` attribute input
|
||||||
--> $DIR/word-only.rs:50:1
|
--> $DIR/word-only.rs:50:1
|
||||||
|
@ -137,9 +137,9 @@ LL | #[coverage]
|
||||||
help: the following are the possible correct uses
|
help: the following are the possible correct uses
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
|
|
| +++++
|
||||||
LL | #[coverage(on)]
|
LL | #[coverage(on)]
|
||||||
|
|
| ++++
|
||||||
|
|
||||||
error: malformed `coverage` attribute input
|
error: malformed `coverage` attribute input
|
||||||
--> $DIR/word-only.rs:64:1
|
--> $DIR/word-only.rs:64:1
|
||||||
|
@ -150,9 +150,9 @@ LL | #[coverage]
|
||||||
help: the following are the possible correct uses
|
help: the following are the possible correct uses
|
||||||
|
|
|
|
||||||
LL | #[coverage(off)]
|
LL | #[coverage(off)]
|
||||||
|
|
| +++++
|
||||||
LL | #[coverage(on)]
|
LL | #[coverage(on)]
|
||||||
|
|
| ++++
|
||||||
|
|
||||||
error[E0788]: coverage attribute not allowed here
|
error[E0788]: coverage attribute not allowed here
|
||||||
--> $DIR/word-only.rs:21:1
|
--> $DIR/word-only.rs:21:1
|
||||||
|
|
|
@ -11,7 +11,7 @@ LL | extern crate test as alloc;
|
||||||
help: you can use `as` to change the binding name of the import
|
help: you can use `as` to change the binding name of the import
|
||||||
|
|
|
|
||||||
LL | extern crate test as other_alloc;
|
LL | extern crate test as other_alloc;
|
||||||
|
|
| ++++++
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ LL | mod alloc {
|
||||||
help: you can use `as` to change the binding name of the import
|
help: you can use `as` to change the binding name of the import
|
||||||
|
|
|
|
||||||
LL | extern crate alloc as other_alloc;
|
LL | extern crate alloc as other_alloc;
|
||||||
|
|
| ++++++++++++++
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,8 @@ LL | | )) {}
|
||||||
= note: `#[warn(anonymous_parameters)]` on by default
|
= note: `#[warn(anonymous_parameters)]` on by default
|
||||||
help: try naming the parameter or explicitly ignoring it
|
help: try naming the parameter or explicitly ignoring it
|
||||||
|
|
|
|
||||||
LL ~ fn test(x: u32, _: (
|
LL | fn test(x: u32, _: (
|
||||||
LL +
|
| ++
|
||||||
LL +
|
|
||||||
LL ~ )) {}
|
|
||||||
|
|
|
||||||
|
|
||||||
warning: 1 warning emitted
|
warning: 1 warning emitted
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@ note: method defined here
|
||||||
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
||||||
help: provide the argument
|
help: provide the argument
|
||||||
|
|
|
|
||||||
LL ~ needlesArr.iter().fold(|x, y| {
|
LL | needlesArr.iter().fold(|x, y| {
|
||||||
LL +
|
LL |
|
||||||
LL ~ }, /* f */);
|
LL ~ }, /* f */);
|
||||||
|
|
|
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ LL | extern crate std;
|
||||||
help: you can use `as` to change the binding name of the import
|
help: you can use `as` to change the binding name of the import
|
||||||
|
|
|
|
||||||
LL | extern crate std as other_std;
|
LL | extern crate std as other_std;
|
||||||
|
|
| ++++++++++++
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -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
|
help: you can use `as` to change the binding name of the import
|
||||||
|
|
|
|
||||||
LL | extern crate issue_45829_b as other_bar;
|
LL | extern crate issue_45829_b as other_bar;
|
||||||
|
|
| ++++++
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -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
|
help: you can use `as` to change the binding name of the import
|
||||||
|
|
|
|
||||||
LL | extern crate issue_45829_b as other_issue_45829_a;
|
LL | extern crate issue_45829_b as other_issue_45829_a;
|
||||||
|
|
| ++++++
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ LL | m!();
|
||||||
help: you can use `as` to change the binding name of the import
|
help: you can use `as` to change the binding name of the import
|
||||||
|
|
|
|
||||||
LL | extern crate std as other_core;
|
LL | extern crate std as other_core;
|
||||||
|
|
| ++++++
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ LL | m!();
|
||||||
help: you can use `as` to change the binding name of the import
|
help: you can use `as` to change the binding name of the import
|
||||||
|
|
|
|
||||||
LL | extern crate std as other_empty;
|
LL | extern crate std as other_empty;
|
||||||
|
|
| ++++++
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ LL | m!();
|
||||||
help: you can use `as` to change the binding name of the import
|
help: you can use `as` to change the binding name of the import
|
||||||
|
|
|
|
||||||
LL | extern crate std as other_non_existent;
|
LL | extern crate std as other_non_existent;
|
||||||
|
|
| ++++++
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,9 @@ LL | #[rustc_on_unimplemented]
|
||||||
help: the following are the possible correct uses
|
help: the following are the possible correct uses
|
||||||
|
|
|
|
||||||
LL | #[rustc_on_unimplemented = "message"]
|
LL | #[rustc_on_unimplemented = "message"]
|
||||||
|
|
| +++++++++++
|
||||||
LL | #[rustc_on_unimplemented(/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...")]
|
LL | #[rustc_on_unimplemented(/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...")]
|
||||||
|
|
| ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
error[E0230]: there is no parameter `C` on trait `BadAnnotation2`
|
error[E0230]: there is no parameter `C` on trait `BadAnnotation2`
|
||||||
--> $DIR/bad-annotation.rs:22:1
|
--> $DIR/bad-annotation.rs:22:1
|
||||||
|
|
|
@ -8,7 +8,7 @@ LL | extern crate core;
|
||||||
help: you can use `as` to change the binding name of the import
|
help: you can use `as` to change the binding name of the import
|
||||||
|
|
|
|
||||||
LL | extern crate core as other_core;
|
LL | extern crate core as other_core;
|
||||||
|
|
| +++++++++++++
|
||||||
|
|
||||||
error: `#[panic_handler]` function required, but not found
|
error: `#[panic_handler]` function required, but not found
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
||||||
|
|
|
|
||||||
LL ~ match ref_never {
|
LL ~ match ref_never {
|
||||||
LL + _ => todo!(),
|
LL + _ => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error: unreachable pattern
|
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 ~ match res_u32_never {
|
||||||
LL + Ok(_) => todo!(),
|
LL + Ok(_) => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error: unreachable pattern
|
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 ~ match slice_never {
|
||||||
LL + _ => todo!(),
|
LL + _ => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `&[]` not covered
|
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 ~ match *slice_never {
|
||||||
LL + _ => todo!(),
|
LL + _ => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error: unreachable pattern
|
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 ~ match array_0_never {
|
||||||
LL + _ => todo!(),
|
LL + _ => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error: unreachable pattern
|
error: unreachable pattern
|
||||||
|
|
|
@ -46,7 +46,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
||||||
|
|
|
|
||||||
LL ~ match ref_never {
|
LL ~ match ref_never {
|
||||||
LL + _ => todo!(),
|
LL + _ => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error: unreachable pattern
|
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 ~ match res_u32_never {
|
||||||
LL + Ok(_) => todo!(),
|
LL + Ok(_) => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered
|
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 ~ match slice_never {
|
||||||
LL + _ => todo!(),
|
LL + _ => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `&[!, ..]` not covered
|
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 ~ match *slice_never {
|
||||||
LL + _ => todo!(),
|
LL + _ => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty
|
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 ~ match array_0_never {
|
||||||
LL + _ => todo!(),
|
LL + _ => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error: unreachable pattern
|
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 ~ match *ref_tuple_half_never {
|
||||||
LL + _ => todo!(),
|
LL + _ => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error: unreachable pattern
|
error: unreachable pattern
|
||||||
|
|
|
@ -37,7 +37,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
||||||
|
|
|
|
||||||
LL ~ match ref_never {
|
LL ~ match ref_never {
|
||||||
LL + _ => todo!(),
|
LL + _ => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error: unreachable pattern
|
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 ~ match res_u32_never {
|
||||||
LL + Ok(_) => todo!(),
|
LL + Ok(_) => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered
|
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 ~ match slice_never {
|
||||||
LL + _ => todo!(),
|
LL + _ => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered
|
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 ~ match *slice_never {
|
||||||
LL + _ => todo!(),
|
LL + _ => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty
|
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 ~ match array_0_never {
|
||||||
LL + _ => todo!(),
|
LL + _ => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error: unreachable pattern
|
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 ~ match *ref_tuple_half_never {
|
||||||
LL + _ => todo!(),
|
LL + _ => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error: unreachable pattern
|
error: unreachable pattern
|
||||||
|
|
|
@ -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 ~ match return_never_rpit(x) {
|
||||||
LL + _ => todo!(),
|
LL + _ => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error: unreachable pattern
|
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 ~ match return_never_tait(x) {
|
||||||
LL + _ => todo!(),
|
LL + _ => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error: unreachable pattern
|
error: unreachable pattern
|
||||||
|
|
|
@ -154,7 +154,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
||||||
|
|
|
|
||||||
LL ~ match 7usize {
|
LL ~ match 7usize {
|
||||||
LL + _ => todo!(),
|
LL + _ => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error: aborting due to 12 previous errors
|
error: aborting due to 12 previous errors
|
||||||
|
|
|
@ -15,7 +15,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
||||||
|
|
|
|
||||||
LL ~ match a {
|
LL ~ match a {
|
||||||
LL + _ => todo!(),
|
LL + _ => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
|
@ -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
|
help: you can use `as` to change the binding name of the import
|
||||||
|
|
|
|
||||||
LL | extern crate std as other_std;
|
LL | extern crate std as other_std;
|
||||||
|
|
| ++++++++++++
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
||||||
|
|
|
|
||||||
LL ~ match NonExhaustiveEnum::Unit {
|
LL ~ match NonExhaustiveEnum::Unit {
|
||||||
LL + NonExhaustiveEnum::Unit | NonExhaustiveEnum::Tuple(_) | NonExhaustiveEnum::Struct { .. } => todo!(),
|
LL + NonExhaustiveEnum::Unit | NonExhaustiveEnum::Tuple(_) | NonExhaustiveEnum::Struct { .. } => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error[E0004]: non-exhaustive patterns: `NormalEnum::Unit`, `NormalEnum::Tuple(_)` and `NormalEnum::Struct { .. }` not covered
|
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 ~ match NormalEnum::Unit {
|
||||||
LL + NormalEnum::Unit | NormalEnum::Tuple(_) | NormalEnum::Struct { .. } => todo!(),
|
LL + NormalEnum::Unit | NormalEnum::Tuple(_) | NormalEnum::Struct { .. } => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error: aborting due to 3 previous errors
|
error: aborting due to 3 previous errors
|
||||||
|
|
|
@ -103,7 +103,7 @@
|
||||||
</tspan>
|
</tspan>
|
||||||
<tspan x="10px" y="748px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan>
|
<tspan x="10px" y="748px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan>
|
||||||
</tspan>
|
</tspan>
|
||||||
<tspan x="10px" y="766px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::Tuple</tspan><tspan class="fg-ansi256-010">(/* i32 */)</tspan><tspan>;</tspan>
|
<tspan x="10px" y="766px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::Tuple(</tspan><tspan class="fg-ansi256-010">/* i32 */</tspan><tspan>);</tspan>
|
||||||
</tspan>
|
</tspan>
|
||||||
<tspan x="10px" y="784px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">+++++++++</tspan>
|
<tspan x="10px" y="784px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">+++++++++</tspan>
|
||||||
</tspan>
|
</tspan>
|
||||||
|
@ -581,7 +581,7 @@
|
||||||
</tspan>
|
</tspan>
|
||||||
<tspan x="10px" y="5050px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-009">- </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-009">tuple</tspan><tspan>();</tspan>
|
<tspan x="10px" y="5050px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-009">- </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-009">tuple</tspan><tspan>();</tspan>
|
||||||
</tspan>
|
</tspan>
|
||||||
<tspan x="10px" y="5068px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-010">+ </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Tuple(/* i32 */)</tspan><tspan>;</tspan>
|
<tspan x="10px" y="5068px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-010">+ </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Tuple</tspan><tspan>(</tspan><tspan class="fg-ansi256-010">/* i32 */</tspan><tspan>);</tspan>
|
||||||
</tspan>
|
</tspan>
|
||||||
<tspan x="10px" y="5086px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan>
|
<tspan x="10px" y="5086px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan>
|
||||||
</tspan>
|
</tspan>
|
||||||
|
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
|
@ -22,8 +22,8 @@ LL | | } else {
|
||||||
|
|
|
|
||||||
help: consider returning the local binding `s`
|
help: consider returning the local binding `s`
|
||||||
|
|
|
|
||||||
LL ~ let s: String = if let Some(s) = opt_str {
|
LL | let s: String = if let Some(s) = opt_str {
|
||||||
LL + s
|
LL ~ s
|
||||||
LL ~
|
LL ~
|
||||||
|
|
|
|
||||||
|
|
||||||
|
@ -54,8 +54,8 @@ LL | | } else {
|
||||||
|
|
|
|
||||||
help: consider returning the local binding `s`
|
help: consider returning the local binding `s`
|
||||||
|
|
|
|
||||||
LL ~ let s: String = if let Some(s) = opt_str {
|
LL | let s: String = if let Some(s) = opt_str {
|
||||||
LL + s
|
LL ~ s
|
||||||
LL ~
|
LL ~
|
||||||
|
|
|
|
||||||
|
|
||||||
|
@ -71,8 +71,8 @@ LL | String::new()
|
||||||
|
|
|
|
||||||
help: consider returning the local binding `s`
|
help: consider returning the local binding `s`
|
||||||
|
|
|
|
||||||
LL ~ let s = if let Some(s) = opt_str {
|
LL | let s = if let Some(s) = opt_str {
|
||||||
LL + s
|
LL ~ s
|
||||||
LL ~ } else {
|
LL ~ } else {
|
||||||
|
|
|
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
||||||
|
|
|
|
||||||
LL ~ match x {
|
LL ~ match x {
|
||||||
LL + UninhabitedVariants::Tuple(_) => todo!(),
|
LL + UninhabitedVariants::Tuple(_) => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error: aborting due to 5 previous errors
|
error: aborting due to 5 previous errors
|
||||||
|
|
|
@ -9,7 +9,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|
||||||
|
|
|
|
||||||
LL ~ match empty_opaque() {
|
LL ~ match empty_opaque() {
|
||||||
LL + _ => todo!(),
|
LL + _ => todo!(),
|
||||||
LL + }
|
LL ~ }
|
||||||
|
|
|
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
|
@ -14,8 +14,8 @@ LL | fn deserialize_token<D: Deserializer<'a>>(_x: D, _y: &'a str) -> &'a st
|
||||||
|
|
|
|
||||||
help: consider returning the local binding `_y`
|
help: consider returning the local binding `_y`
|
||||||
|
|
|
|
||||||
LL ~ fn deserialize_token<D: Deserializer<'a>>(_x: D, _y: &'a str) -> &'a str {
|
LL | fn deserialize_token<D: Deserializer<'a>>(_x: D, _y: &'a str) -> &'a str {
|
||||||
LL + _y
|
LL ~ _y
|
||||||
LL ~
|
LL ~
|
||||||
|
|
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue