@@ -59,7 +59,7 @@ use crate::{
5959 lt_from_placeholder_idx,
6060 mir:: pad16,
6161 next_solver:: {
62- BoundExistentialPredicate , Ctor , DbInterner , GenericArgs , SolverDefId ,
62+ BoundExistentialPredicate , DbInterner , GenericArgs , SolverDefId ,
6363 mapping:: {
6464 ChalkToNextSolver , convert_args_for_result, convert_const_for_result,
6565 convert_region_for_result, convert_ty_for_result,
@@ -911,14 +911,13 @@ fn render_const_scalar_inner(
911911 f. write_str ( "&" ) ?;
912912 render_const_scalar_ns ( f, bytes, memory_map, t)
913913 }
914- TyKind :: Adt ( adt, _) if b. len ( ) == 2 * size_of :: < usize > ( ) => match adt. def_id ( ) {
915- SolverDefId :: AdtId ( hir_def:: AdtId :: StructId ( s) ) => {
914+ TyKind :: Adt ( adt, _) if b. len ( ) == 2 * size_of :: < usize > ( ) => match adt. def_id ( ) . 0 {
915+ hir_def:: AdtId :: StructId ( s) => {
916916 let data = f. db . struct_signature ( s) ;
917917 write ! ( f, "&{}" , data. name. display( f. db, f. edition( ) ) ) ?;
918918 Ok ( ( ) )
919919 }
920- SolverDefId :: AdtId ( _) => f. write_str ( "<unsized-enum-or-union>" ) ,
921- _ => unreachable ! ( ) ,
920+ _ => f. write_str ( "<unsized-enum-or-union>" ) ,
922921 } ,
923922 _ => {
924923 let addr = usize:: from_le_bytes ( match b. try_into ( ) {
@@ -966,10 +965,7 @@ fn render_const_scalar_inner(
966965 f. write_str ( ")" )
967966 }
968967 TyKind :: Adt ( def, args) => {
969- let def = match def. def_id ( ) {
970- SolverDefId :: AdtId ( def) => def,
971- _ => unreachable ! ( ) ,
972- } ;
968+ let def = def. def_id ( ) . 0 ;
973969 let Ok ( layout) = f. db . layout_of_adt ( def, args, trait_env. clone ( ) ) else {
974970 return f. write_str ( "<layout-error>" ) ;
975971 } ;
@@ -1300,12 +1296,7 @@ impl<'db> HirDisplay for crate::next_solver::Ty<'db> {
13001296 sig. hir_fmt ( f) ?;
13011297 }
13021298 TyKind :: FnDef ( def, args) => {
1303- let def = match def {
1304- SolverDefId :: FunctionId ( id) => CallableDefId :: FunctionId ( id) ,
1305- SolverDefId :: Ctor ( Ctor :: Enum ( e) ) => CallableDefId :: EnumVariantId ( e) ,
1306- SolverDefId :: Ctor ( Ctor :: Struct ( s) ) => CallableDefId :: StructId ( s) ,
1307- _ => unreachable ! ( ) ,
1308- } ;
1299+ let def = def. 0 ;
13091300 let sig = db
13101301 . callable_item_signature ( def)
13111302 . substitute ( Interner , & convert_args_for_result ( interner, args. as_slice ( ) ) ) ;
@@ -1406,10 +1397,7 @@ impl<'db> HirDisplay for crate::next_solver::Ty<'db> {
14061397 }
14071398 }
14081399 TyKind :: Adt ( def, parameters) => {
1409- let def_id = match def. def_id ( ) {
1410- SolverDefId :: AdtId ( id) => id,
1411- _ => unreachable ! ( ) ,
1412- } ;
1400+ let def_id = def. def_id ( ) . 0 ;
14131401 f. start_location_link ( def_id. into ( ) ) ;
14141402 match f. display_kind {
14151403 DisplayKind :: Diagnostics | DisplayKind :: Test => {
@@ -1448,7 +1436,7 @@ impl<'db> HirDisplay for crate::next_solver::Ty<'db> {
14481436 hir_fmt_generics (
14491437 f,
14501438 convert_args_for_result ( interner, parameters. as_slice ( ) ) . as_slice ( Interner ) ,
1451- def. def_id ( ) . try_into ( ) . ok ( ) ,
1439+ Some ( def. def_id ( ) . 0 . into ( ) ) ,
14521440 None ,
14531441 ) ?;
14541442 }
@@ -1466,13 +1454,9 @@ impl<'db> HirDisplay for crate::next_solver::Ty<'db> {
14661454
14671455 projection_ty. hir_fmt ( f) ?;
14681456 }
1469- TyKind :: Foreign ( type_alias) => {
1470- let alias = match type_alias {
1471- SolverDefId :: TypeAliasId ( id) => id,
1472- _ => unreachable ! ( ) ,
1473- } ;
1474- let type_alias = db. type_alias_signature ( alias) ;
1475- f. start_location_link ( alias. into ( ) ) ;
1457+ TyKind :: Foreign ( alias) => {
1458+ let type_alias = db. type_alias_signature ( alias. 0 ) ;
1459+ f. start_location_link ( alias. 0 . into ( ) ) ;
14761460 write ! ( f, "{}" , type_alias. name. display( f. db, f. edition( ) ) ) ?;
14771461 f. end_location_link ( ) ;
14781462 }
@@ -1549,10 +1533,7 @@ impl<'db> HirDisplay for crate::next_solver::Ty<'db> {
15491533 }
15501534 }
15511535 TyKind :: Closure ( id, substs) => {
1552- let id = match id {
1553- SolverDefId :: InternedClosureId ( id) => id,
1554- _ => unreachable ! ( ) ,
1555- } ;
1536+ let id = id. 0 ;
15561537 let substs = convert_args_for_result ( interner, substs. as_slice ( ) ) ;
15571538 if f. display_kind . is_source_code ( ) {
15581539 if !f. display_kind . allows_opaque ( ) {
0 commit comments