@@ -542,7 +542,7 @@ fn clean_generic_param_def<'tcx>(
542542 } ,
543543 )
544544 }
545- ty:: GenericParamDefKind :: Const { has_default, .. } => (
545+ ty:: GenericParamDefKind :: Const { has_default, is_host_effect } => (
546546 def. name ,
547547 GenericParamDefKind :: Const {
548548 ty : Box :: new ( clean_middle_ty (
@@ -562,6 +562,7 @@ fn clean_generic_param_def<'tcx>(
562562 ) ) ,
563563 false => None ,
564564 } ,
565+ is_host_effect,
565566 } ,
566567 ) ,
567568 } ;
@@ -618,6 +619,7 @@ fn clean_generic_param<'tcx>(
618619 ty : Box :: new ( clean_ty ( ty, cx) ) ,
619620 default : default
620621 . map ( |ct| Box :: new ( ty:: Const :: from_anon_const ( cx. tcx , ct. def_id ) . to_string ( ) ) ) ,
622+ is_host_effect : cx. tcx . has_attr ( param. def_id , sym:: rustc_host) ,
621623 } ,
622624 ) ,
623625 } ;
@@ -2540,14 +2542,22 @@ fn clean_generic_args<'tcx>(
25402542 let args = generic_args
25412543 . args
25422544 . iter ( )
2543- . map ( |arg| match arg {
2544- hir:: GenericArg :: Lifetime ( lt) if !lt. is_anonymous ( ) => {
2545- GenericArg :: Lifetime ( clean_lifetime ( * lt, cx) )
2546- }
2547- hir:: GenericArg :: Lifetime ( _) => GenericArg :: Lifetime ( Lifetime :: elided ( ) ) ,
2548- hir:: GenericArg :: Type ( ty) => GenericArg :: Type ( clean_ty ( ty, cx) ) ,
2549- hir:: GenericArg :: Const ( ct) => GenericArg :: Const ( Box :: new ( clean_const ( ct, cx) ) ) ,
2550- hir:: GenericArg :: Infer ( _inf) => GenericArg :: Infer ,
2545+ . filter_map ( |arg| {
2546+ Some ( match arg {
2547+ hir:: GenericArg :: Lifetime ( lt) if !lt. is_anonymous ( ) => {
2548+ GenericArg :: Lifetime ( clean_lifetime ( * lt, cx) )
2549+ }
2550+ hir:: GenericArg :: Lifetime ( _) => GenericArg :: Lifetime ( Lifetime :: elided ( ) ) ,
2551+ hir:: GenericArg :: Type ( ty) => GenericArg :: Type ( clean_ty ( ty, cx) ) ,
2552+ // FIXME(effects): This will still emit `<true>` for non-const impls of const traits
2553+ hir:: GenericArg :: Const ( ct)
2554+ if cx. tcx . has_attr ( ct. value . def_id , sym:: rustc_host) =>
2555+ {
2556+ return None ;
2557+ }
2558+ hir:: GenericArg :: Const ( ct) => GenericArg :: Const ( Box :: new ( clean_const ( ct, cx) ) ) ,
2559+ hir:: GenericArg :: Infer ( _inf) => GenericArg :: Infer ,
2560+ } )
25512561 } )
25522562 . collect :: < Vec < _ > > ( )
25532563 . into ( ) ;
0 commit comments