File tree 4 files changed +18
-9
lines changed
4 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -2510,14 +2510,21 @@ fn clean_generic_args<'tcx>(
2510
2510
let args = generic_args
2511
2511
. args
2512
2512
. iter ( )
2513
- . map ( |arg| match arg {
2514
- hir:: GenericArg :: Lifetime ( lt) if !lt. is_anonymous ( ) => {
2515
- GenericArg :: Lifetime ( clean_lifetime ( * lt, cx) )
2516
- }
2517
- hir:: GenericArg :: Lifetime ( _) => GenericArg :: Lifetime ( Lifetime :: elided ( ) ) ,
2518
- hir:: GenericArg :: Type ( ty) => GenericArg :: Type ( clean_ty ( ty, cx) ) ,
2519
- hir:: GenericArg :: Const ( ct) => GenericArg :: Const ( Box :: new ( clean_const ( ct, cx) ) ) ,
2520
- 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
+ hir:: GenericArg :: Const ( ct)
2521
+ if cx. tcx . has_attr ( ct. value . def_id , sym:: rustc_host) =>
2522
+ {
2523
+ return None ;
2524
+ }
2525
+ hir:: GenericArg :: Const ( ct) => GenericArg :: Const ( Box :: new ( clean_const ( ct, cx) ) ) ,
2526
+ hir:: GenericArg :: Infer ( _inf) => GenericArg :: Infer ,
2527
+ } )
2521
2528
} )
2522
2529
. collect :: < Vec < _ > > ( )
2523
2530
. into ( ) ;
Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ pub(crate) fn ty_args_to_args<'tcx>(
104
104
arg : index,
105
105
} ) ,
106
106
) ) ) ,
107
+ GenericArgKind :: Const ( ct) if let ty:: ConstKind :: Param ( p) = ct. kind ( ) && p. name == sym:: host => None ,
107
108
GenericArgKind :: Const ( ct) => {
108
109
Some ( GenericArg :: Const ( Box :: new ( clean_middle_const ( kind. rebind ( ct) , cx) ) ) )
109
110
}
Original file line number Diff line number Diff line change 6
6
#![ feature( array_methods) ]
7
7
#![ feature( assert_matches) ]
8
8
#![ feature( box_patterns) ]
9
+ #![ feature( if_let_guard) ]
9
10
#![ feature( impl_trait_in_assoc_type) ]
10
11
#![ feature( iter_intersperse) ]
11
12
#![ feature( lazy_cell) ]
Original file line number Diff line number Diff line change @@ -7,6 +7,6 @@ pub trait Tr {
7
7
}
8
8
9
9
// @has foo/fn.g.html
10
- // @has - '//pre[@class="rust item-decl"]' 'pub const fn g<T: Tr<host> >()'
10
+ // @has - '//pre[@class="rust item-decl"]' 'pub const fn g<T: Tr>()'
11
11
/// foo
12
12
pub const fn g < T : ~const Tr > ( ) { }
You can’t perform that action at this time.
0 commit comments