File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
compiler/rustc_mir_transform/src Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -38,12 +38,12 @@ use std::borrow::Cow;
3838use std:: convert:: TryInto ;
3939
4040pub struct SimplifyCfg {
41- label : String ,
41+ label : & ' static str ,
4242}
4343
4444impl SimplifyCfg {
45- pub fn new ( label : & str ) -> Self {
46- SimplifyCfg { label : format ! ( "SimplifyCfg-{}" , label ) }
45+ pub const fn new ( label : & ' static str ) -> Self {
46+ SimplifyCfg { label }
4747 }
4848}
4949
@@ -57,7 +57,7 @@ pub fn simplify_cfg(tcx: TyCtxt<'tcx>, body: &mut Body<'_>) {
5757
5858impl < ' tcx > MirPass < ' tcx > for SimplifyCfg {
5959 fn name ( & self ) -> Cow < ' _ , str > {
60- Cow :: Borrowed ( & self . label )
60+ Cow :: Owned ( format ! ( "SimplifyCfg-{}" , self . label) )
6161 }
6262
6363 fn run_pass ( & self , tcx : TyCtxt < ' tcx > , body : & mut Body < ' tcx > ) {
You can’t perform that action at this time.
0 commit comments