Skip to content

Commit e06731b

Browse files
committed
Add has_default to GenericParamDefKind::Const
This currently creates a field which is always false on GenericParamDefKind for future use when consts are permitted to have defaults Update const_generics:default locations Previously just ignored them, now actually do something about them. Fix using type check instead of value Add parsing This adds all the necessary changes to lower const-generics defaults from parsing. Change P<Expr> to AnonConst This matches the arguments passed to instantiations of const generics, and makes it specific to just anonymous constants. Attempt to fix lowering bugs
1 parent 2bc180e commit e06731b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clippy_utils/src/ast_utils.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,10 @@ pub fn eq_use_tree(l: &UseTree, r: &UseTree) -> bool {
408408
eq_path(&l.prefix, &r.prefix) && eq_use_tree_kind(&l.kind, &r.kind)
409409
}
410410

411+
pub fn eq_anon_const(l: &AnonConst, r: &AnonConst) -> bool {
412+
eq_expr(&l.value, &r.value)
413+
}
414+
411415
pub fn eq_use_tree_kind(l: &UseTreeKind, r: &UseTreeKind) -> bool {
412416
use UseTreeKind::*;
413417
match (l, r) {
@@ -418,10 +422,6 @@ pub fn eq_use_tree_kind(l: &UseTreeKind, r: &UseTreeKind) -> bool {
418422
}
419423
}
420424

421-
pub fn eq_anon_const(l: &AnonConst, r: &AnonConst) -> bool {
422-
eq_expr(&l.value, &r.value)
423-
}
424-
425425
pub fn eq_defaultness(l: Defaultness, r: Defaultness) -> bool {
426426
matches!(
427427
(l, r),

0 commit comments

Comments
 (0)