We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
SimplifyBranches::new
1 parent 80a7b3d commit 7e61921Copy full SHA for 7e61921
compiler/rustc_mir_transform/src/simplify_branches.rs
@@ -7,18 +7,18 @@ use rustc_middle::ty::TyCtxt;
7
use std::borrow::Cow;
8
9
pub struct SimplifyBranches {
10
- label: String,
+ label: &'static str,
11
}
12
13
impl SimplifyBranches {
14
- pub fn new(label: &str) -> Self {
15
- SimplifyBranches { label: format!("SimplifyBranches-{}", label) }
+ pub const fn new(label: &'static str) -> Self {
+ SimplifyBranches { label }
16
17
18
19
impl<'tcx> MirPass<'tcx> for SimplifyBranches {
20
fn name(&self) -> Cow<'_, str> {
21
- Cow::Borrowed(&self.label)
+ Cow::Owned(format!("SimplifyBranches-{}", self.label))
22
23
24
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
0 commit comments