@@ -58,10 +58,9 @@ use crate::{
5858 InTypeConstIdMetadata ,
5959 } ,
6060 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 ,
6564} ;
6665
6766#[ derive( Debug ) ]
@@ -1643,9 +1642,7 @@ pub(crate) fn generic_defaults_recover(
16431642 . iter_id ( )
16441643 . map ( |id| {
16451644 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 ) ,
16491646 Either :: Right ( id) => unknown_const_as_generic ( db. const_param_ty ( id) ) ,
16501647 } ;
16511648 crate :: make_binders ( db, & generic_params, val)
@@ -1991,16 +1988,9 @@ pub(crate) fn generic_arg_to_chalk<'a, T>(
19911988 }
19921989 } ;
19931990 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 ) ,
20041994 ( GenericArg :: Type ( t) , ParamKind :: Const ( c_ty) ) => {
20051995 // We want to recover simple idents, which parser detects them
20061996 // 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>(
20102000 if p. kind == PathKind :: Plain {
20112001 if let [ n] = p. segments ( ) {
20122002 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 ) ) ;
20162004 }
20172005 }
20182006 }
0 commit comments