diff options
| author | xiongmao86 <xiongmao86dev@sina.com> | 2020-04-18 18:28:29 +0800 |
|---|---|---|
| committer | xiongmao86 <xiongmao86dev@sina.com> | 2020-04-18 18:28:29 +0800 |
| commit | cf4e35339b1d5a613588b45c53d0e88da5363c65 (patch) | |
| tree | 830fb97e01fb0a1e245aec7afd20494134881136 /clippy_lints/src/empty_enum.rs | |
| parent | d03d3bd95b06b82246a51aaa8e424a67eb724037 (diff) | |
| download | rust-cf4e35339b1d5a613588b45c53d0e88da5363c65.tar.gz rust-cf4e35339b1d5a613588b45c53d0e88da5363c65.zip | |
Add an Option<Span> argument to span_lint_and_help.
Diffstat (limited to 'clippy_lints/src/empty_enum.rs')
| -rw-r--r-- | clippy_lints/src/empty_enum.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clippy_lints/src/empty_enum.rs b/clippy_lints/src/empty_enum.rs index 82c0bf93a7f..2c8721ae505 100644 --- a/clippy_lints/src/empty_enum.rs +++ b/clippy_lints/src/empty_enum.rs @@ -45,13 +45,14 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EmptyEnum { let ty = cx.tcx.type_of(did); let adt = ty.ty_adt_def().expect("already checked whether this is an enum"); if adt.variants.is_empty() { - span_lint_and_then( + span_lint_and_help( cx, EMPTY_ENUM, item.span, "enum with no variants", - "consider using the uninhabited type `!` (never type) or a wrapper around it \ - to introduce a type which can't be instantiated", + Some(item.span), + "consider using the uninhabited type `!` (never type) or a wrapper \ + around it to introduce a type which can't be instantiated", ); } } |
