Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 5507482

Browse files
Don't store lazyness in DefKind
1 parent e2669b2 commit 5507482

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

clippy_lints/src/init_numbered_fields.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl<'tcx> LateLintPass<'tcx> for NumberedFields {
5050
&& fields
5151
.iter()
5252
.all(|f| f.ident.as_str().as_bytes().iter().all(u8::is_ascii_digit))
53-
&& !matches!(cx.qpath_res(path, e.hir_id), Res::Def(DefKind::TyAlias { .. }, ..))
53+
&& !matches!(cx.qpath_res(path, e.hir_id), Res::Def(DefKind::TyAlias, ..))
5454
{
5555
let expr_spans = fields
5656
.iter()

clippy_utils/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ pub fn is_wild(pat: &Pat<'_>) -> bool {
288288
/// Checks if the given `QPath` belongs to a type alias.
289289
pub fn is_ty_alias(qpath: &QPath<'_>) -> bool {
290290
match *qpath {
291-
QPath::Resolved(_, path) => matches!(path.res, Res::Def(DefKind::TyAlias { .. } | DefKind::AssocTy, ..)),
291+
QPath::Resolved(_, path) => matches!(path.res, Res::Def(DefKind::TyAlias | DefKind::AssocTy, ..)),
292292
QPath::TypeRelative(ty, _) if let TyKind::Path(qpath) = ty.kind => { is_ty_alias(&qpath) },
293293
_ => false,
294294
}

clippy_utils/src/ty/type_certainty/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ fn path_segment_certainty(
220220
// See the comment preceding `qpath_certainty`. `def_id` could refer to a type or a value.
221221
let certainty = lhs.join_clearing_def_ids(rhs);
222222
if resolves_to_type {
223-
if let DefKind::TyAlias { .. } = cx.tcx.def_kind(def_id) {
223+
if let DefKind::TyAlias = cx.tcx.def_kind(def_id) {
224224
adt_def_id(cx.tcx.type_of(def_id).instantiate_identity())
225225
.map_or(certainty, |def_id| certainty.with_def_id(def_id))
226226
} else {

0 commit comments

Comments
 (0)