@@ -521,7 +521,7 @@ fn clean_generic_param_def<'tcx>(
521
521
} ,
522
522
)
523
523
}
524
- ty:: GenericParamDefKind :: Const { has_default, .. } => (
524
+ ty:: GenericParamDefKind :: Const { has_default, is_host_effect } => (
525
525
def. name ,
526
526
GenericParamDefKind :: Const {
527
527
ty : Box :: new ( clean_middle_ty (
@@ -541,6 +541,7 @@ fn clean_generic_param_def<'tcx>(
541
541
) ) ,
542
542
false => None ,
543
543
} ,
544
+ is_host_effect,
544
545
} ,
545
546
) ,
546
547
} ;
@@ -597,6 +598,7 @@ fn clean_generic_param<'tcx>(
597
598
ty : Box :: new ( clean_ty ( ty, cx) ) ,
598
599
default : default
599
600
. 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) ,
600
602
} ,
601
603
) ,
602
604
} ;
@@ -2508,14 +2510,22 @@ fn clean_generic_args<'tcx>(
2508
2510
let args = generic_args
2509
2511
. args
2510
2512
. 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
+ } )
2519
2529
} )
2520
2530
. collect :: < Vec < _ > > ( )
2521
2531
. into ( ) ;
0 commit comments