Skip to content

Commit cd20cdf

Browse files
committed
tidy: Use "const" instead of "static, and remove implied 'static lifetimes
Dropping the redundant lifetimes also eliminates a clippy warning.
1 parent decc3b0 commit cd20cdf

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/tools/tidy/src/deps.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use std::process::Command;
1818

1919
use serde_json;
2020

21-
static LICENSES: &'static [&'static str] = &[
21+
const LICENSES: &[&str] = &[
2222
"MIT/Apache-2.0",
2323
"MIT / Apache-2.0",
2424
"Apache-2.0/MIT",
@@ -33,7 +33,7 @@ static LICENSES: &'static [&'static str] = &[
3333
/// should be considered bugs. Exceptions are only allowed in Rust
3434
/// tooling. It is _crucial_ that no exception crates be dependencies
3535
/// of the Rust runtime (std / test).
36-
static EXCEPTIONS: &'static [&'static str] = &[
36+
const EXCEPTIONS: &[&str] = &[
3737
"mdbook", // MPL2, mdbook
3838
"openssl", // BSD+advertising clause, cargo, mdbook
3939
"pest", // MPL2, mdbook via handlebars
@@ -54,13 +54,13 @@ static EXCEPTIONS: &'static [&'static str] = &[
5454
];
5555

5656
/// Which crates to check against the whitelist?
57-
static WHITELIST_CRATES: &'static [CrateVersion] = &[
57+
const WHITELIST_CRATES: &[CrateVersion] = &[
5858
CrateVersion("rustc", "0.0.0"),
5959
CrateVersion("rustc_codegen_llvm", "0.0.0"),
6060
];
6161

6262
/// Whitelist of crates rustc is allowed to depend on. Avoid adding to the list if possible.
63-
static WHITELIST: &'static [Crate] = &[
63+
const WHITELIST: &[Crate] = &[
6464
Crate("aho-corasick"),
6565
Crate("arrayvec"),
6666
Crate("atty"),

src/tools/tidy/src/extdeps.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::io::Read;
1515
use std::path::Path;
1616

1717
/// List of whitelisted sources for packages
18-
static WHITELISTED_SOURCES: &'static [&'static str] = &[
18+
const WHITELISTED_SOURCES: &[&str] = &[
1919
"\"registry+https://github.com/rust-lang/crates.io-index\"",
2020
];
2121

src/tools/tidy/src/pal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ use std::path::Path;
5050
use std::iter::Iterator;
5151

5252
// Paths that may contain platform-specific code
53-
const EXCEPTION_PATHS: &'static [&'static str] = &[
53+
const EXCEPTION_PATHS: &[&str] = &[
5454
// std crates
5555
"src/liballoc_jemalloc",
5656
"src/liballoc_system",

0 commit comments

Comments
 (0)