@@ -31,7 +31,6 @@ use rustc_span::hygiene::{AstPass, MacroKind};
31
31
use rustc_span:: symbol:: { kw, sym, Ident , Symbol } ;
32
32
use rustc_span:: { self , ExpnKind } ;
33
33
34
- use std:: assert_matches:: assert_matches;
35
34
use std:: collections:: hash_map:: Entry ;
36
35
use std:: collections:: BTreeMap ;
37
36
use std:: default:: Default ;
@@ -270,15 +269,7 @@ fn clean_where_predicate<'tcx>(
270
269
let bound_params = wbp
271
270
. bound_generic_params
272
271
. iter ( )
273
- . map ( |param| {
274
- // Higher-ranked params must be lifetimes.
275
- // Higher-ranked lifetimes can't have bounds.
276
- assert_matches ! (
277
- param,
278
- hir:: GenericParam { kind: hir:: GenericParamKind :: Lifetime { .. } , .. }
279
- ) ;
280
- Lifetime ( param. name . ident ( ) . name )
281
- } )
272
+ . map ( |param| clean_generic_param ( cx, None , param) )
282
273
. collect ( ) ;
283
274
WherePredicate :: BoundPredicate {
284
275
ty : clean_ty ( wbp. bounded_ty , cx) ,
@@ -410,7 +401,7 @@ fn clean_projection_predicate<'tcx>(
410
401
. collect_referenced_late_bound_regions ( & pred)
411
402
. into_iter ( )
412
403
. filter_map ( |br| match br {
413
- ty:: BrNamed ( _, name) if br. is_named ( ) => Some ( Lifetime ( name) ) ,
404
+ ty:: BrNamed ( _, name) if br. is_named ( ) => Some ( GenericParamDef :: lifetime ( name) ) ,
414
405
_ => None ,
415
406
} )
416
407
. collect ( ) ;
@@ -508,7 +499,6 @@ fn clean_generic_param_def<'tcx>(
508
499
ty:: GenericParamDefKind :: Const { has_default } => (
509
500
def. name ,
510
501
GenericParamDefKind :: Const {
511
- did : def. def_id ,
512
502
ty : Box :: new ( clean_middle_ty (
513
503
ty:: Binder :: dummy (
514
504
cx. tcx
@@ -578,7 +568,6 @@ fn clean_generic_param<'tcx>(
578
568
hir:: GenericParamKind :: Const { ty, default } => (
579
569
param. name . ident ( ) . name ,
580
570
GenericParamDefKind :: Const {
581
- did : param. def_id . to_def_id ( ) ,
582
571
ty : Box :: new ( clean_ty ( ty, cx) ) ,
583
572
default : default
584
573
. map ( |ct| Box :: new ( ty:: Const :: from_anon_const ( cx. tcx , ct. def_id ) . to_string ( ) ) ) ,
@@ -831,7 +820,7 @@ fn clean_ty_generics<'tcx>(
831
820
p. get_bound_params ( )
832
821
. into_iter ( )
833
822
. flatten ( )
834
- . map ( |param| GenericParamDef :: lifetime ( param . 0 ) )
823
+ . cloned ( )
835
824
. collect ( ) ,
836
825
) ) ;
837
826
}
0 commit comments