mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Adapt run-pass tests to the tool_lints
This commit is contained in:
parent
e9af09c274
commit
ea43fedf9e
@ -1,6 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
pub trait Trait {
|
pub trait Trait {
|
||||||
const CONSTANT: u8;
|
const CONSTANT: u8;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
#![feature(tool_lints)]
|
||||||
|
|
||||||
|
#![deny(clippy::all)]
|
||||||
#![deny(clippy)]
|
|
||||||
#![allow(unused_imports)]
|
#![allow(unused_imports)]
|
||||||
|
|
||||||
use std::*;
|
use std::*;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
#![feature(tool_lints)]
|
||||||
|
|
||||||
|
#![allow(clippy::all)]
|
||||||
#![allow(clippy)]
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
match 1 {
|
match 1 {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
#![feature(tool_lints)]
|
||||||
|
|
||||||
|
#![allow(clippy::all)]
|
||||||
#![allow(clippy)]
|
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#![allow(dead_code, char_lit_as_u8, needless_bool)]
|
#![feature(tool_lints)]
|
||||||
|
|
||||||
|
#![allow(dead_code, clippy::char_lit_as_u8, clippy::needless_bool)]
|
||||||
|
|
||||||
/// Should not trigger an ICE in `SpanlessHash` / `consts::constant`
|
/// Should not trigger an ICE in `SpanlessHash` / `consts::constant`
|
||||||
///
|
///
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
#![allow(unused_variables, blacklisted_name, needless_pass_by_value, dead_code)]
|
#![feature(tool_lints)]
|
||||||
|
|
||||||
|
#![allow(unused_variables, clippy::blacklisted_name,
|
||||||
|
clippy::needless_pass_by_value, dead_code)]
|
||||||
|
|
||||||
// This should not compile-fail with:
|
// This should not compile-fail with:
|
||||||
//
|
//
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#![feature(tool_lints)]
|
||||||
|
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
// See https://github.com/rust-lang-nursery/rust-clippy/issues/2774
|
// See https://github.com/rust-lang-nursery/rust-clippy/issues/2774
|
||||||
@ -10,7 +12,7 @@ pub struct Bar {
|
|||||||
#[derive(Eq, PartialEq, Debug, Hash)]
|
#[derive(Eq, PartialEq, Debug, Hash)]
|
||||||
pub struct Foo {}
|
pub struct Foo {}
|
||||||
|
|
||||||
#[allow(implicit_hasher)]
|
#[allow(clippy::implicit_hasher)]
|
||||||
// This should not cause a 'cannot relate bound region' ICE
|
// This should not cause a 'cannot relate bound region' ICE
|
||||||
pub fn add_barfoos_to_foos<'a>(bars: &HashSet<&'a Bar>) {
|
pub fn add_barfoos_to_foos<'a>(bars: &HashSet<&'a Bar>) {
|
||||||
let mut foos = HashSet::new();
|
let mut foos = HashSet::new();
|
||||||
@ -19,7 +21,7 @@ pub fn add_barfoos_to_foos<'a>(bars: &HashSet<&'a Bar>) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(implicit_hasher)]
|
#[allow(clippy::implicit_hasher)]
|
||||||
// Also this should not cause a 'cannot relate bound region' ICE
|
// Also this should not cause a 'cannot relate bound region' ICE
|
||||||
pub fn add_barfoos_to_foos2(bars: &HashSet<&Bar>) {
|
pub fn add_barfoos_to_foos2(bars: &HashSet<&Bar>) {
|
||||||
let mut foos = HashSet::new();
|
let mut foos = HashSet::new();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
#![feature(tool_lints)]
|
||||||
|
|
||||||
|
#![deny(clippy::all)]
|
||||||
#![deny(clippy)]
|
|
||||||
|
|
||||||
fn core() {}
|
fn core() {}
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#![deny(clippy)]
|
#![feature(tool_lints)]
|
||||||
|
|
||||||
|
#![deny(clippy::all)]
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
struct Foo;
|
struct Foo;
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#![deny(if_same_then_else)]
|
#![feature(tool_lints)]
|
||||||
|
|
||||||
|
#![deny(clippy::if_same_then_else)]
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#![deny(match_same_arms)]
|
#![feature(tool_lints)]
|
||||||
|
|
||||||
|
#![deny(clippy::match_same_arms)]
|
||||||
|
|
||||||
const PRICE_OF_SWEETS: u32 = 5;
|
const PRICE_OF_SWEETS: u32 = 5;
|
||||||
const PRICE_OF_KINDNESS: u32 = 0;
|
const PRICE_OF_KINDNESS: u32 = 0;
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#![deny(mut_mut, zero_ptr, cmp_nan)]
|
#![feature(tool_lints)]
|
||||||
|
|
||||||
|
#![deny(clippy::mut_mut, clippy::zero_ptr, clippy::cmp_nan)]
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
// compiletest + extern crates doesn't work together
|
// compiletest + extern crates doesn't work together
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#[deny(clippy)]
|
#![feature(tool_lints)]
|
||||||
|
|
||||||
|
#[deny(clippy::all)]
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
|
#![feature(tool_lints)]
|
||||||
|
|
||||||
#![deny(needless_lifetimes)]
|
#![deny(clippy::needless_lifetimes)]
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
trait Foo {}
|
trait Foo {}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
#![feature(tool_lints)]
|
||||||
|
|
||||||
|
#![allow(clippy::blacklisted_name)]
|
||||||
#![allow(blacklisted_name)]
|
|
||||||
|
|
||||||
pub fn foo(bar: *const u8) {
|
pub fn foo(bar: *const u8) {
|
||||||
println!("{:#p}", bar);
|
println!("{:#p}", bar);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
#![feature(tool_lints)]
|
||||||
|
|
||||||
|
#![warn(clippy::single_match_else)]
|
||||||
#![warn(single_match_else)]
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let n = match (42, 43) {
|
let n = match (42, 43) {
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
|
#![feature(tool_lints)]
|
||||||
|
|
||||||
|
#![allow(clippy::useless_attribute)] //issue #2910
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
|
|
||||||
/// Test that we do not lint for unused underscores in a `MacroAttribute`
|
/// Test that we do not lint for unused underscores in a `MacroAttribute`
|
||||||
/// expansion
|
/// expansion
|
||||||
#[deny(used_underscore_binding)]
|
#[deny(clippy::used_underscore_binding)]
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
struct MacroAttributesTest {
|
struct MacroAttributesTest {
|
||||||
_foo: u32,
|
_foo: u32,
|
||||||
|
Loading…
Reference in New Issue
Block a user