@@ -580,7 +580,7 @@ fn dig_scalar_pointee<'tcx>(
580
580
let new_pointee = dig_scalar_pointee ( cx, field, offset - field_offset) ;
581
581
match pointee {
582
582
Some ( old_pointee) if old_pointee != new_pointee => {
583
- cx. tcx . sess . fatal ( format ! (
583
+ cx. tcx . dcx ( ) . fatal ( format ! (
584
584
"dig_scalar_pointee: unsupported Pointer with different \
585
585
pointee types ({old_pointee:?} vs {new_pointee:?}) at offset {offset:?} in {layout:#?}"
586
586
) ) ;
@@ -728,7 +728,7 @@ fn trans_struct<'tcx>(cx: &CodegenCx<'tcx>, span: Span, ty: TyAndLayout<'tcx>) -
728
728
if i == 0 {
729
729
field_names. push ( cx. sym . discriminant ) ;
730
730
} else {
731
- cx. tcx . sess . fatal ( "Variants::Multiple has multiple fields" )
731
+ cx. tcx . dcx ( ) . fatal ( "Variants::Multiple has multiple fields" )
732
732
}
733
733
} ;
734
734
}
@@ -784,7 +784,7 @@ impl fmt::Display for TyLayoutNameKey<'_> {
784
784
write ! ( f, "::{}" , def. variants( ) [ index] . name) ?;
785
785
}
786
786
}
787
- if let ( TyKind :: Coroutine ( _, _, _ ) , Some ( index) ) = ( self . ty . kind ( ) , self . variant ) {
787
+ if let ( TyKind :: Coroutine ( _, _) , Some ( index) ) = ( self . ty . kind ( ) , self . variant ) {
788
788
write ! ( f, "::{}" , CoroutineArgs :: variant_name( index) ) ?;
789
789
}
790
790
Ok ( ( ) )
@@ -804,7 +804,7 @@ fn trans_intrinsic_type<'tcx>(
804
804
if ty. size != Size :: from_bytes ( 4 ) {
805
805
return Err ( cx
806
806
. tcx
807
- . sess
807
+ . dcx ( )
808
808
. err ( "#[spirv(generic_image)] type must have size 4" ) ) ;
809
809
}
810
810
@@ -848,7 +848,7 @@ fn trans_intrinsic_type<'tcx>(
848
848
_ => {
849
849
return Err ( cx
850
850
. tcx
851
- . sess
851
+ . dcx ( )
852
852
. span_err ( span, "Invalid sampled type to `Image`." ) ) ;
853
853
}
854
854
} ;
@@ -871,7 +871,7 @@ fn trans_intrinsic_type<'tcx>(
871
871
Some ( v) => Ok ( v) ,
872
872
None => Err ( cx
873
873
. tcx
874
- . sess
874
+ . dcx ( )
875
875
. err ( format ! ( "Invalid value for Image const generic: {value}" ) ) ) ,
876
876
}
877
877
}
@@ -897,7 +897,7 @@ fn trans_intrinsic_type<'tcx>(
897
897
IntrinsicType :: Sampler => {
898
898
// see SpirvType::sizeof
899
899
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" ) ) ;
901
901
}
902
902
Ok ( SpirvType :: Sampler . def ( span, cx) )
903
903
}
@@ -910,7 +910,7 @@ fn trans_intrinsic_type<'tcx>(
910
910
if ty. size != Size :: from_bytes ( 4 ) {
911
911
return Err ( cx
912
912
. tcx
913
- . sess
913
+ . dcx ( )
914
914
. err ( "#[spirv(sampled_image)] type must have size 4" ) ) ;
915
915
}
916
916
@@ -923,15 +923,15 @@ fn trans_intrinsic_type<'tcx>(
923
923
} else {
924
924
Err ( cx
925
925
. tcx
926
- . sess
926
+ . dcx ( )
927
927
. err ( "#[spirv(sampled_image)] type must have a generic image type" ) )
928
928
}
929
929
}
930
930
IntrinsicType :: RuntimeArray => {
931
931
if ty. size != Size :: from_bytes ( 4 ) {
932
932
return Err ( cx
933
933
. tcx
934
- . sess
934
+ . dcx ( )
935
935
. err ( "#[spirv(runtime_array)] type must have size 4" ) ) ;
936
936
}
937
937
@@ -943,7 +943,7 @@ fn trans_intrinsic_type<'tcx>(
943
943
} else {
944
944
Err ( cx
945
945
. tcx
946
- . sess
946
+ . dcx ( )
947
947
. err ( "#[spirv(runtime_array)] type must have a generic element type" ) )
948
948
}
949
949
}
@@ -958,12 +958,12 @@ fn trans_intrinsic_type<'tcx>(
958
958
if field_types. len ( ) < 2 {
959
959
return Err ( cx
960
960
. tcx
961
- . sess
961
+ . dcx ( )
962
962
. span_err ( span, "#[spirv(matrix)] type must have at least two fields" ) ) ;
963
963
}
964
964
let elem_type = field_types[ 0 ] ;
965
965
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 (
967
967
span,
968
968
"#[spirv(matrix)] type fields must all be the same type" ,
969
969
) ) ;
@@ -973,7 +973,7 @@ fn trans_intrinsic_type<'tcx>(
973
973
ty => {
974
974
return Err ( cx
975
975
. tcx
976
- . sess
976
+ . dcx ( )
977
977
. struct_span_err ( span, "#[spirv(matrix)] type fields must all be vectors" )
978
978
. note ( format ! ( "field type is {}" , ty. debug( elem_type, cx) ) )
979
979
. emit ( ) ) ;
0 commit comments