@@ -521,7 +521,7 @@ fn clean_generic_param_def<'tcx>(
521521 } ,
522522 )
523523 }
524- ty:: GenericParamDefKind :: Const { has_default, .. } => (
524+ ty:: GenericParamDefKind :: Const { has_default, is_host_effect } => (
525525 def. name ,
526526 GenericParamDefKind :: Const {
527527 ty : Box :: new ( clean_middle_ty (
@@ -541,6 +541,7 @@ fn clean_generic_param_def<'tcx>(
541541 ) ) ,
542542 false => None ,
543543 } ,
544+ is_host_effect,
544545 } ,
545546 ) ,
546547 } ;
@@ -597,6 +598,7 @@ fn clean_generic_param<'tcx>(
597598 ty : Box :: new ( clean_ty ( ty, cx) ) ,
598599 default : default
599600 . map ( |ct| Box :: new ( ty:: Const :: from_anon_const ( cx. tcx , ct. def_id ) . to_string ( ) ) ) ,
601+ is_host_effect : cx. tcx . has_attr ( param. def_id , sym:: rustc_host) ,
600602 } ,
601603 ) ,
602604 } ;
@@ -2508,14 +2510,22 @@ fn clean_generic_args<'tcx>(
25082510 let args = generic_args
25092511 . args
25102512 . iter ( )
2511- . map ( |arg| match arg {
2512- hir:: GenericArg :: Lifetime ( lt) if !lt. is_anonymous ( ) => {
2513- GenericArg :: Lifetime ( clean_lifetime ( * lt, cx) )
2514- }
2515- hir:: GenericArg :: Lifetime ( _) => GenericArg :: Lifetime ( Lifetime :: elided ( ) ) ,
2516- hir:: GenericArg :: Type ( ty) => GenericArg :: Type ( clean_ty ( ty, cx) ) ,
2517- hir:: GenericArg :: Const ( ct) => GenericArg :: Const ( Box :: new ( clean_const ( ct, cx) ) ) ,
2518- hir:: GenericArg :: Infer ( _inf) => GenericArg :: Infer ,
2513+ . filter_map ( |arg| {
2514+ Some ( match arg {
2515+ hir:: GenericArg :: Lifetime ( lt) if !lt. is_anonymous ( ) => {
2516+ GenericArg :: Lifetime ( clean_lifetime ( * lt, cx) )
2517+ }
2518+ hir:: GenericArg :: Lifetime ( _) => GenericArg :: Lifetime ( Lifetime :: elided ( ) ) ,
2519+ hir:: GenericArg :: Type ( ty) => GenericArg :: Type ( clean_ty ( ty, cx) ) ,
2520+ // FIXME(effects): This will still emit `<true>` for non-const impls of const traits
2521+ hir:: GenericArg :: Const ( ct)
2522+ if cx. tcx . has_attr ( ct. value . def_id , sym:: rustc_host) =>
2523+ {
2524+ return None ;
2525+ }
2526+ hir:: GenericArg :: Const ( ct) => GenericArg :: Const ( Box :: new ( clean_const ( ct, cx) ) ) ,
2527+ hir:: GenericArg :: Infer ( _inf) => GenericArg :: Infer ,
2528+ } )
25192529 } )
25202530 . collect :: < Vec < _ > > ( )
25212531 . into ( ) ;
0 commit comments