@@ -71,7 +71,7 @@ struct MirLowerCtx<'a> {
7171
7272#[ derive( Debug , Clone , PartialEq , Eq ) ]
7373pub enum MirLowerError {
74- ConstEvalError ( String , Box < ConstEvalError > ) ,
74+ ConstEvalError ( Box < str > , Box < ConstEvalError > ) ,
7575 LayoutError ( LayoutError ) ,
7676 IncompleteExpr ,
7777 IncompletePattern ,
@@ -84,7 +84,7 @@ pub enum MirLowerError {
8484 UnsizedTemporary ( Ty ) ,
8585 MissingFunctionDefinition ( DefWithBodyId , ExprId ) ,
8686 TypeMismatch ( TypeMismatch ) ,
87- /// This should be never happen. Type mismatch should catch everything.
87+ /// This should never happen. Type mismatch should catch everything.
8888 TypeError ( & ' static str ) ,
8989 NotSupported ( String ) ,
9090 ContinueWithoutLoop ,
@@ -1456,7 +1456,7 @@ impl<'ctx> MirLowerCtx<'ctx> {
14561456 let name = const_id. name ( self . db . upcast ( ) ) ;
14571457 self . db
14581458 . 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) ) ) ?
14601460 } ;
14611461 Ok ( Operand :: Constant ( c) )
14621462 }
@@ -1853,7 +1853,7 @@ impl<'ctx> MirLowerCtx<'ctx> {
18531853 data. name. display( self . db. upcast( ) ) ,
18541854 data. variants[ variant. local_id] . name. display( self . db. upcast( ) )
18551855 ) ;
1856- Err ( MirLowerError :: ConstEvalError ( name, Box :: new ( e) ) )
1856+ Err ( MirLowerError :: ConstEvalError ( name. into ( ) , Box :: new ( e) ) )
18571857 }
18581858 }
18591859 }
0 commit comments