Skip to content

Commit 5de3f96

Browse files
authored
Rollup merge of #58830 - Centril:rust_2018_idioms-tidy, r=oli-obk
tidy: deny(rust_2018_idioms) r? @oli-obk
2 parents 583bea5 + 3391f6c commit 5de3f96

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/tools/tidy/src/deps.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ const EXCEPTIONS: &[&str] = &[
4949
];
5050

5151
/// Which crates to check against the whitelist?
52-
const WHITELIST_CRATES: &[CrateVersion] = &[
52+
const WHITELIST_CRATES: &[CrateVersion<'_>] = &[
5353
CrateVersion("rustc", "0.0.0"),
5454
CrateVersion("rustc_codegen_llvm", "0.0.0"),
5555
];
5656

5757
/// Whitelist of crates rustc is allowed to depend on. Avoid adding to the list if possible.
58-
const WHITELIST: &[Crate] = &[
58+
const WHITELIST: &[Crate<'_>] = &[
5959
Crate("adler32"),
6060
Crate("aho-corasick"),
6161
Crate("arrayvec"),
@@ -183,7 +183,7 @@ struct Crate<'a>(&'a str); // (name)
183183
#[derive(Copy, Clone, PartialOrd, Ord, PartialEq, Eq, Debug, Hash)]
184184
struct CrateVersion<'a>(&'a str, &'a str); // (name, version)
185185

186-
impl<'a> Crate<'a> {
186+
impl Crate<'_> {
187187
pub fn id_str(&self) -> String {
188188
format!("{} ", self.0)
189189
}
@@ -330,10 +330,10 @@ fn get_deps(path: &Path, cargo: &Path) -> Resolve {
330330

331331
/// Checks the dependencies of the given crate from the given cargo metadata to see if they are on
332332
/// the whitelist. Returns a list of illegal dependencies.
333-
fn check_crate_whitelist<'a, 'b>(
334-
whitelist: &'a HashSet<Crate>,
333+
fn check_crate_whitelist<'a>(
334+
whitelist: &'a HashSet<Crate<'_>>,
335335
resolve: &'a Resolve,
336-
visited: &'b mut BTreeSet<CrateVersion<'a>>,
336+
visited: &mut BTreeSet<CrateVersion<'a>>,
337337
krate: CrateVersion<'a>,
338338
must_be_on_whitelist: bool,
339339
) -> BTreeSet<Crate<'a>> {

src/tools/tidy/src/features.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub enum Status {
2222
}
2323

2424
impl fmt::Display for Status {
25-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
25+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2626
let as_str = match *self {
2727
Status::Stable => "stable",
2828
Status::Unstable => "unstable",

src/tools/tidy/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
//! This library contains the tidy lints and exposes it
44
//! to be used by tools.
55
6-
extern crate serde;
6+
#![deny(rust_2018_idioms)]
7+
78
extern crate serde_json;
89
#[macro_use]
910
extern crate serde_derive;

0 commit comments

Comments
 (0)