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;
38
38
use std:: convert:: TryInto ;
39
39
40
40
pub struct SimplifyCfg {
41
- label : String ,
41
+ label : & ' static str ,
42
42
}
43
43
44
44
impl 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 }
47
47
}
48
48
}
49
49
@@ -57,7 +57,7 @@ pub fn simplify_cfg(tcx: TyCtxt<'tcx>, body: &mut Body<'_>) {
57
57
58
58
impl < ' tcx > MirPass < ' tcx > for SimplifyCfg {
59
59
fn name ( & self ) -> Cow < ' _ , str > {
60
- Cow :: Borrowed ( & self . label )
60
+ Cow :: Owned ( format ! ( "SimplifyCfg-{}" , self . label) )
61
61
}
62
62
63
63
fn run_pass ( & self , tcx : TyCtxt < ' tcx > , body : & mut Body < ' tcx > ) {
You can’t perform that action at this time.
0 commit comments