1
Fork 0

Rollup merge of #133443 - fmease:rm-dead-eff-code-ii, r=compiler-errors

Remove dead code stemming from the old effects desugaring (II)

Follow-up to #132374.
r? project-const-traits
This commit is contained in:
Guillaume Gomez 2024-11-26 15:32:15 +01:00 committed by GitHub
commit 03f56d36ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 33 deletions

View file

@ -261,8 +261,6 @@ pub struct ConstArg<'hir> {
#[stable_hasher(ignore)]
pub hir_id: HirId,
pub kind: ConstArgKind<'hir>,
/// Indicates whether this comes from a `~const` desugaring.
pub is_desugared_from_effects: bool,
}
impl<'hir> ConstArg<'hir> {
@ -462,14 +460,7 @@ impl<'hir> GenericArgs<'hir> {
/// This function returns the number of type and const generic params.
/// It should only be used for diagnostics.
pub fn num_generic_params(&self) -> usize {
self.args
.iter()
.filter(|arg| match arg {
GenericArg::Lifetime(_)
| GenericArg::Const(ConstArg { is_desugared_from_effects: true, .. }) => false,
_ => true,
})
.count()
self.args.iter().filter(|arg| !matches!(arg, GenericArg::Lifetime(_))).count()
}
/// The span encompassing the arguments and constraints[^1] inside the surrounding brackets.