From ae8fc69406dccef8443986b5a965d21ea59cb164 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 4 Jun 2018 16:17:02 -0700 Subject: [PATCH] Use `&'static str` rather than Cow for pass names. --- lib/filetests/src/subtest.rs | 2 +- lib/filetests/src/test_binemit.rs | 4 ++-- lib/filetests/src/test_cat.rs | 4 ++-- lib/filetests/src/test_compile.rs | 4 ++-- lib/filetests/src/test_dce.rs | 4 ++-- lib/filetests/src/test_domtree.rs | 4 ++-- lib/filetests/src/test_legalizer.rs | 4 ++-- lib/filetests/src/test_licm.rs | 4 ++-- lib/filetests/src/test_postopt.rs | 4 ++-- lib/filetests/src/test_preopt.rs | 4 ++-- lib/filetests/src/test_print_cfg.rs | 4 ++-- lib/filetests/src/test_regalloc.rs | 4 ++-- lib/filetests/src/test_simple_gvn.rs | 4 ++-- lib/filetests/src/test_verifier.rs | 4 ++-- 14 files changed, 27 insertions(+), 27 deletions(-) diff --git a/lib/filetests/src/subtest.rs b/lib/filetests/src/subtest.rs index 18904d99b9..951aa76e56 100644 --- a/lib/filetests/src/subtest.rs +++ b/lib/filetests/src/subtest.rs @@ -45,7 +45,7 @@ impl<'a> Context<'a> { /// trait object. pub trait SubTest { /// Name identifying this subtest. Typically the same as the test command. - fn name(&self) -> Cow; + fn name(&self) -> &'static str; /// Should the verifier be run on the function before running the test? fn needs_verifier(&self) -> bool { diff --git a/lib/filetests/src/test_binemit.rs b/lib/filetests/src/test_binemit.rs index f6a91f61a1..d736faceee 100644 --- a/lib/filetests/src/test_binemit.rs +++ b/lib/filetests/src/test_binemit.rs @@ -96,8 +96,8 @@ impl binemit::CodeSink for TextSink { } impl SubTest for TestBinEmit { - fn name(&self) -> Cow { - Cow::from("binemit") + fn name(&self) -> &'static str { + "binemit" } fn is_mutating(&self) -> bool { diff --git a/lib/filetests/src/test_cat.rs b/lib/filetests/src/test_cat.rs index 4fdedf115f..363567695f 100644 --- a/lib/filetests/src/test_cat.rs +++ b/lib/filetests/src/test_cat.rs @@ -23,8 +23,8 @@ pub fn subtest(parsed: &TestCommand) -> STResult> { } impl SubTest for TestCat { - fn name(&self) -> Cow { - Cow::from("cat") + fn name(&self) -> &'static str { + "cat" } fn needs_verifier(&self) -> bool { diff --git a/lib/filetests/src/test_compile.rs b/lib/filetests/src/test_compile.rs index f9b5deebd8..ac326cb762 100644 --- a/lib/filetests/src/test_compile.rs +++ b/lib/filetests/src/test_compile.rs @@ -22,8 +22,8 @@ pub fn subtest(parsed: &TestCommand) -> Result> { } impl SubTest for TestCompile { - fn name(&self) -> Cow { - Cow::from("compile") + fn name(&self) -> &'static str { + "compile" } fn is_mutating(&self) -> bool { diff --git a/lib/filetests/src/test_dce.rs b/lib/filetests/src/test_dce.rs index 13bad80a7f..741ca1aac5 100644 --- a/lib/filetests/src/test_dce.rs +++ b/lib/filetests/src/test_dce.rs @@ -25,8 +25,8 @@ pub fn subtest(parsed: &TestCommand) -> Result> { } impl SubTest for TestDCE { - fn name(&self) -> Cow { - Cow::from("dce") + fn name(&self) -> &'static str { + "dce" } fn is_mutating(&self) -> bool { diff --git a/lib/filetests/src/test_domtree.rs b/lib/filetests/src/test_domtree.rs index 9dbd5fe849..a262293567 100644 --- a/lib/filetests/src/test_domtree.rs +++ b/lib/filetests/src/test_domtree.rs @@ -36,8 +36,8 @@ pub fn subtest(parsed: &TestCommand) -> Result> { } impl SubTest for TestDomtree { - fn name(&self) -> Cow { - Cow::from("domtree") + fn name(&self) -> &'static str { + "domtree" } // Extract our own dominator tree from diff --git a/lib/filetests/src/test_legalizer.rs b/lib/filetests/src/test_legalizer.rs index d86720612e..c3d84861ab 100644 --- a/lib/filetests/src/test_legalizer.rs +++ b/lib/filetests/src/test_legalizer.rs @@ -23,8 +23,8 @@ pub fn subtest(parsed: &TestCommand) -> Result> { } impl SubTest for TestLegalizer { - fn name(&self) -> Cow { - Cow::from("legalizer") + fn name(&self) -> &'static str { + "legalizer" } fn is_mutating(&self) -> bool { diff --git a/lib/filetests/src/test_licm.rs b/lib/filetests/src/test_licm.rs index a125da484f..e3d6812f91 100644 --- a/lib/filetests/src/test_licm.rs +++ b/lib/filetests/src/test_licm.rs @@ -25,8 +25,8 @@ pub fn subtest(parsed: &TestCommand) -> Result> { } impl SubTest for TestLICM { - fn name(&self) -> Cow { - Cow::from("licm") + fn name(&self) -> &'static str { + "licm" } fn is_mutating(&self) -> bool { diff --git a/lib/filetests/src/test_postopt.rs b/lib/filetests/src/test_postopt.rs index 2813a1562c..192a89c8b3 100644 --- a/lib/filetests/src/test_postopt.rs +++ b/lib/filetests/src/test_postopt.rs @@ -22,8 +22,8 @@ pub fn subtest(parsed: &TestCommand) -> Result> { } impl SubTest for TestPostopt { - fn name(&self) -> Cow { - Cow::from("postopt") + fn name(&self) -> &'static str { + "postopt" } fn is_mutating(&self) -> bool { diff --git a/lib/filetests/src/test_preopt.rs b/lib/filetests/src/test_preopt.rs index 7d5609b6a0..dbd68e8bac 100644 --- a/lib/filetests/src/test_preopt.rs +++ b/lib/filetests/src/test_preopt.rs @@ -22,8 +22,8 @@ pub fn subtest(parsed: &TestCommand) -> Result> { } impl SubTest for TestPreopt { - fn name(&self) -> Cow { - Cow::from("preopt") + fn name(&self) -> &'static str { + "preopt" } fn is_mutating(&self) -> bool { diff --git a/lib/filetests/src/test_print_cfg.rs b/lib/filetests/src/test_print_cfg.rs index 3f48b1d4e9..741dae762b 100644 --- a/lib/filetests/src/test_print_cfg.rs +++ b/lib/filetests/src/test_print_cfg.rs @@ -23,8 +23,8 @@ pub fn subtest(parsed: &TestCommand) -> STResult> { } impl SubTest for TestPrintCfg { - fn name(&self) -> Cow { - Cow::from("print-cfg") + fn name(&self) -> &'static str { + "print-cfg" } fn needs_verifier(&self) -> bool { diff --git a/lib/filetests/src/test_regalloc.rs b/lib/filetests/src/test_regalloc.rs index 3ff5134ca4..91217899e1 100644 --- a/lib/filetests/src/test_regalloc.rs +++ b/lib/filetests/src/test_regalloc.rs @@ -25,8 +25,8 @@ pub fn subtest(parsed: &TestCommand) -> Result> { } impl SubTest for TestRegalloc { - fn name(&self) -> Cow { - Cow::from("regalloc") + fn name(&self) -> &'static str { + "regalloc" } fn is_mutating(&self) -> bool { diff --git a/lib/filetests/src/test_simple_gvn.rs b/lib/filetests/src/test_simple_gvn.rs index 54ccab6d5b..2036301bcc 100644 --- a/lib/filetests/src/test_simple_gvn.rs +++ b/lib/filetests/src/test_simple_gvn.rs @@ -25,8 +25,8 @@ pub fn subtest(parsed: &TestCommand) -> Result> { } impl SubTest for TestSimpleGVN { - fn name(&self) -> Cow { - Cow::from("simple-gvn") + fn name(&self) -> &'static str { + "simple-gvn" } fn is_mutating(&self) -> bool { diff --git a/lib/filetests/src/test_verifier.rs b/lib/filetests/src/test_verifier.rs index 7b8c606ced..69e56b1cd5 100644 --- a/lib/filetests/src/test_verifier.rs +++ b/lib/filetests/src/test_verifier.rs @@ -28,8 +28,8 @@ pub fn subtest(parsed: &TestCommand) -> Result> { } impl SubTest for TestVerifier { - fn name(&self) -> Cow { - Cow::from("verifier") + fn name(&self) -> &'static str { + "verifier" } fn needs_verifier(&self) -> bool {