Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_def/src/path/lower.rs')
-rw-r--r--crates/hir_def/src/path/lower.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/hir_def/src/path/lower.rs b/crates/hir_def/src/path/lower.rs
index 550f12dabd..b6a24cd4ab 100644
--- a/crates/hir_def/src/path/lower.rs
+++ b/crates/hir_def/src/path/lower.rs
@@ -1,6 +1,6 @@
//! Transforms syntax into `Path` objects, ideally with accounting for hygiene
-use crate::intern::Interned;
+use crate::{intern::Interned, type_ref::ConstScalarOrPath};
use either::Either;
use hir_expand::name::{name, AsName};
@@ -180,8 +180,10 @@ pub(super) fn lower_generic_args(
args.push(GenericArg::Lifetime(lifetime_ref))
}
}
- // constants are ignored for now.
- ast::GenericArg::ConstArg(_) => (),
+ ast::GenericArg::ConstArg(arg) => {
+ let arg = ConstScalarOrPath::from_expr_opt(arg.expr());
+ args.push(GenericArg::Const(arg))
+ }
}
}