Adapt codebase to the tool_lints

This commit is contained in:
flip1995 2018-08-01 22:48:41 +02:00 committed by Manish Goregaokar
parent cfd4c538d4
commit f3bb161f0e
25 changed files with 39 additions and 38 deletions

View file

@ -1,7 +1,7 @@
//! A group of attributes that can be attached to Rust code in order
//! to generate a clippy lint detecting said code automatically.
#![allow(print_stdout, use_debug)]
#![allow(clippy::print_stdout, clippy::use_debug)]
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_tool_lint, lint_array};

View file

@ -1,6 +1,6 @@
//! Utility functions about comparison operators.
#![deny(missing_docs_in_private_items)]
#![deny(clippy::missing_docs_in_private_items)]
use rustc::hir::{BinOpKind, Expr};

View file

@ -1,6 +1,6 @@
//! Read configurations files.
#![deny(missing_docs_in_private_items)]
#![deny(clippy::missing_docs_in_private_items)]
use lazy_static::lazy_static;
use std::{env, fmt, fs, io, path};

View file

@ -1,6 +1,6 @@
//! This module contains some useful constants.
#![deny(missing_docs_in_private_items)]
#![deny(clippy::missing_docs_in_private_items)]
/// List of the built-in types names.
///

View file

@ -1,7 +1,7 @@
//! This module contains functions for retrieve the original AST from lowered
//! `hir`.
#![deny(missing_docs_in_private_items)]
#![deny(clippy::missing_docs_in_private_items)]
use if_chain::if_chain;
use rustc::{hir, ty};

View file

@ -364,7 +364,7 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
}.hash(&mut self.s);
}
#[allow(many_single_char_names)]
#[allow(clippy::many_single_char_names)]
pub fn hash_expr(&mut self, e: &Expr) {
if let Some(e) = constant_simple(self.cx, self.tables, e) {
return e.hash(&mut self.s);

View file

@ -1,4 +1,4 @@
#![allow(print_stdout, use_debug)]
#![allow(clippy::print_stdout, clippy::use_debug)]
//! checks for attributes

View file

@ -1,7 +1,5 @@
//! Contains utility functions to generate suggestions.
#![deny(missing_docs_in_private_items)]
// currently ignores lifetimes and generics
#![allow(use_self)]
#![deny(clippy::missing_docs_in_private_items)]
use matches::matches;
use rustc::hir;
@ -40,7 +38,7 @@ impl Display for Sugg<'_> {
}
}
#[allow(wrong_self_convention)] // ok, because of the function `as_ty` method
#[allow(clippy::wrong_self_convention)] // ok, because of the function `as_ty` method
impl<'a> Sugg<'a> {
/// Prepare a suggestion from an expression.
pub fn hir_opt(cx: &LateContext<'_, '_>, expr: &hir::Expr) -> Option<Self> {