@@ -264,30 +264,6 @@ pub enum LayoutError<'tcx> {
264264 Cycle ( ErrorGuaranteed ) ,
265265}
266266
267- impl < ' tcx > LayoutError < ' tcx > {
268- pub fn into_diagnostic ( self ) -> crate :: error:: LayoutError < ' tcx > {
269- use LayoutError :: * ;
270-
271- use crate :: error:: LayoutError as E ;
272- match self {
273- Unknown ( ty) => E :: Unknown { ty } ,
274- SizeOverflow ( ty) => E :: Overflow { ty } ,
275- InvalidSimd { ty, kind : SimdLayoutError :: TooManyLanes ( max_lanes) } => {
276- E :: SimdTooManyLanes { ty, max_lanes }
277- }
278- InvalidSimd { ty, kind : SimdLayoutError :: ZeroLength } => E :: SimdZeroLength { ty } ,
279- TooGeneric ( ty) => E :: TooGeneric { ty } ,
280- NormalizationFailure ( ty, e) => {
281- E :: NormalizationFailure { ty, failure_ty : e. get_type_for_failure ( ) }
282- }
283- Cycle ( _) => E :: Cycle ,
284- ReferencesError ( _) => E :: ReferencesError ,
285- }
286- }
287- }
288-
289- // FIXME: Once the other errors that embed this error have been converted to translatable
290- // diagnostics, this Display impl should be removed.
291267impl < ' tcx > fmt:: Display for LayoutError < ' tcx > {
292268 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
293269 match * self {
@@ -1309,7 +1285,7 @@ pub enum FnAbiError<'tcx> {
13091285impl < ' a , ' b , G : EmissionGuarantee > Diagnostic < ' a , G > for FnAbiError < ' b > {
13101286 fn into_diag ( self , dcx : DiagCtxtHandle < ' a > , level : Level ) -> Diag < ' a , G > {
13111287 match self {
1312- Self :: Layout ( e) => e . into_diagnostic ( ) . into_diag ( dcx, level) ,
1288+ Self :: Layout ( e) => Diag :: new ( dcx, level, e . to_string ( ) ) ,
13131289 }
13141290 }
13151291}
0 commit comments