Don't emit empty notes

This commit is contained in:
Oli Scherer 2022-12-12 12:26:16 +00:00
parent 063b1675b2
commit 2e2a4797a2
14 changed files with 20 additions and 46 deletions

View File

@ -1431,6 +1431,7 @@ impl EmitterWriter {
};
for (i, annotation) in annotations.into_iter().enumerate() {
if let Some(label) = &annotation.label {
if !label.is_empty() {
let style = if annotation.is_primary {
Style::LabelPrimary
} else {
@ -1454,6 +1455,7 @@ impl EmitterWriter {
}
}
}
}
continue;
}

View File

@ -6,8 +6,6 @@ LL | match x { }
|
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
|
= note:
$SRC_DIR/core/src/option.rs:LL:COL: not covered
$SRC_DIR/core/src/option.rs:LL:COL: not covered
= note: the matched value is of type `Option<i32>`

View File

@ -8,8 +8,6 @@ LL | let Some(y) = x;
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
|
= note:
$SRC_DIR/core/src/option.rs:LL:COL: not covered
= note: the matched value is of type `Option<i32>`
help: you might want to use `if let` to ignore the variant that isn't matched

View File

@ -6,8 +6,6 @@ LL | for Some(x) in xs {}
|
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
|
= note:
$SRC_DIR/core/src/option.rs:LL:COL: not covered
= note: the matched value is of type `Option<i32>`

View File

@ -8,8 +8,6 @@ LL | let Ok(_x) = foo();
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Result<u32, !>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
|
= note:
$SRC_DIR/core/src/result.rs:LL:COL: not covered
= note: the matched value is of type `Result<u32, !>`
help: you might want to use `if let` to ignore the variant that isn't matched

View File

@ -6,8 +6,6 @@ LL | match Some(1) {
|
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
|
= note:
$SRC_DIR/core/src/option.rs:LL:COL: not covered
= note: the matched value is of type `Option<i32>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown

View File

@ -66,8 +66,6 @@ LL | match None {
|
note: `Option<HiddenEnum>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
|
= note:
$SRC_DIR/core/src/option.rs:LL:COL: not covered
= note: the matched value is of type `Option<HiddenEnum>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms

View File

@ -107,8 +107,6 @@ LL | match Some(A) {
|
note: `Option<Enum>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
|
= note:
= note: the matched value is of type `Option<Enum>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
|

View File

@ -8,7 +8,7 @@ note: `Box<ElementKind>` defined here
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
$SRC_DIR/alloc/src/boxed.rs:LL:COL
$SRC_DIR/alloc/src/boxed.rs:LL:COL
$SRC_DIR/alloc/src/boxed.rs:LL:COL:
$SRC_DIR/alloc/src/boxed.rs:LL:COL
= note: the matched value is of type `Box<ElementKind>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|

View File

@ -19,8 +19,6 @@ LL | match Some(Some(North)) {
|
note: `Option<Option<Direction>>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
|
= note:
$SRC_DIR/core/src/option.rs:LL:COL: not covered
: not covered
= note: the matched value is of type `Option<Option<Direction>>`

View File

@ -6,8 +6,6 @@ LL | match private::DATA {
|
note: `Option<Private>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
|
= note:
$SRC_DIR/core/src/option.rs:LL:COL: not covered
= note: the matched value is of type `Option<Private>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown

View File

@ -36,8 +36,6 @@ LL | match Some(10) {
|
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
|
= note:
$SRC_DIR/core/src/option.rs:LL:COL: not covered
= note: the matched value is of type `Option<i32>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown

View File

@ -8,8 +8,6 @@ LL | let Ok(x) = res;
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Result<u32, &R<'_>>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
|
= note:
$SRC_DIR/core/src/result.rs:LL:COL: not covered
= note: the matched value is of type `Result<u32, &R<'_>>`
help: you might want to use `if let` to ignore the variant that isn't matched

View File

@ -6,8 +6,6 @@ LL | let _ = match x {
|
note: `Result<u32, &Void>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
|
= note:
$SRC_DIR/core/src/result.rs:LL:COL: not covered
= note: the matched value is of type `Result<u32, &Void>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
@ -85,8 +83,6 @@ LL | let _ = match x {
|
note: `Result<u32, Void>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
|
= note:
$SRC_DIR/core/src/result.rs:LL:COL: not covered
= note: the matched value is of type `Result<u32, Void>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
@ -105,8 +101,6 @@ LL | let Ok(x) = x;
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Result<u32, Void>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
|
= note:
$SRC_DIR/core/src/result.rs:LL:COL: not covered
= note: the matched value is of type `Result<u32, Void>`
help: you might want to use `if let` to ignore the variant that isn't matched