diff options
Diffstat (limited to 'tests')
3 files changed, 42 insertions, 31 deletions
diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns-dont-lint-on-arm.lint.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns-dont-lint-on-arm.lint.stderr index b0629c6de1a..9192c66143c 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns-dont-lint-on-arm.lint.stderr +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns-dont-lint-on-arm.lint.stderr @@ -26,44 +26,50 @@ note: the lint level is defined here LL | #[cfg_attr(lint, deny(non_exhaustive_omitted_patterns))] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: the `non_exhaustive_omitted_pattern` lint level must be set on the whole match +warning: the lint level must be set on the whole match --> $DIR/omitted-patterns-dont-lint-on-arm.rs:34:9 | +LL | #[deny(non_exhaustive_omitted_patterns)] + | ------------------------------- remove this attribute LL | _ => {} | ^ | - = help: it used to make sense to set the lint level on an individual match arm, but that is no longer the case -note: the lint level is defined here - --> $DIR/omitted-patterns-dont-lint-on-arm.rs:33:16 + = help: it no longer has any effect to set the lint level on an individual match arm +help: set the lint level on the whole match + | +LL + #[deny(non_exhaustive_omitted_patterns)] +LL | match val { | -LL | #[deny(non_exhaustive_omitted_patterns)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: the `non_exhaustive_omitted_pattern` lint level must be set on the whole match - --> $DIR/omitted-patterns-dont-lint-on-arm.rs:41:9 +warning: the lint level must be set on the whole match + --> $DIR/omitted-patterns-dont-lint-on-arm.rs:42:9 | +LL | #[cfg_attr(lint, deny(non_exhaustive_omitted_patterns))] + | ------------------------------- remove this attribute LL | _ => {} | ^ | - = help: it used to make sense to set the lint level on an individual match arm, but that is no longer the case -note: the lint level is defined here - --> $DIR/omitted-patterns-dont-lint-on-arm.rs:40:31 + = help: it no longer has any effect to set the lint level on an individual match arm +help: set the lint level on the whole match + | +LL + #[deny(non_exhaustive_omitted_patterns)] +LL | match val { | -LL | #[cfg_attr(lint, deny(non_exhaustive_omitted_patterns))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -warning: the `non_exhaustive_omitted_pattern` lint level must be set on the whole match - --> $DIR/omitted-patterns-dont-lint-on-arm.rs:48:9 +warning: the lint level must be set on the whole match + --> $DIR/omitted-patterns-dont-lint-on-arm.rs:50:9 | +LL | #[cfg_attr(lint, warn(non_exhaustive_omitted_patterns))] + | ------------------------------- remove this attribute LL | _ => {} | ^ | - = help: it used to make sense to set the lint level on an individual match arm, but that is no longer the case -note: the lint level is defined here - --> $DIR/omitted-patterns-dont-lint-on-arm.rs:47:31 + = help: it no longer has any effect to set the lint level on an individual match arm +help: set the lint level on the whole match + | +LL + #[warn(non_exhaustive_omitted_patterns)] +LL | match val { | -LL | #[cfg_attr(lint, warn(non_exhaustive_omitted_patterns))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 4 previous errors; 1 warning emitted +error: aborting due to 2 previous errors; 3 warnings emitted diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns-dont-lint-on-arm.normal.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns-dont-lint-on-arm.normal.stderr index a7a2ad3a5f0..46093eb9fb3 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns-dont-lint-on-arm.normal.stderr +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns-dont-lint-on-arm.normal.stderr @@ -12,18 +12,20 @@ note: the lint level is defined here LL | #[deny(non_exhaustive_omitted_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: the `non_exhaustive_omitted_pattern` lint level must be set on the whole match +warning: the lint level must be set on the whole match --> $DIR/omitted-patterns-dont-lint-on-arm.rs:34:9 | +LL | #[deny(non_exhaustive_omitted_patterns)] + | ------------------------------- remove this attribute LL | _ => {} | ^ | - = help: it used to make sense to set the lint level on an individual match arm, but that is no longer the case -note: the lint level is defined here - --> $DIR/omitted-patterns-dont-lint-on-arm.rs:33:16 + = help: it no longer has any effect to set the lint level on an individual match arm +help: set the lint level on the whole match + | +LL + #[deny(non_exhaustive_omitted_patterns)] +LL | match val { | -LL | #[deny(non_exhaustive_omitted_patterns)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 2 previous errors +error: aborting due to previous error; 1 warning emitted diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns-dont-lint-on-arm.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns-dont-lint-on-arm.rs index ac7b7cd93fd..33f9f56a5bb 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns-dont-lint-on-arm.rs +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns-dont-lint-on-arm.rs @@ -31,20 +31,23 @@ fn main() { NonExhaustiveEnum::Unit => {} NonExhaustiveEnum::Tuple(_) => {} #[deny(non_exhaustive_omitted_patterns)] - _ => {} //~ ERROR lint level must be set on the whole match + _ => {} } + //~^^ WARN lint level must be set on the whole match match val { NonExhaustiveEnum::Unit => {} NonExhaustiveEnum::Tuple(_) => {} #[cfg_attr(lint, deny(non_exhaustive_omitted_patterns))] - _ => {} //[lint]~ ERROR lint level must be set on the whole match + _ => {} } + //[lint]~^^ WARN lint level must be set on the whole match match val { NonExhaustiveEnum::Unit => {} NonExhaustiveEnum::Tuple(_) => {} #[cfg_attr(lint, warn(non_exhaustive_omitted_patterns))] - _ => {} //[lint]~ WARN lint level must be set on the whole match + _ => {} } + //[lint]~^^ WARN lint level must be set on the whole match } |
