@@ -71,7 +71,7 @@ struct MirLowerCtx<'a> {
71
71
72
72
#[ derive( Debug , Clone , PartialEq , Eq ) ]
73
73
pub enum MirLowerError {
74
- ConstEvalError ( String , Box < ConstEvalError > ) ,
74
+ ConstEvalError ( Box < str > , Box < ConstEvalError > ) ,
75
75
LayoutError ( LayoutError ) ,
76
76
IncompleteExpr ,
77
77
IncompletePattern ,
@@ -84,7 +84,7 @@ pub enum MirLowerError {
84
84
UnsizedTemporary ( Ty ) ,
85
85
MissingFunctionDefinition ( DefWithBodyId , ExprId ) ,
86
86
TypeMismatch ( TypeMismatch ) ,
87
- /// This should be never happen. Type mismatch should catch everything.
87
+ /// This should never happen. Type mismatch should catch everything.
88
88
TypeError ( & ' static str ) ,
89
89
NotSupported ( String ) ,
90
90
ContinueWithoutLoop ,
@@ -1456,7 +1456,7 @@ impl<'ctx> MirLowerCtx<'ctx> {
1456
1456
let name = const_id. name ( self . db . upcast ( ) ) ;
1457
1457
self . db
1458
1458
. const_eval ( const_id. into ( ) , subst, None )
1459
- . map_err ( |e| MirLowerError :: ConstEvalError ( name, Box :: new ( e) ) ) ?
1459
+ . map_err ( |e| MirLowerError :: ConstEvalError ( name. into ( ) , Box :: new ( e) ) ) ?
1460
1460
} ;
1461
1461
Ok ( Operand :: Constant ( c) )
1462
1462
}
@@ -1853,7 +1853,7 @@ impl<'ctx> MirLowerCtx<'ctx> {
1853
1853
data. name. display( self . db. upcast( ) ) ,
1854
1854
data. variants[ variant. local_id] . name. display( self . db. upcast( ) )
1855
1855
) ;
1856
- Err ( MirLowerError :: ConstEvalError ( name, Box :: new ( e) ) )
1856
+ Err ( MirLowerError :: ConstEvalError ( name. into ( ) , Box :: new ( e) ) )
1857
1857
}
1858
1858
}
1859
1859
}
0 commit comments