@@ -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 ;
@@ -269,15 +268,7 @@ fn clean_where_predicate<'tcx>(
269
268
let bound_params = wbp
270
269
. bound_generic_params
271
270
. iter ( )
272
- . map ( |param| {
273
- // Higher-ranked params must be lifetimes.
274
- // Higher-ranked lifetimes can't have bounds.
275
- assert_matches ! (
276
- param,
277
- hir:: GenericParam { kind: hir:: GenericParamKind :: Lifetime { .. } , .. }
278
- ) ;
279
- Lifetime ( param. name . ident ( ) . name )
280
- } )
271
+ . map ( |param| clean_generic_param ( cx, None , param) )
281
272
. collect ( ) ;
282
273
WherePredicate :: BoundPredicate {
283
274
ty : clean_ty ( wbp. bounded_ty , cx) ,
@@ -409,7 +400,7 @@ fn clean_projection_predicate<'tcx>(
409
400
. collect_referenced_late_bound_regions ( & pred)
410
401
. into_iter ( )
411
402
. filter_map ( |br| match br {
412
- ty:: BrNamed ( _, name) if br. is_named ( ) => Some ( Lifetime ( name) ) ,
403
+ ty:: BrNamed ( _, name) if br. is_named ( ) => Some ( GenericParamDef :: lifetime ( name) ) ,
413
404
_ => None ,
414
405
} )
415
406
. collect ( ) ;
@@ -507,7 +498,6 @@ fn clean_generic_param_def<'tcx>(
507
498
ty:: GenericParamDefKind :: Const { has_default } => (
508
499
def. name ,
509
500
GenericParamDefKind :: Const {
510
- did : def. def_id ,
511
501
ty : Box :: new ( clean_middle_ty (
512
502
ty:: Binder :: dummy (
513
503
cx. tcx
@@ -577,7 +567,6 @@ fn clean_generic_param<'tcx>(
577
567
hir:: GenericParamKind :: Const { ty, default } => (
578
568
param. name . ident ( ) . name ,
579
569
GenericParamDefKind :: Const {
580
- did : param. def_id . to_def_id ( ) ,
581
570
ty : Box :: new ( clean_ty ( ty, cx) ) ,
582
571
default : default
583
572
. map ( |ct| Box :: new ( ty:: Const :: from_anon_const ( cx. tcx , ct. def_id ) . to_string ( ) ) ) ,
@@ -830,7 +819,7 @@ fn clean_ty_generics<'tcx>(
830
819
p. get_bound_params ( )
831
820
. into_iter ( )
832
821
. flatten ( )
833
- . map ( |param| GenericParamDef :: lifetime ( param . 0 ) )
822
+ . cloned ( )
834
823
. collect ( ) ,
835
824
) ) ;
836
825
}
0 commit comments