@@ -58,10 +58,9 @@ use crate::{
58
58
InTypeConstIdMetadata ,
59
59
} ,
60
60
AliasEq , AliasTy , Binders , BoundVar , CallableSig , Const , ConstScalar , DebruijnIndex , DynTy ,
61
- FnPointer , FnSig , FnSubst , GenericArgData , ImplTraitId , Interner , ParamKind , PolyFnSig ,
62
- ProjectionTy , QuantifiedWhereClause , QuantifiedWhereClauses , ReturnTypeImplTrait ,
63
- ReturnTypeImplTraits , Substitution , TraitEnvironment , TraitRef , TraitRefExt , Ty , TyBuilder ,
64
- TyKind , WhereClause ,
61
+ FnPointer , FnSig , FnSubst , ImplTraitId , Interner , ParamKind , PolyFnSig , ProjectionTy ,
62
+ QuantifiedWhereClause , QuantifiedWhereClauses , ReturnTypeImplTrait , ReturnTypeImplTraits ,
63
+ Substitution , TraitEnvironment , TraitRef , TraitRefExt , Ty , TyBuilder , TyKind , WhereClause ,
65
64
} ;
66
65
67
66
#[ derive( Debug ) ]
@@ -1643,9 +1642,7 @@ pub(crate) fn generic_defaults_recover(
1643
1642
. iter_id ( )
1644
1643
. map ( |id| {
1645
1644
let val = match id {
1646
- Either :: Left ( _) => {
1647
- GenericArgData :: Ty ( TyKind :: Error . intern ( Interner ) ) . intern ( Interner )
1648
- }
1645
+ Either :: Left ( _) => TyKind :: Error . intern ( Interner ) . cast ( Interner ) ,
1649
1646
Either :: Right ( id) => unknown_const_as_generic ( db. const_param_ty ( id) ) ,
1650
1647
} ;
1651
1648
crate :: make_binders ( db, & generic_params, val)
@@ -1991,16 +1988,9 @@ pub(crate) fn generic_arg_to_chalk<'a, T>(
1991
1988
}
1992
1989
} ;
1993
1990
Some ( match ( arg, kind) {
1994
- ( GenericArg :: Type ( type_ref) , ParamKind :: Type ) => {
1995
- let ty = for_type ( this, type_ref) ;
1996
- GenericArgData :: Ty ( ty) . intern ( Interner )
1997
- }
1998
- ( GenericArg :: Const ( c) , ParamKind :: Const ( c_ty) ) => {
1999
- GenericArgData :: Const ( for_const ( this, c, c_ty) ) . intern ( Interner )
2000
- }
2001
- ( GenericArg :: Const ( _) , ParamKind :: Type ) => {
2002
- GenericArgData :: Ty ( TyKind :: Error . intern ( Interner ) ) . intern ( Interner )
2003
- }
1991
+ ( GenericArg :: Type ( type_ref) , ParamKind :: Type ) => for_type ( this, type_ref) . cast ( Interner ) ,
1992
+ ( GenericArg :: Const ( c) , ParamKind :: Const ( c_ty) ) => for_const ( this, c, c_ty) . cast ( Interner ) ,
1993
+ ( GenericArg :: Const ( _) , ParamKind :: Type ) => TyKind :: Error . intern ( Interner ) . cast ( Interner ) ,
2004
1994
( GenericArg :: Type ( t) , ParamKind :: Const ( c_ty) ) => {
2005
1995
// We want to recover simple idents, which parser detects them
2006
1996
// as types. Maybe here is not the best place to do it, but
@@ -2010,9 +2000,7 @@ pub(crate) fn generic_arg_to_chalk<'a, T>(
2010
2000
if p. kind == PathKind :: Plain {
2011
2001
if let [ n] = p. segments ( ) {
2012
2002
let c = ConstRef :: Path ( n. clone ( ) ) ;
2013
- return Some (
2014
- GenericArgData :: Const ( for_const ( this, & c, c_ty) ) . intern ( Interner ) ,
2015
- ) ;
2003
+ return Some ( for_const ( this, & c, c_ty) . cast ( Interner ) ) ;
2016
2004
}
2017
2005
}
2018
2006
}
0 commit comments