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

Commit 8d08b33

Browse files
committed
include lifetime in the filter for data layout in analysis-stats
clippy fixes
1 parent 490391f commit 8d08b33

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

crates/hir-ty/src/lower.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1784,7 +1784,7 @@ pub(crate) fn generic_defaults_query(
17841784
};
17851785

17861786
let mut val = p.default.as_ref().map_or_else(
1787-
|| unknown_const_as_generic(db.const_param_ty(id.into())),
1787+
|| unknown_const_as_generic(db.const_param_ty(id)),
17881788
|c| {
17891789
let c = ctx.lower_const(c, ctx.lower_ty(&p.ty));
17901790
c.cast(Interner)

crates/hir-ty/src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,10 +480,10 @@ impl Generics {
480480
crate::to_placeholder_idx(db, id.into()).to_ty(Interner).cast(Interner)
481481
}
482482
GenericParamId::ConstParamId(id) => crate::to_placeholder_idx(db, id.into())
483-
.to_const(Interner, db.const_param_ty(id.into()))
483+
.to_const(Interner, db.const_param_ty(id))
484484
.cast(Interner),
485485
GenericParamId::LifetimeParamId(id) => {
486-
crate::lt_to_placeholder_idx(db, id.into()).to_lifetime(Interner).cast(Interner)
486+
crate::lt_to_placeholder_idx(db, id).to_lifetime(Interner).cast(Interner)
487487
}
488488
}),
489489
)

crates/rust-analyzer/src/cli/analysis_stats.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@ impl flags::AnalysisStats {
279279
let mut all = 0;
280280
let mut fail = 0;
281281
for &a in adts {
282-
if db.generic_params(a.into()).iter().next().is_some() {
282+
let generic_params = db.generic_params(a.into());
283+
if generic_params.iter().next().is_some() || generic_params.iter_lt().next().is_some() {
283284
// Data types with generics don't have layout.
284285
continue;
285286
}

0 commit comments

Comments
 (0)