@@ -542,7 +542,7 @@ fn clean_generic_param_def<'tcx>(
542
542
} ,
543
543
)
544
544
}
545
- ty:: GenericParamDefKind :: Const { has_default, .. } => (
545
+ ty:: GenericParamDefKind :: Const { has_default, is_host_effect } => (
546
546
def. name ,
547
547
GenericParamDefKind :: Const {
548
548
ty : Box :: new ( clean_middle_ty (
@@ -562,6 +562,7 @@ fn clean_generic_param_def<'tcx>(
562
562
) ) ,
563
563
false => None ,
564
564
} ,
565
+ is_host_effect,
565
566
} ,
566
567
) ,
567
568
} ;
@@ -618,6 +619,7 @@ fn clean_generic_param<'tcx>(
618
619
ty : Box :: new ( clean_ty ( ty, cx) ) ,
619
620
default : default
620
621
. 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) ,
621
623
} ,
622
624
) ,
623
625
} ;
@@ -2540,14 +2542,22 @@ fn clean_generic_args<'tcx>(
2540
2542
let args = generic_args
2541
2543
. args
2542
2544
. 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
+ } )
2551
2561
} )
2552
2562
. collect :: < Vec < _ > > ( )
2553
2563
. into ( ) ;
0 commit comments