Skip to content

Commit 38e0dbd

Browse files
authored
Rollup merge of rust-lang#84610 - flip1995:clippyup, r=Manishearth,flip1995
Update Clippy Out of cycle sync: I want to get rust-lang/rust-clippy#7129 into beta that is branched next week. This sync only adds one new feature in efc4c6c, which looks fine to me. Otherwise it only contains bug fixes and/or restricts lints further. r? `@Manishearth`
2 parents 7969de2 + d4af90e commit 38e0dbd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+416
-326
lines changed

src/tools/clippy/clippy_lints/src/casts/ptr_as_ptr.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use std::borrow::Cow;
22

33
use clippy_utils::diagnostics::span_lint_and_sugg;
4-
use clippy_utils::meets_msrv;
54
use clippy_utils::sugg::Sugg;
5+
use clippy_utils::{meets_msrv, msrvs};
66
use if_chain::if_chain;
77
use rustc_errors::Applicability;
88
use rustc_hir::{Expr, ExprKind, Mutability, TyKind};
@@ -12,10 +12,8 @@ use rustc_semver::RustcVersion;
1212

1313
use super::PTR_AS_PTR;
1414

15-
const PTR_AS_PTR_MSRV: RustcVersion = RustcVersion::new(1, 38, 0);
16-
1715
pub(super) fn check(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, msrv: &Option<RustcVersion>) {
18-
if !meets_msrv(msrv.as_ref(), &PTR_AS_PTR_MSRV) {
16+
if !meets_msrv(msrv.as_ref(), &msrvs::POINTER_CAST) {
1917
return;
2018
}
2119

src/tools/clippy/clippy_lints/src/checked_conversions.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use clippy_utils::diagnostics::span_lint_and_sugg;
44
use clippy_utils::source::snippet_with_applicability;
5-
use clippy_utils::{meets_msrv, SpanlessEq};
5+
use clippy_utils::{meets_msrv, msrvs, SpanlessEq};
66
use if_chain::if_chain;
77
use rustc_ast::ast::LitKind;
88
use rustc_errors::Applicability;
@@ -12,8 +12,6 @@ use rustc_middle::lint::in_external_macro;
1212
use rustc_semver::RustcVersion;
1313
use rustc_session::{declare_tool_lint, impl_lint_pass};
1414

15-
const CHECKED_CONVERSIONS_MSRV: RustcVersion = RustcVersion::new(1, 34, 0);
16-
1715
declare_clippy_lint! {
1816
/// **What it does:** Checks for explicit bounds checking when casting.
1917
///
@@ -58,7 +56,7 @@ impl_lint_pass!(CheckedConversions => [CHECKED_CONVERSIONS]);
5856

5957
impl<'tcx> LateLintPass<'tcx> for CheckedConversions {
6058
fn check_expr(&mut self, cx: &LateContext<'_>, item: &Expr<'_>) {
61-
if !meets_msrv(self.msrv.as_ref(), &CHECKED_CONVERSIONS_MSRV) {
59+
if !meets_msrv(self.msrv.as_ref(), &msrvs::TRY_FROM) {
6260
return;
6361
}
6462

src/tools/clippy/clippy_lints/src/from_over_into.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
use clippy_utils::diagnostics::span_lint_and_help;
22
use clippy_utils::paths::INTO;
3-
use clippy_utils::{match_def_path, meets_msrv};
3+
use clippy_utils::{match_def_path, meets_msrv, msrvs};
44
use if_chain::if_chain;
55
use rustc_hir as hir;
66
use rustc_lint::{LateContext, LateLintPass, LintContext};
77
use rustc_semver::RustcVersion;
88
use rustc_session::{declare_tool_lint, impl_lint_pass};
99

10-
const FROM_OVER_INTO_MSRV: RustcVersion = RustcVersion::new(1, 41, 0);
11-
1210
declare_clippy_lint! {
1311
/// **What it does:** Searches for implementations of the `Into<..>` trait and suggests to implement `From<..>` instead.
1412
///
@@ -57,7 +55,7 @@ impl_lint_pass!(FromOverInto => [FROM_OVER_INTO]);
5755

5856
impl LateLintPass<'_> for FromOverInto {
5957
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) {
60-
if !meets_msrv(self.msrv.as_ref(), &FROM_OVER_INTO_MSRV) {
58+
if !meets_msrv(self.msrv.as_ref(), &msrvs::RE_REBALANCING_COHERENCE) {
6159
return;
6260
}
6361

src/tools/clippy/clippy_lints/src/if_then_some_else_none.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use clippy_utils::diagnostics::span_lint_and_help;
22
use clippy_utils::source::snippet_with_macro_callsite;
3-
use clippy_utils::{is_else_clause, is_lang_ctor, meets_msrv};
3+
use clippy_utils::{is_else_clause, is_lang_ctor, meets_msrv, msrvs};
44
use if_chain::if_chain;
55
use rustc_hir::LangItem::{OptionNone, OptionSome};
66
use rustc_hir::{Expr, ExprKind};
@@ -9,8 +9,6 @@ use rustc_middle::lint::in_external_macro;
99
use rustc_semver::RustcVersion;
1010
use rustc_session::{declare_tool_lint, impl_lint_pass};
1111

12-
const IF_THEN_SOME_ELSE_NONE_MSRV: RustcVersion = RustcVersion::new(1, 50, 0);
13-
1412
declare_clippy_lint! {
1513
/// **What it does:** Checks for if-else that could be written to `bool::then`.
1614
///
@@ -59,7 +57,7 @@ impl_lint_pass!(IfThenSomeElseNone => [IF_THEN_SOME_ELSE_NONE]);
5957

6058
impl LateLintPass<'_> for IfThenSomeElseNone {
6159
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'tcx Expr<'_>) {
62-
if !meets_msrv(self.msrv.as_ref(), &IF_THEN_SOME_ELSE_NONE_MSRV) {
60+
if !meets_msrv(self.msrv.as_ref(), &msrvs::BOOL_THEN) {
6361
return;
6462
}
6563

src/tools/clippy/clippy_lints/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
10771077
store.register_late_pass(move || box from_over_into::FromOverInto::new(msrv));
10781078
store.register_late_pass(move || box use_self::UseSelf::new(msrv));
10791079
store.register_late_pass(move || box missing_const_for_fn::MissingConstForFn::new(msrv));
1080-
store.register_late_pass(move || box needless_question_mark::NeedlessQuestionMark::new(msrv));
1080+
store.register_late_pass(move || box needless_question_mark::NeedlessQuestionMark);
10811081
store.register_late_pass(move || box casts::Casts::new(msrv));
10821082
store.register_early_pass(move || box unnested_or_patterns::UnnestedOrPatterns::new(msrv));
10831083

src/tools/clippy/clippy_lints/src/loops/single_element_loop.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,14 @@ pub(super) fn check<'tcx>(
1414
body: &'tcx Expr<'_>,
1515
expr: &'tcx Expr<'_>,
1616
) {
17+
let arg_expr = match arg.kind {
18+
ExprKind::AddrOf(BorrowKind::Ref, _, ref_arg) => ref_arg,
19+
ExprKind::MethodCall(method, _, args, _) if args.len() == 1 && method.ident.name == rustc_span::sym::iter => {
20+
&args[0]
21+
},
22+
_ => return,
23+
};
1724
if_chain! {
18-
if let ExprKind::AddrOf(BorrowKind::Ref, _, arg_expr) = arg.kind;
1925
if let PatKind::Binding(.., target, _) = pat.kind;
2026
if let ExprKind::Array([arg_expression]) = arg_expr.kind;
2127
if let ExprKind::Path(ref list_item) = arg_expression.kind;

src/tools/clippy/clippy_lints/src/manual_non_exhaustive.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clippy_utils::attrs::is_doc_hidden;
22
use clippy_utils::diagnostics::span_lint_and_then;
3-
use clippy_utils::meets_msrv;
43
use clippy_utils::source::snippet_opt;
4+
use clippy_utils::{meets_msrv, msrvs};
55
use if_chain::if_chain;
66
use rustc_ast::ast::{FieldDef, Item, ItemKind, Variant, VariantData, VisibilityKind};
77
use rustc_errors::Applicability;
@@ -10,8 +10,6 @@ use rustc_semver::RustcVersion;
1010
use rustc_session::{declare_tool_lint, impl_lint_pass};
1111
use rustc_span::{sym, Span};
1212

13-
const MANUAL_NON_EXHAUSTIVE_MSRV: RustcVersion = RustcVersion::new(1, 40, 0);
14-
1513
declare_clippy_lint! {
1614
/// **What it does:** Checks for manual implementations of the non-exhaustive pattern.
1715
///
@@ -76,7 +74,7 @@ impl_lint_pass!(ManualNonExhaustive => [MANUAL_NON_EXHAUSTIVE]);
7674

7775
impl EarlyLintPass for ManualNonExhaustive {
7876
fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
79-
if !meets_msrv(self.msrv.as_ref(), &MANUAL_NON_EXHAUSTIVE_MSRV) {
77+
if !meets_msrv(self.msrv.as_ref(), &msrvs::NON_EXHAUSTIVE) {
8078
return;
8179
}
8280

src/tools/clippy/clippy_lints/src/manual_strip.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::consts::{constant, Constant};
22
use clippy_utils::diagnostics::{multispan_sugg, span_lint_and_then};
33
use clippy_utils::source::snippet;
44
use clippy_utils::usage::mutated_variables;
5-
use clippy_utils::{eq_expr_value, higher, match_def_path, meets_msrv, paths};
5+
use clippy_utils::{eq_expr_value, higher, match_def_path, meets_msrv, msrvs, paths};
66
use if_chain::if_chain;
77
use rustc_ast::ast::LitKind;
88
use rustc_hir::def::Res;
@@ -17,8 +17,6 @@ use rustc_session::{declare_tool_lint, impl_lint_pass};
1717
use rustc_span::source_map::Spanned;
1818
use rustc_span::Span;
1919

20-
const MANUAL_STRIP_MSRV: RustcVersion = RustcVersion::new(1, 45, 0);
21-
2220
declare_clippy_lint! {
2321
/// **What it does:**
2422
/// Suggests using `strip_{prefix,suffix}` over `str::{starts,ends}_with` and slicing using
@@ -74,7 +72,7 @@ enum StripKind {
7472

7573
impl<'tcx> LateLintPass<'tcx> for ManualStrip {
7674
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
77-
if !meets_msrv(self.msrv.as_ref(), &MANUAL_STRIP_MSRV) {
75+
if !meets_msrv(self.msrv.as_ref(), &msrvs::STR_STRIP_PREFIX) {
7876
return;
7977
}
8078

src/tools/clippy/clippy_lints/src/manual_unwrap_or.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,23 @@ fn lint_manual_unwrap_or<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
112112
then {
113113
let reindented_or_body =
114114
reindent_multiline(or_body_snippet.into(), true, Some(indent));
115+
116+
let suggestion = if scrutinee.span.from_expansion() {
117+
// we don't want parenthesis around macro, e.g. `(some_macro!()).unwrap_or(0)`
118+
sugg::Sugg::hir_with_macro_callsite(cx, scrutinee, "..")
119+
}
120+
else {
121+
sugg::Sugg::hir(cx, scrutinee, "..").maybe_par()
122+
};
123+
115124
span_lint_and_sugg(
116125
cx,
117126
MANUAL_UNWRAP_OR, expr.span,
118127
&format!("this pattern reimplements `{}`", case.unwrap_fn_path()),
119128
"replace with",
120129
format!(
121130
"{}.unwrap_or({})",
122-
sugg::Sugg::hir(cx, scrutinee, "..").maybe_par(),
131+
suggestion,
123132
reindented_or_body,
124133
),
125134
Applicability::MachineApplicable,

src/tools/clippy/clippy_lints/src/matches.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ use clippy_utils::sugg::Sugg;
77
use clippy_utils::ty::{implements_trait, is_type_diagnostic_item, match_type, peel_mid_ty_refs};
88
use clippy_utils::visitors::LocalUsedVisitor;
99
use clippy_utils::{
10-
get_parent_expr, in_macro, is_allowed, is_expn_of, is_lang_ctor, is_refutable, is_wild, meets_msrv, path_to_local,
11-
path_to_local_id, peel_hir_pat_refs, peel_n_hir_expr_refs, recurse_or_patterns, remove_blocks, strip_pat_refs,
10+
get_parent_expr, in_macro, is_allowed, is_expn_of, is_lang_ctor, is_refutable, is_wild, meets_msrv, msrvs,
11+
path_to_local, path_to_local_id, peel_hir_pat_refs, peel_n_hir_expr_refs, recurse_or_patterns, remove_blocks,
12+
strip_pat_refs,
1213
};
1314
use clippy_utils::{paths, search_same, SpanlessEq, SpanlessHash};
1415
use if_chain::if_chain;
@@ -578,8 +579,6 @@ impl_lint_pass!(Matches => [
578579
MATCH_SAME_ARMS,
579580
]);
580581

581-
const MATCH_LIKE_MATCHES_MACRO_MSRV: RustcVersion = RustcVersion::new(1, 42, 0);
582-
583582
impl<'tcx> LateLintPass<'tcx> for Matches {
584583
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
585584
if in_external_macro(cx.sess(), expr.span) || in_macro(expr.span) {
@@ -588,7 +587,7 @@ impl<'tcx> LateLintPass<'tcx> for Matches {
588587

589588
redundant_pattern_match::check(cx, expr);
590589

591-
if meets_msrv(self.msrv.as_ref(), &MATCH_LIKE_MATCHES_MACRO_MSRV) {
590+
if meets_msrv(self.msrv.as_ref(), &msrvs::MATCHES_MACRO) {
592591
if !check_match_like_matches(cx, expr) {
593592
lint_match_arms(cx, expr);
594593
}

src/tools/clippy/clippy_lints/src/mem_replace.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use clippy_utils::diagnostics::{span_lint_and_help, span_lint_and_sugg, span_lint_and_then};
22
use clippy_utils::source::{snippet, snippet_with_applicability};
3-
use clippy_utils::{in_macro, is_diag_trait_item, is_lang_ctor, match_def_path, meets_msrv, paths};
3+
use clippy_utils::{in_macro, is_diag_trait_item, is_lang_ctor, match_def_path, meets_msrv, msrvs, paths};
44
use if_chain::if_chain;
55
use rustc_errors::Applicability;
66
use rustc_hir::def_id::DefId;
@@ -256,8 +256,6 @@ fn check_replace_with_default(cx: &LateContext<'_>, src: &Expr<'_>, dest: &Expr<
256256
}
257257
}
258258

259-
const MEM_REPLACE_WITH_DEFAULT_MSRV: RustcVersion = RustcVersion::new(1, 40, 0);
260-
261259
pub struct MemReplace {
262260
msrv: Option<RustcVersion>,
263261
}
@@ -281,7 +279,7 @@ impl<'tcx> LateLintPass<'tcx> for MemReplace {
281279
then {
282280
check_replace_option_with_none(cx, src, dest, expr.span);
283281
check_replace_with_uninit(cx, src, dest, expr.span);
284-
if meets_msrv(self.msrv.as_ref(), &MEM_REPLACE_WITH_DEFAULT_MSRV) {
282+
if meets_msrv(self.msrv.as_ref(), &msrvs::MEM_TAKE) {
285283
check_replace_with_default(cx, src, dest, expr.span);
286284
}
287285
}

src/tools/clippy/clippy_lints/src/methods/cloned_instead_of_copied.rs

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
11
use clippy_utils::diagnostics::span_lint_and_sugg;
2-
use clippy_utils::is_trait_method;
32
use clippy_utils::ty::{get_iterator_item_ty, is_copy};
3+
use clippy_utils::{is_trait_method, meets_msrv, msrvs};
44
use rustc_errors::Applicability;
55
use rustc_hir::Expr;
66
use rustc_lint::LateContext;
77
use rustc_middle::ty;
8+
use rustc_semver::RustcVersion;
89
use rustc_span::{sym, Span};
910

1011
use super::CLONED_INSTEAD_OF_COPIED;
1112

12-
pub fn check(cx: &LateContext<'_>, expr: &Expr<'_>, recv: &Expr<'_>, span: Span) {
13+
pub fn check(cx: &LateContext<'_>, expr: &Expr<'_>, recv: &Expr<'_>, span: Span, msrv: Option<&RustcVersion>) {
1314
let recv_ty = cx.typeck_results().expr_ty_adjusted(recv);
1415
let inner_ty = match recv_ty.kind() {
1516
// `Option<T>` -> `T`
16-
ty::Adt(adt, subst) if cx.tcx.is_diagnostic_item(sym::option_type, adt.did) => subst.type_at(0),
17-
_ if is_trait_method(cx, expr, sym::Iterator) => match get_iterator_item_ty(cx, recv_ty) {
18-
// <T as Iterator>::Item
19-
Some(ty) => ty,
20-
_ => return,
17+
ty::Adt(adt, subst)
18+
if cx.tcx.is_diagnostic_item(sym::option_type, adt.did) && meets_msrv(msrv, &msrvs::OPTION_COPIED) =>
19+
{
20+
subst.type_at(0)
21+
},
22+
_ if is_trait_method(cx, expr, sym::Iterator) && meets_msrv(msrv, &msrvs::ITERATOR_COPIED) => {
23+
match get_iterator_item_ty(cx, recv_ty) {
24+
// <T as Iterator>::Item
25+
Some(ty) => ty,
26+
_ => return,
27+
}
2128
},
2229
_ => return,
2330
};

src/tools/clippy/clippy_lints/src/methods/filter_map_next.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use clippy_utils::diagnostics::{span_lint, span_lint_and_sugg};
22
use clippy_utils::source::snippet;
3-
use clippy_utils::{is_trait_method, meets_msrv};
3+
use clippy_utils::{is_trait_method, meets_msrv, msrvs};
44
use rustc_errors::Applicability;
55
use rustc_hir as hir;
66
use rustc_lint::LateContext;
@@ -9,8 +9,6 @@ use rustc_span::sym;
99

1010
use super::FILTER_MAP_NEXT;
1111

12-
const FILTER_MAP_NEXT_MSRV: RustcVersion = RustcVersion::new(1, 30, 0);
13-
1412
pub(super) fn check<'tcx>(
1513
cx: &LateContext<'tcx>,
1614
expr: &'tcx hir::Expr<'_>,
@@ -19,7 +17,7 @@ pub(super) fn check<'tcx>(
1917
msrv: Option<&RustcVersion>,
2018
) {
2119
if is_trait_method(cx, expr, sym::Iterator) {
22-
if !meets_msrv(msrv, &FILTER_MAP_NEXT_MSRV) {
20+
if !meets_msrv(msrv, &msrvs::ITERATOR_FIND_MAP) {
2321
return;
2422
}
2523

src/tools/clippy/clippy_lints/src/methods/map_unwrap_or.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use clippy_utils::diagnostics::{span_lint, span_lint_and_sugg};
2-
use clippy_utils::meets_msrv;
32
use clippy_utils::source::snippet;
43
use clippy_utils::ty::is_type_diagnostic_item;
54
use clippy_utils::usage::mutated_variables;
5+
use clippy_utils::{meets_msrv, msrvs};
66
use rustc_errors::Applicability;
77
use rustc_hir as hir;
88
use rustc_lint::LateContext;
@@ -11,8 +11,6 @@ use rustc_span::symbol::sym;
1111

1212
use super::MAP_UNWRAP_OR;
1313

14-
const MAP_UNWRAP_OR_MSRV: RustcVersion = RustcVersion::new(1, 41, 0);
15-
1614
/// lint use of `map().unwrap_or_else()` for `Option`s and `Result`s
1715
/// Return true if lint triggered
1816
pub(super) fn check<'tcx>(
@@ -23,13 +21,14 @@ pub(super) fn check<'tcx>(
2321
unwrap_arg: &'tcx hir::Expr<'_>,
2422
msrv: Option<&RustcVersion>,
2523
) -> bool {
26-
if !meets_msrv(msrv, &MAP_UNWRAP_OR_MSRV) {
27-
return false;
28-
}
2924
// lint if the caller of `map()` is an `Option`
3025
let is_option = is_type_diagnostic_item(cx, cx.typeck_results().expr_ty(recv), sym::option_type);
3126
let is_result = is_type_diagnostic_item(cx, cx.typeck_results().expr_ty(recv), sym::result_type);
3227

28+
if is_result && !meets_msrv(msrv, &msrvs::RESULT_MAP_OR_ELSE) {
29+
return false;
30+
}
31+
3332
if is_option || is_result {
3433
// Don't make a suggestion that may fail to compile due to mutably borrowing
3534
// the same variable twice.

src/tools/clippy/clippy_lints/src/methods/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1959,7 +1959,7 @@ fn check_methods<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, msrv: Optio
19591959
("as_mut", []) => useless_asref::check(cx, expr, "as_mut", recv),
19601960
("as_ref", []) => useless_asref::check(cx, expr, "as_ref", recv),
19611961
("assume_init", []) => uninit_assumed_init::check(cx, expr, recv),
1962-
("cloned", []) => cloned_instead_of_copied::check(cx, expr, recv, span),
1962+
("cloned", []) => cloned_instead_of_copied::check(cx, expr, recv, span, msrv),
19631963
("collect", []) => match method_call!(recv) {
19641964
Some(("cloned", [recv2], _)) => iter_cloned_collect::check(cx, expr, recv2),
19651965
Some(("map", [m_recv, m_arg], _)) => {

src/tools/clippy/clippy_lints/src/methods/option_as_ref_deref.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clippy_utils::diagnostics::span_lint_and_sugg;
22
use clippy_utils::source::snippet;
33
use clippy_utils::ty::is_type_diagnostic_item;
4-
use clippy_utils::{match_def_path, meets_msrv, path_to_local_id, paths, remove_blocks};
4+
use clippy_utils::{match_def_path, meets_msrv, msrvs, path_to_local_id, paths, remove_blocks};
55
use if_chain::if_chain;
66
use rustc_errors::Applicability;
77
use rustc_hir as hir;
@@ -12,8 +12,6 @@ use rustc_span::sym;
1212

1313
use super::OPTION_AS_REF_DEREF;
1414

15-
const OPTION_AS_REF_DEREF_MSRV: RustcVersion = RustcVersion::new(1, 40, 0);
16-
1715
/// lint use of `_.as_ref().map(Deref::deref)` for `Option`s
1816
pub(super) fn check<'tcx>(
1917
cx: &LateContext<'tcx>,
@@ -23,7 +21,7 @@ pub(super) fn check<'tcx>(
2321
is_mut: bool,
2422
msrv: Option<&RustcVersion>,
2523
) {
26-
if !meets_msrv(msrv, &OPTION_AS_REF_DEREF_MSRV) {
24+
if !meets_msrv(msrv, &msrvs::OPTION_AS_DEREF) {
2725
return;
2826
}
2927

0 commit comments

Comments
 (0)