diff options
| author | Ralf Jung <post@ralfj.de> | 2024-10-09 09:01:57 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-10-23 09:14:41 +0100 |
| commit | 54f9bc4884581f3202c139c94af5507be1d54ff0 (patch) | |
| tree | c2b26073d5ce0b14ed9faaef55ad86d50f966ffe | |
| parent | 088f07a0a793e7f38099f7671d84f290cd748178 (diff) | |
| download | rust-54f9bc4884581f3202c139c94af5507be1d54ff0.tar.gz rust-54f9bc4884581f3202c139c94af5507be1d54ff0.zip | |
nightly feature tracking: get rid of the per-feature bool fields
| -rw-r--r-- | clippy_lints/src/empty_enum.rs | 2 | ||||
| -rw-r--r-- | clippy_lints/src/matches/match_same_arms.rs | 2 | ||||
| -rw-r--r-- | clippy_lints/src/matches/redundant_guards.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/empty_enum.rs b/clippy_lints/src/empty_enum.rs index 70eb81fa09c..b0389fd9a2f 100644 --- a/clippy_lints/src/empty_enum.rs +++ b/clippy_lints/src/empty_enum.rs @@ -64,7 +64,7 @@ impl LateLintPass<'_> for EmptyEnum { fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) { if let ItemKind::Enum(..) = item.kind // Only suggest the `never_type` if the feature is enabled - && cx.tcx.features().never_type + && cx.tcx.features().never_type() && let Some(adt) = cx.tcx.type_of(item.owner_id).instantiate_identity().ty_adt_def() && adt.variants().is_empty() { diff --git a/clippy_lints/src/matches/match_same_arms.rs b/clippy_lints/src/matches/match_same_arms.rs index f9ffbc5dc0b..20984bc40ca 100644 --- a/clippy_lints/src/matches/match_same_arms.rs +++ b/clippy_lints/src/matches/match_same_arms.rs @@ -114,7 +114,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, arms: &'tcx [Arm<'_>]) { let indexed_arms: Vec<(usize, &Arm<'_>)> = arms.iter().enumerate().collect(); for (&(i, arm1), &(j, arm2)) in search_same(&indexed_arms, hash, eq) { if matches!(arm2.pat.kind, PatKind::Wild) { - if !cx.tcx.features().non_exhaustive_omitted_patterns_lint + if !cx.tcx.features().non_exhaustive_omitted_patterns_lint() || is_lint_allowed(cx, NON_EXHAUSTIVE_OMITTED_PATTERNS, arm2.hir_id) { let arm_span = adjusted_arm_span(cx, arm1.span); diff --git a/clippy_lints/src/matches/redundant_guards.rs b/clippy_lints/src/matches/redundant_guards.rs index 564c598a334..42d9efe4ff6 100644 --- a/clippy_lints/src/matches/redundant_guards.rs +++ b/clippy_lints/src/matches/redundant_guards.rs @@ -251,7 +251,7 @@ fn emit_redundant_guards<'tcx>( fn expr_can_be_pat(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { for_each_expr_without_closures(expr, |expr| { if match expr.kind { - ExprKind::ConstBlock(..) => cx.tcx.features().inline_const_pat, + ExprKind::ConstBlock(..) => cx.tcx.features().inline_const_pat(), ExprKind::Call(c, ..) if let ExprKind::Path(qpath) = c.kind => { // Allow ctors matches!(cx.qpath_res(&qpath, c.hir_id), Res::Def(DefKind::Ctor(..), ..)) |
