diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2023-11-20 14:09:02 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2023-11-22 13:42:13 +0100 |
| commit | 91fc4b300111fa32b9fa7169d4b14f8584fbaf11 (patch) | |
| tree | a7fd530827b5364890434f2ff6ec7982e4bff7c1 /clippy_lints | |
| parent | 6eb935a578f7b2fcd87377bd571c4ff1dec48982 (diff) | |
Remove underscore check for `manual_non_exhaustive` lint
Diffstat (limited to 'clippy_lints')
| -rw-r--r-- | clippy_lints/src/manual_non_exhaustive.rs | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/clippy_lints/src/manual_non_exhaustive.rs b/clippy_lints/src/manual_non_exhaustive.rs index fc8f2363001..fb30e371f59 100644 --- a/clippy_lints/src/manual_non_exhaustive.rs +++ b/clippy_lints/src/manual_non_exhaustive.rs @@ -118,7 +118,6 @@ impl EarlyLintPass for ManualNonExhaustiveStruct { if let Some(Ok(field)) = iter.next() && iter.next().is_none() && field.ty.kind.is_unit() - && field.ident.map_or(true, |name| name.as_str().starts_with('_')) { span_lint_and_then( cx, @@ -158,7 +157,6 @@ impl<'tcx> LateLintPass<'tcx> for ManualNonExhaustiveEnum { { let mut iter = def.variants.iter().filter_map(|v| { (matches!(v.data, hir::VariantData::Unit(_, _)) - && v.ident.as_str().starts_with('_') && is_doc_hidden(cx.tcx.hir().attrs(v.hir_id)) && !attr::contains_name(cx.tcx.hir().attrs(item.hir_id()), sym::non_exhaustive)) .then_some((v.def_id, v.span)) @@ -173,9 +171,7 @@ impl<'tcx> LateLintPass<'tcx> for ManualNonExhaustiveEnum { fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { if let ExprKind::Path(QPath::Resolved(None, p)) = &e.kind - && let [.., name] = p.segments && let Res::Def(DefKind::Ctor(CtorOf::Variant, CtorKind::Const), id) = p.res - && name.ident.as_str().starts_with('_') { let variant_id = cx.tcx.parent(id); let enum_id = cx.tcx.parent(variant_id); |
