@@ -856,7 +856,12 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &ty::GenericParamDef) -> Result<(), Er
856856 let span = tcx. def_span ( param. def_id ) ;
857857 let def_id = param. def_id . expect_local ( ) ;
858858
859- if tcx. features ( ) . adt_const_params ( ) || tcx. features ( ) . min_adt_const_params ( ) {
859+ if tcx. features ( ) . const_param_ty_unchecked ( ) {
860+ enter_wf_checking_ctxt ( tcx, tcx. local_parent ( def_id) , |wfcx| {
861+ wfcx. register_wf_obligation ( span, None , ty. into ( ) ) ;
862+ Ok ( ( ) )
863+ } )
864+ } else if tcx. features ( ) . adt_const_params ( ) || tcx. features ( ) . min_adt_const_params ( ) {
860865 enter_wf_checking_ctxt ( tcx, tcx. local_parent ( def_id) , |wfcx| {
861866 wfcx. register_bound (
862867 ObligationCause :: new ( span, def_id, ObligationCauseCode :: ConstParam ( ty) ) ,
@@ -1363,12 +1368,14 @@ pub(super) fn check_type_const<'tcx>(
13631368 let tcx = wfcx. tcx ( ) ;
13641369 let span = tcx. def_span ( def_id) ;
13651370
1366- wfcx. register_bound (
1367- ObligationCause :: new ( span, def_id, ObligationCauseCode :: ConstParam ( item_ty) ) ,
1368- wfcx. param_env ,
1369- item_ty,
1370- tcx. require_lang_item ( LangItem :: ConstParamTy , span) ,
1371- ) ;
1371+ if !tcx. features ( ) . const_param_ty_unchecked ( ) {
1372+ wfcx. register_bound (
1373+ ObligationCause :: new ( span, def_id, ObligationCauseCode :: ConstParam ( item_ty) ) ,
1374+ wfcx. param_env ,
1375+ item_ty,
1376+ tcx. require_lang_item ( LangItem :: ConstParamTy , span) ,
1377+ ) ;
1378+ }
13721379
13731380 if has_value {
13741381 let raw_ct = tcx. const_of_item ( def_id) . instantiate_identity ( ) ;
0 commit comments