include lifetime in the filter for data layout in analysis-stats

clippy fixes
This commit is contained in:
dfireBird 2024-03-12 00:05:37 +05:30
parent 490391f576
commit 8d08b337fa
No known key found for this signature in database
GPG key ID: 26D522CA5FC2B93D
3 changed files with 5 additions and 4 deletions

View file

@ -1784,7 +1784,7 @@ pub(crate) fn generic_defaults_query(
};
let mut val = p.default.as_ref().map_or_else(
|| unknown_const_as_generic(db.const_param_ty(id.into())),
|| unknown_const_as_generic(db.const_param_ty(id)),
|c| {
let c = ctx.lower_const(c, ctx.lower_ty(&p.ty));
c.cast(Interner)

View file

@ -480,10 +480,10 @@ impl Generics {
crate::to_placeholder_idx(db, id.into()).to_ty(Interner).cast(Interner)
}
GenericParamId::ConstParamId(id) => crate::to_placeholder_idx(db, id.into())
.to_const(Interner, db.const_param_ty(id.into()))
.to_const(Interner, db.const_param_ty(id))
.cast(Interner),
GenericParamId::LifetimeParamId(id) => {
crate::lt_to_placeholder_idx(db, id.into()).to_lifetime(Interner).cast(Interner)
crate::lt_to_placeholder_idx(db, id).to_lifetime(Interner).cast(Interner)
}
}),
)

View file

@ -279,7 +279,8 @@ impl flags::AnalysisStats {
let mut all = 0;
let mut fail = 0;
for &a in adts {
if db.generic_params(a.into()).iter().next().is_some() {
let generic_params = db.generic_params(a.into());
if generic_params.iter().next().is_some() || generic_params.iter_lt().next().is_some() {
// Data types with generics don't have layout.
continue;
}