@@ -212,8 +212,14 @@ impl<'hir> LoweringContext<'_, 'hir> {
212212 } ,
213213 ) ;
214214 self . lower_define_opaque ( hir_id, & define_opaque) ;
215- // TODO: make const arg instead of always using None
216- hir:: ItemKind :: Const ( ident, ty, generics, body_id, None )
215+ let ct_arg = if self . tcx . features ( ) . min_generic_const_args ( )
216+ && let Some ( expr) = expr
217+ {
218+ self . try_lower_as_const_path ( expr)
219+ } else {
220+ None
221+ } ;
222+ hir:: ItemKind :: Const ( ident, ty, generics, body_id, ct_arg)
217223 }
218224 ItemKind :: Fn ( box Fn {
219225 sig : FnSig { decl, header, span : fn_sig_span } ,
@@ -814,8 +820,14 @@ impl<'hir> LoweringContext<'_, 'hir> {
814820 let ty = this
815821 . lower_ty ( ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: ConstTy ) ) ;
816822 let body = expr. as_ref ( ) . map ( |x| this. lower_const_body ( i. span , Some ( x) ) ) ;
817- // TODO: make const arg instead of always using None
818- hir:: TraitItemKind :: Const ( ty, body, None )
823+ let ct_arg = if this. tcx . features ( ) . min_generic_const_args ( )
824+ && let Some ( expr) = expr
825+ {
826+ this. try_lower_as_const_path ( expr)
827+ } else {
828+ None
829+ } ;
830+ hir:: TraitItemKind :: Const ( ty, body, ct_arg)
819831 } ,
820832 ) ;
821833
@@ -1008,8 +1020,14 @@ impl<'hir> LoweringContext<'_, 'hir> {
10081020 . lower_ty ( ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: ConstTy ) ) ;
10091021 let body = this. lower_const_body ( i. span , expr. as_deref ( ) ) ;
10101022 this. lower_define_opaque ( hir_id, & define_opaque) ;
1011- // TODO: make const arg instead of always using None
1012- hir:: ImplItemKind :: Const ( ty, body, None )
1023+ let ct_arg = if this. tcx . features ( ) . min_generic_const_args ( )
1024+ && let Some ( expr) = expr
1025+ {
1026+ this. try_lower_as_const_path ( expr)
1027+ } else {
1028+ None
1029+ } ;
1030+ hir:: ImplItemKind :: Const ( ty, body, ct_arg)
10131031 } ,
10141032 ) ,
10151033 ) ,
0 commit comments