File tree Expand file tree Collapse file tree 4 files changed +18
-9
lines changed Expand file tree Collapse file tree 4 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -2542,14 +2542,21 @@ fn clean_generic_args<'tcx>(
2542
2542
let args = generic_args
2543
2543
. args
2544
2544
. iter ( )
2545
- . map ( |arg| match arg {
2546
- hir:: GenericArg :: Lifetime ( lt) if !lt. is_anonymous ( ) => {
2547
- GenericArg :: Lifetime ( clean_lifetime ( * lt, cx) )
2548
- }
2549
- hir:: GenericArg :: Lifetime ( _) => GenericArg :: Lifetime ( Lifetime :: elided ( ) ) ,
2550
- hir:: GenericArg :: Type ( ty) => GenericArg :: Type ( clean_ty ( ty, cx) ) ,
2551
- hir:: GenericArg :: Const ( ct) => GenericArg :: Const ( Box :: new ( clean_const ( ct, cx) ) ) ,
2552
- 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
+ hir:: GenericArg :: Const ( ct)
2553
+ if cx. tcx . has_attr ( ct. value . def_id , sym:: rustc_host) =>
2554
+ {
2555
+ return None ;
2556
+ }
2557
+ hir:: GenericArg :: Const ( ct) => GenericArg :: Const ( Box :: new ( clean_const ( ct, cx) ) ) ,
2558
+ hir:: GenericArg :: Infer ( _inf) => GenericArg :: Infer ,
2559
+ } )
2553
2560
} )
2554
2561
. collect :: < Vec < _ > > ( )
2555
2562
. 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