mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 21:54:42 +00:00
include lifetime in the filter for data layout in analysis-stats
clippy fixes
This commit is contained in:
parent
490391f576
commit
8d08b337fa
3 changed files with 5 additions and 4 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}),
|
||||
)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue