about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2018-09-01 16:46:57 -0700
committerJosh Triplett <josh@joshtriplett.org>2018-09-01 17:14:38 -0700
commitcd20cdf7e07d87cd346f6b71d0a46311b79218ab (patch)
tree4e0ecca39795eab905cdcfa01a0a7a20100394e7
parentdecc3b0eba163a45accc4e1157301f528dfc7e50 (diff)
downloadrust-cd20cdf7e07d87cd346f6b71d0a46311b79218ab.tar.gz
rust-cd20cdf7e07d87cd346f6b71d0a46311b79218ab.zip
tidy: Use "const" instead of "static, and remove implied `'static` lifetimes
Dropping the redundant lifetimes also eliminates a clippy warning.
-rw-r--r--src/tools/tidy/src/deps.rs8
-rw-r--r--src/tools/tidy/src/extdeps.rs2
-rw-r--r--src/tools/tidy/src/pal.rs2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs
index 5bff8480d59..ee1fc0ca510 100644
--- a/src/tools/tidy/src/deps.rs
+++ b/src/tools/tidy/src/deps.rs
@@ -18,7 +18,7 @@ use std::process::Command;
 
 use serde_json;
 
-static LICENSES: &'static [&'static str] = &[
+const LICENSES: &[&str] = &[
     "MIT/Apache-2.0",
     "MIT / Apache-2.0",
     "Apache-2.0/MIT",
@@ -33,7 +33,7 @@ static LICENSES: &'static [&'static str] = &[
 /// should be considered bugs. Exceptions are only allowed in Rust
 /// tooling. It is _crucial_ that no exception crates be dependencies
 /// of the Rust runtime (std / test).
-static EXCEPTIONS: &'static [&'static str] = &[
+const EXCEPTIONS: &[&str] = &[
     "mdbook",             // MPL2, mdbook
     "openssl",            // BSD+advertising clause, cargo, mdbook
     "pest",               // MPL2, mdbook via handlebars
@@ -54,13 +54,13 @@ static EXCEPTIONS: &'static [&'static str] = &[
 ];
 
 /// Which crates to check against the whitelist?
-static WHITELIST_CRATES: &'static [CrateVersion] = &[
+const WHITELIST_CRATES: &[CrateVersion] = &[
     CrateVersion("rustc", "0.0.0"),
     CrateVersion("rustc_codegen_llvm", "0.0.0"),
 ];
 
 /// Whitelist of crates rustc is allowed to depend on. Avoid adding to the list if possible.
-static WHITELIST: &'static [Crate] = &[
+const WHITELIST: &[Crate] = &[
     Crate("aho-corasick"),
     Crate("arrayvec"),
     Crate("atty"),
diff --git a/src/tools/tidy/src/extdeps.rs b/src/tools/tidy/src/extdeps.rs
index 831eb47858a..7f58b440a83 100644
--- a/src/tools/tidy/src/extdeps.rs
+++ b/src/tools/tidy/src/extdeps.rs
@@ -15,7 +15,7 @@ use std::io::Read;
 use std::path::Path;
 
 /// List of whitelisted sources for packages
-static WHITELISTED_SOURCES: &'static [&'static str] = &[
+const WHITELISTED_SOURCES: &[&str] = &[
     "\"registry+https://github.com/rust-lang/crates.io-index\"",
 ];
 
diff --git a/src/tools/tidy/src/pal.rs b/src/tools/tidy/src/pal.rs
index 8071f07d811..3cddfb8fde8 100644
--- a/src/tools/tidy/src/pal.rs
+++ b/src/tools/tidy/src/pal.rs
@@ -50,7 +50,7 @@ use std::path::Path;
 use std::iter::Iterator;
 
 // Paths that may contain platform-specific code
-const EXCEPTION_PATHS: &'static [&'static str] = &[
+const EXCEPTION_PATHS: &[&str] = &[
     // std crates
     "src/liballoc_jemalloc",
     "src/liballoc_system",