Skip to content

Commit

Permalink
tidy: deny(rust_2018_idioms)
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Mar 1, 2019
1 parent 20cfc9d commit 3391f6c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/tools/tidy/src/deps.rs
Expand Up @@ -49,13 +49,13 @@ const EXCEPTIONS: &[&str] = &[
];

/// Which crates to check against the whitelist?
const WHITELIST_CRATES: &[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.
const WHITELIST: &[Crate] = &[
const WHITELIST: &[Crate<'_>] = &[
Crate("adler32"),
Crate("aho-corasick"),
Crate("arrayvec"),
Expand Down Expand Up @@ -183,7 +183,7 @@ struct Crate<'a>(&'a str); // (name)
#[derive(Copy, Clone, PartialOrd, Ord, PartialEq, Eq, Debug, Hash)]
struct CrateVersion<'a>(&'a str, &'a str); // (name, version)

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

/// Checks the dependencies of the given crate from the given cargo metadata to see if they are on
/// the whitelist. Returns a list of illegal dependencies.
fn check_crate_whitelist<'a, 'b>(
whitelist: &'a HashSet<Crate>,
fn check_crate_whitelist<'a>(
whitelist: &'a HashSet<Crate<'_>>,
resolve: &'a Resolve,
visited: &'b mut BTreeSet<CrateVersion<'a>>,
visited: &mut BTreeSet<CrateVersion<'a>>,
krate: CrateVersion<'a>,
must_be_on_whitelist: bool,
) -> BTreeSet<Crate<'a>> {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/tidy/src/features.rs
Expand Up @@ -22,7 +22,7 @@ pub enum Status {
}

impl fmt::Display for Status {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let as_str = match *self {
Status::Stable => "stable",
Status::Unstable => "unstable",
Expand Down
3 changes: 2 additions & 1 deletion src/tools/tidy/src/lib.rs
Expand Up @@ -3,7 +3,8 @@
//! This library contains the tidy lints and exposes it
//! to be used by tools.

extern crate serde;
#![deny(rust_2018_idioms)]

extern crate serde_json;
#[macro_use]
extern crate serde_derive;
Expand Down

0 comments on commit 3391f6c

Please sign in to comment.