@@ -580,7 +580,7 @@ fn dig_scalar_pointee<'tcx>(
580580 let new_pointee = dig_scalar_pointee ( cx, field, offset - field_offset) ;
581581 match pointee {
582582 Some ( old_pointee) if old_pointee != new_pointee => {
583- cx. tcx . sess . fatal ( format ! (
583+ cx. tcx . dcx ( ) . fatal ( format ! (
584584 "dig_scalar_pointee: unsupported Pointer with different \
585585 pointee types ({old_pointee:?} vs {new_pointee:?}) at offset {offset:?} in {layout:#?}"
586586 ) ) ;
@@ -728,7 +728,7 @@ fn trans_struct<'tcx>(cx: &CodegenCx<'tcx>, span: Span, ty: TyAndLayout<'tcx>) -
728728 if i == 0 {
729729 field_names. push ( cx. sym . discriminant ) ;
730730 } else {
731- cx. tcx . sess . fatal ( "Variants::Multiple has multiple fields" )
731+ cx. tcx . dcx ( ) . fatal ( "Variants::Multiple has multiple fields" )
732732 }
733733 } ;
734734 }
@@ -784,7 +784,7 @@ impl fmt::Display for TyLayoutNameKey<'_> {
784784 write ! ( f, "::{}" , def. variants( ) [ index] . name) ?;
785785 }
786786 }
787- if let ( TyKind :: Coroutine ( _, _, _ ) , Some ( index) ) = ( self . ty . kind ( ) , self . variant ) {
787+ if let ( TyKind :: Coroutine ( _, _) , Some ( index) ) = ( self . ty . kind ( ) , self . variant ) {
788788 write ! ( f, "::{}" , CoroutineArgs :: variant_name( index) ) ?;
789789 }
790790 Ok ( ( ) )
@@ -804,7 +804,7 @@ fn trans_intrinsic_type<'tcx>(
804804 if ty. size != Size :: from_bytes ( 4 ) {
805805 return Err ( cx
806806 . tcx
807- . sess
807+ . dcx ( )
808808 . err ( "#[spirv(generic_image)] type must have size 4" ) ) ;
809809 }
810810
@@ -848,7 +848,7 @@ fn trans_intrinsic_type<'tcx>(
848848 _ => {
849849 return Err ( cx
850850 . tcx
851- . sess
851+ . dcx ( )
852852 . span_err ( span, "Invalid sampled type to `Image`." ) ) ;
853853 }
854854 } ;
@@ -871,7 +871,7 @@ fn trans_intrinsic_type<'tcx>(
871871 Some ( v) => Ok ( v) ,
872872 None => Err ( cx
873873 . tcx
874- . sess
874+ . dcx ( )
875875 . err ( format ! ( "Invalid value for Image const generic: {value}" ) ) ) ,
876876 }
877877 }
@@ -897,7 +897,7 @@ fn trans_intrinsic_type<'tcx>(
897897 IntrinsicType :: Sampler => {
898898 // see SpirvType::sizeof
899899 if ty. size != Size :: from_bytes ( 4 ) {
900- return Err ( cx. tcx . sess . err ( "#[spirv(sampler)] type must have size 4" ) ) ;
900+ return Err ( cx. tcx . dcx ( ) . err ( "#[spirv(sampler)] type must have size 4" ) ) ;
901901 }
902902 Ok ( SpirvType :: Sampler . def ( span, cx) )
903903 }
@@ -910,7 +910,7 @@ fn trans_intrinsic_type<'tcx>(
910910 if ty. size != Size :: from_bytes ( 4 ) {
911911 return Err ( cx
912912 . tcx
913- . sess
913+ . dcx ( )
914914 . err ( "#[spirv(sampled_image)] type must have size 4" ) ) ;
915915 }
916916
@@ -923,15 +923,15 @@ fn trans_intrinsic_type<'tcx>(
923923 } else {
924924 Err ( cx
925925 . tcx
926- . sess
926+ . dcx ( )
927927 . err ( "#[spirv(sampled_image)] type must have a generic image type" ) )
928928 }
929929 }
930930 IntrinsicType :: RuntimeArray => {
931931 if ty. size != Size :: from_bytes ( 4 ) {
932932 return Err ( cx
933933 . tcx
934- . sess
934+ . dcx ( )
935935 . err ( "#[spirv(runtime_array)] type must have size 4" ) ) ;
936936 }
937937
@@ -943,7 +943,7 @@ fn trans_intrinsic_type<'tcx>(
943943 } else {
944944 Err ( cx
945945 . tcx
946- . sess
946+ . dcx ( )
947947 . err ( "#[spirv(runtime_array)] type must have a generic element type" ) )
948948 }
949949 }
@@ -958,12 +958,12 @@ fn trans_intrinsic_type<'tcx>(
958958 if field_types. len ( ) < 2 {
959959 return Err ( cx
960960 . tcx
961- . sess
961+ . dcx ( )
962962 . span_err ( span, "#[spirv(matrix)] type must have at least two fields" ) ) ;
963963 }
964964 let elem_type = field_types[ 0 ] ;
965965 if !field_types. iter ( ) . all ( |& ty| ty == elem_type) {
966- return Err ( cx. tcx . sess . span_err (
966+ return Err ( cx. tcx . dcx ( ) . span_err (
967967 span,
968968 "#[spirv(matrix)] type fields must all be the same type" ,
969969 ) ) ;
@@ -973,7 +973,7 @@ fn trans_intrinsic_type<'tcx>(
973973 ty => {
974974 return Err ( cx
975975 . tcx
976- . sess
976+ . dcx ( )
977977 . struct_span_err ( span, "#[spirv(matrix)] type fields must all be vectors" )
978978 . note ( format ! ( "field type is {}" , ty. debug( elem_type, cx) ) )
979979 . emit ( ) ) ;
0 commit comments