@@ -1888,14 +1888,24 @@ fn explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericPredicat
18881888 // Collect the predicates that were written inline by the user on each
18891889 // type parameter (e.g., `<T: Foo>`).
18901890 for param in ast_generics. params {
1891- if let GenericParamKind :: Type { .. } = param. kind {
1892- let name = param. name . ident ( ) . name ;
1893- let param_ty = ty:: ParamTy :: new ( index, name) . to_ty ( tcx) ;
1894- index += 1 ;
1895-
1896- let sized = SizedByDefault :: Yes ;
1897- let bounds = AstConv :: compute_bounds ( & icx, param_ty, & param. bounds , sized, param. span ) ;
1898- predicates. extend ( bounds. predicates ( tcx, param_ty) ) ;
1891+ match param. kind {
1892+ // We already dealt with early bound lifetimes above.
1893+ GenericParamKind :: Lifetime { .. } => ( ) ,
1894+ GenericParamKind :: Type { .. } => {
1895+ let name = param. name . ident ( ) . name ;
1896+ let param_ty = ty:: ParamTy :: new ( index, name) . to_ty ( tcx) ;
1897+ index += 1 ;
1898+
1899+ let sized = SizedByDefault :: Yes ;
1900+ let bounds =
1901+ AstConv :: compute_bounds ( & icx, param_ty, & param. bounds , sized, param. span ) ;
1902+ predicates. extend ( bounds. predicates ( tcx, param_ty) ) ;
1903+ }
1904+ GenericParamKind :: Const { .. } => {
1905+ // Bounds on const parameters are currently not possible.
1906+ debug_assert ! ( param. bounds. is_empty( ) ) ;
1907+ index += 1 ;
1908+ }
18991909 }
19001910 }
19011911
0 commit comments