mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 23:24:24 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
63fbeaab68
214 changed files with 314 additions and 270 deletions
|
@ -130,16 +130,15 @@ You can add options to your code to `allow`/`warn`/`deny` Clippy lints:
|
|||
|
||||
Note: `deny` produces errors instead of warnings.
|
||||
|
||||
Note: To use the new `clippy::lint_name` syntax, `#![feature(tool_lints)]` has to be activated
|
||||
currently. If you want to compile your code with the stable toolchain you can use a `cfg_attr` to
|
||||
Note: To use the new `clippy::lint_name` syntax, a recent compiler has to be used
|
||||
currently. If you want to compile your code with the stable toolchain you can use a `cfg_attr` to
|
||||
activate the `tool_lints` feature:
|
||||
```rust
|
||||
#![cfg_attr(feature = "cargo-clippy", feature(tool_lints))]
|
||||
#![cfg_attr(feature = "cargo-clippy", allow(clippy::lint_name))]
|
||||
```
|
||||
|
||||
For this to work you have to use Clippy on the nightly toolchain: `cargo +nightly clippy`. If you
|
||||
want to use Clippy with the stable toolchain, you can stick to the old unscoped method to
|
||||
For this to work you have to use Clippy on the nightly toolchain: `cargo +nightly clippy`. If you
|
||||
want to use Clippy with the stable toolchain, you can stick to the old unscoped method to
|
||||
enable/disable Clippy lints until `tool_lints` are stable:
|
||||
```rust
|
||||
#![cfg_attr(feature = "cargo-clippy", allow(clippy_lint))]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
#![allow(clippy::default_hash_types)]
|
||||
|
||||
use itertools::Itertools;
|
||||
|
@ -56,8 +56,8 @@ impl Lint {
|
|||
}
|
||||
|
||||
/// Returns all non-deprecated lints
|
||||
pub fn active_lints(lints: &[Self]) -> impl Iterator<Item=&Self> {
|
||||
lints.iter().filter(|l| l.deprecation.is_none())
|
||||
pub fn active_lints(lints: impl Iterator<Item=Self>) -> impl Iterator<Item=Self> {
|
||||
lints.filter(|l| l.deprecation.is_none())
|
||||
}
|
||||
|
||||
/// Returns the lints in a HashMap, grouped by the different lint groups
|
||||
|
@ -144,7 +144,7 @@ fn test_active_lints() {
|
|||
let expected = vec![
|
||||
Lint::new("should_assert_eq2", "Not Deprecated", "abc", None, "module_name")
|
||||
];
|
||||
assert_eq!(expected, Lint::active_lints(&lints).cloned().collect::<Vec<Lint>>());
|
||||
assert_eq!(expected, Lint::active_lints(lints.into_iter()).collect::<Vec<Lint>>());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -51,5 +51,5 @@ fn print_lints() {
|
|||
}
|
||||
}
|
||||
|
||||
println!("there are {} lints", Lint::active_lints(&lint_list).count());
|
||||
println!("there are {} lints", Lint::active_lints(lint_list.into_iter()).count());
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ use crate::rustc::ty::{self, Ty, TyCtxt, Instance};
|
|||
use crate::rustc::ty::subst::{Subst, Substs};
|
||||
use std::cmp::Ordering::{self, Equal};
|
||||
use std::cmp::PartialOrd;
|
||||
use std::convert::TryInto;
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::mem;
|
||||
use std::rc::Rc;
|
||||
|
@ -229,6 +230,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::cast_possible_wrap)]
|
||||
fn constant_not(&self, o: &Constant, ty: ty::Ty<'_>) -> Option<Constant> {
|
||||
use self::Constant::*;
|
||||
match *o {
|
||||
|
@ -341,8 +343,12 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
|
|||
BinOpKind::Mul => l.checked_mul(r).map(zext),
|
||||
BinOpKind::Div if r != 0 => l.checked_div(r).map(zext),
|
||||
BinOpKind::Rem if r != 0 => l.checked_rem(r).map(zext),
|
||||
BinOpKind::Shr => l.checked_shr(r as u128 as u32).map(zext),
|
||||
BinOpKind::Shl => l.checked_shl(r as u128 as u32).map(zext),
|
||||
BinOpKind::Shr => l.checked_shr(
|
||||
r.try_into().expect("invalid shift")
|
||||
).map(zext),
|
||||
BinOpKind::Shl => l.checked_shl(
|
||||
r.try_into().expect("invalid shift")
|
||||
).map(zext),
|
||||
BinOpKind::BitXor => Some(zext(l ^ r)),
|
||||
BinOpKind::BitOr => Some(zext(l | r)),
|
||||
BinOpKind::BitAnd => Some(zext(l & r)),
|
||||
|
@ -362,8 +368,12 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
|
|||
BinOpKind::Mul => l.checked_mul(r).map(Constant::Int),
|
||||
BinOpKind::Div => l.checked_div(r).map(Constant::Int),
|
||||
BinOpKind::Rem => l.checked_rem(r).map(Constant::Int),
|
||||
BinOpKind::Shr => l.checked_shr(r as u32).map(Constant::Int),
|
||||
BinOpKind::Shl => l.checked_shl(r as u32).map(Constant::Int),
|
||||
BinOpKind::Shr => l.checked_shr(
|
||||
r.try_into().expect("shift too large")
|
||||
).map(Constant::Int),
|
||||
BinOpKind::Shl => l.checked_shl(
|
||||
r.try_into().expect("shift too large")
|
||||
).map(Constant::Int),
|
||||
BinOpKind::BitXor => Some(Constant::Int(l ^ r)),
|
||||
BinOpKind::BitOr => Some(Constant::Int(l | r)),
|
||||
BinOpKind::BitAnd => Some(Constant::Int(l & r)),
|
||||
|
@ -426,8 +436,12 @@ pub fn miri_to_const<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, result: &ty::Const<'
|
|||
ConstValue::Scalar(Scalar::Bits{ bits: b, ..}) => match result.ty.sty {
|
||||
ty::Bool => Some(Constant::Bool(b == 1)),
|
||||
ty::Uint(_) | ty::Int(_) => Some(Constant::Int(b)),
|
||||
ty::Float(FloatTy::F32) => Some(Constant::F32(f32::from_bits(b as u32))),
|
||||
ty::Float(FloatTy::F64) => Some(Constant::F64(f64::from_bits(b as u64))),
|
||||
ty::Float(FloatTy::F32) => Some(Constant::F32(f32::from_bits(
|
||||
b.try_into().expect("invalid f32 bit representation")
|
||||
))),
|
||||
ty::Float(FloatTy::F64) => Some(Constant::F64(f64::from_bits(
|
||||
b.try_into().expect("invalid f64 bit representation")
|
||||
))),
|
||||
// FIXME: implement other conversion
|
||||
_ => None,
|
||||
},
|
||||
|
@ -439,7 +453,7 @@ pub fn miri_to_const<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, result: &ty::Const<'
|
|||
.alloc_map
|
||||
.lock()
|
||||
.unwrap_memory(ptr.alloc_id);
|
||||
let offset = ptr.offset.bytes() as usize;
|
||||
let offset = ptr.offset.bytes().try_into().expect("too-large pointer offset");
|
||||
let n = n as usize;
|
||||
String::from_utf8(alloc.bytes[offset..(offset + n)].to_owned()).ok().map(Constant::Str)
|
||||
},
|
||||
|
|
|
@ -53,7 +53,7 @@ impl LintPass for UnportableVariant {
|
|||
}
|
||||
|
||||
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnportableVariant {
|
||||
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
||||
#[allow(clippy::cast_possible_truncation, clippy::cast_possible_wrap, clippy::cast_sign_loss)]
|
||||
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
|
||||
if cx.tcx.data_layout.pointer_size.bits() != 64 {
|
||||
return;
|
||||
|
|
|
@ -15,12 +15,13 @@
|
|||
#![feature(slice_patterns)]
|
||||
#![feature(stmt_expr_attributes)]
|
||||
#![feature(range_contains)]
|
||||
#![allow(unknown_lints, clippy::shadow_reuse, clippy::missing_docs_in_private_items)]
|
||||
#![allow(clippy::shadow_reuse, clippy::missing_docs_in_private_items)]
|
||||
#![recursion_limit = "256"]
|
||||
#![feature(macro_at_most_once_rep)]
|
||||
#![feature(tool_lints)]
|
||||
|
||||
#![warn(rust_2018_idioms, trivial_casts, trivial_numeric_casts)]
|
||||
#![feature(crate_visibility_modifier)]
|
||||
#![feature(try_from)]
|
||||
|
||||
// FIXME: switch to something more ergonomic here, once available.
|
||||
// (currently there is no way to opt into sysroot crates w/o `extern crate`)
|
||||
|
|
|
@ -1069,12 +1069,19 @@ fn lint_or_fun_call(cx: &LateContext<'_, '_>, expr: &hir::Expr, method_span: Spa
|
|||
/// Checks for the `EXPECT_FUN_CALL` lint.
|
||||
fn lint_expect_fun_call(cx: &LateContext<'_, '_>, expr: &hir::Expr, method_span: Span, name: &str, args: &[hir::Expr]) {
|
||||
fn extract_format_args(arg: &hir::Expr) -> Option<&hir::HirVec<hir::Expr>> {
|
||||
if let hir::ExprKind::AddrOf(_, ref addr_of) = arg.node {
|
||||
if let hir::ExprKind::Call(ref inner_fun, ref inner_args) = addr_of.node {
|
||||
if is_expn_of(inner_fun.span, "format").is_some() && inner_args.len() == 1 {
|
||||
if let hir::ExprKind::Call(_, ref format_args) = inner_args[0].node {
|
||||
return Some(format_args);
|
||||
}
|
||||
let arg = match &arg.node {
|
||||
hir::ExprKind::AddrOf(_, expr)=> expr,
|
||||
hir::ExprKind::MethodCall(method_name, _, args)
|
||||
if method_name.ident.name == "as_str" ||
|
||||
method_name.ident.name == "as_ref"
|
||||
=> &args[0],
|
||||
_ => arg,
|
||||
};
|
||||
|
||||
if let hir::ExprKind::Call(ref inner_fun, ref inner_args) = arg.node {
|
||||
if is_expn_of(inner_fun.span, "format").is_some() && inner_args.len() == 1 {
|
||||
if let hir::ExprKind::Call(_, ref format_args) = inner_args[0].node {
|
||||
return Some(format_args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1111,7 +1118,8 @@ fn lint_expect_fun_call(cx: &LateContext<'_, '_>, expr: &hir::Expr, method_span:
|
|||
| hir::ExprKind::MethodCall(..)
|
||||
// These variants are debatable or require further examination
|
||||
| hir::ExprKind::If(..)
|
||||
| hir::ExprKind::Match(..) => true,
|
||||
| hir::ExprKind::Match(..)
|
||||
| hir::ExprKind::Block{ .. } => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
@ -1165,7 +1173,7 @@ fn lint_expect_fun_call(cx: &LateContext<'_, '_>, expr: &hir::Expr, method_span:
|
|||
span_replace_word,
|
||||
&format!("use of `{}` followed by a function call", name),
|
||||
"try this",
|
||||
format!("unwrap_or_else({} panic!({}))", closure, sugg),
|
||||
format!("unwrap_or_else({} {{ let msg = {}; panic!(msg) }}))", closure, sugg),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ use crate::syntax::ast::{LitKind, NodeId, StrStyle};
|
|||
use crate::syntax::source_map::{BytePos, Span};
|
||||
use crate::utils::{is_expn_of, match_def_path, match_type, opt_def_id, paths, span_help_and_lint, span_lint};
|
||||
use crate::consts::{constant, Constant};
|
||||
use std::convert::TryFrom;
|
||||
|
||||
/// **What it does:** Checks [regex](https://crates.io/crates/regex) creation
|
||||
/// (with `Regex::new`,`RegexBuilder::new` or `RegexSet::new`) for correct
|
||||
|
@ -141,10 +142,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::cast_possible_truncation)] // truncation very unlikely here
|
||||
fn str_span(base: Span, c: regex_syntax::ast::Span, offset: u16) -> Span {
|
||||
let offset = u32::from(offset);
|
||||
let end = base.lo() + BytePos(c.end.offset as u32 + offset);
|
||||
let start = base.lo() + BytePos(c.start.offset as u32 + offset);
|
||||
let end = base.lo() + BytePos(u32::try_from(c.end.offset).expect("offset too large") + offset);
|
||||
let start = base.lo() + BytePos(u32::try_from(c.start.offset).expect("offset too large") + offset);
|
||||
assert!(start <= end);
|
||||
Span::new(start, end, base.ctxt())
|
||||
}
|
||||
|
|
|
@ -977,7 +977,8 @@ impl LintPass for CastPass {
|
|||
CAST_LOSSLESS,
|
||||
UNNECESSARY_CAST,
|
||||
CAST_PTR_ALIGNMENT,
|
||||
FN_TO_NUMERIC_CAST
|
||||
FN_TO_NUMERIC_CAST,
|
||||
FN_TO_NUMERIC_CAST_WITH_TRUNCATION,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -971,12 +971,14 @@ pub fn int_bits(tcx: TyCtxt<'_, '_, '_>, ity: ast::IntTy) -> u64 {
|
|||
layout::Integer::from_attr(tcx, attr::IntType::SignedInt(ity)).size().bits()
|
||||
}
|
||||
|
||||
#[allow(clippy::cast_possible_wrap)]
|
||||
/// Turn a constant int byte representation into an i128
|
||||
pub fn sext(tcx: TyCtxt<'_, '_, '_>, u: u128, ity: ast::IntTy) -> i128 {
|
||||
let amt = 128 - int_bits(tcx, ity);
|
||||
((u as i128) << amt) >> amt
|
||||
}
|
||||
|
||||
#[allow(clippy::cast_sign_loss)]
|
||||
/// clip unused bytes
|
||||
pub fn unsext(tcx: TyCtxt<'_, '_, '_>, u: i128, ity: ast::IntTy) -> u128 {
|
||||
let amt = 128 - int_bits(tcx, ity);
|
||||
|
|
|
@ -16,6 +16,7 @@ use crate::rustc::hir;
|
|||
use crate::rustc::lint::{EarlyContext, LateContext, LintContext};
|
||||
use crate::rustc_errors;
|
||||
use std::borrow::Cow;
|
||||
use std::convert::TryInto;
|
||||
use std::fmt::Display;
|
||||
use std;
|
||||
use crate::syntax::source_map::{CharPos, Span};
|
||||
|
@ -551,7 +552,7 @@ impl<'a, 'b, 'c, T: LintContext<'c>> DiagnosticBuilderExt<'c, T> for rustc_error
|
|||
let non_whitespace_offset = src[fmpos.pos.to_usize()..].find(|c| c != ' ' && c != '\t' && c != '\n');
|
||||
|
||||
if let Some(non_whitespace_offset) = non_whitespace_offset {
|
||||
remove_span = remove_span.with_hi(remove_span.hi() + BytePos(non_whitespace_offset as u32))
|
||||
remove_span = remove_span.with_hi(remove_span.hi() + BytePos(non_whitespace_offset.try_into().expect("offset too large")))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,8 +11,9 @@
|
|||
// error-pattern:yummy
|
||||
#![feature(box_syntax)]
|
||||
#![feature(rustc_private)]
|
||||
#![feature(tool_lints)]
|
||||
#![allow(unknown_lints, clippy::missing_docs_in_private_items)]
|
||||
|
||||
#![feature(try_from)]
|
||||
#![allow(clippy::missing_docs_in_private_items)]
|
||||
|
||||
// FIXME: switch to something more ergonomic here, once available.
|
||||
// (currently there is no way to opt into sysroot crates w/o `extern crate`)
|
||||
|
@ -22,6 +23,7 @@ extern crate rustc_driver;
|
|||
extern crate rustc_plugin;
|
||||
use self::rustc_driver::{driver::CompileController, Compilation};
|
||||
|
||||
use std::convert::TryInto;
|
||||
use std::path::Path;
|
||||
use std::process::{exit, Command};
|
||||
|
||||
|
@ -153,5 +155,5 @@ pub fn main() {
|
|||
|
||||
let args = args;
|
||||
rustc_driver::run_compiler(&args, Box::new(controller), None, None)
|
||||
}) as i32)
|
||||
}).try_into().expect("exit code too large"))
|
||||
}
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
// error-pattern:cargo-clippy
|
||||
#![feature(plugin_registrar)]
|
||||
#![feature(rustc_private)]
|
||||
#![feature(tool_lints)]
|
||||
#![allow(unknown_lints)]
|
||||
|
||||
#![allow(clippy::missing_docs_in_private_items)]
|
||||
#![warn(rust_2018_idioms)]
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
// error-pattern:yummy
|
||||
#![feature(box_syntax)]
|
||||
#![feature(rustc_private)]
|
||||
#![feature(tool_lints)]
|
||||
#![allow(unknown_lints, clippy::missing_docs_in_private_items)]
|
||||
|
||||
#![allow(clippy::missing_docs_in_private_items)]
|
||||
|
||||
use rustc_tools_util::*;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![deny(clippy::all)]
|
||||
#![allow(unused_imports)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![allow(clippy::all)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![allow(clippy::all)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![allow(dead_code, clippy::char_lit_as_u8, clippy::needless_bool)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![allow(unused_variables, clippy::blacklisted_name,
|
||||
clippy::needless_pass_by_value, dead_code)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
use std::collections::HashSet;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![deny(clippy::all)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![deny(clippy::all)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![deny(clippy::if_same_then_else)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![deny(clippy::match_same_arms)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![deny(clippy::mut_mut, clippy::zero_ptr, clippy::cmp_nan)]
|
||||
#![allow(dead_code)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#[deny(clippy::all)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![deny(clippy::needless_lifetimes)]
|
||||
#![allow(dead_code)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![allow(clippy::blacklisted_name)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![warn(clippy::single_match_else)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![allow(clippy::useless_attribute)] //issue #2910
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#![allow(dead_code)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
#![allow(clippy::many_single_char_names)]
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#![warn(clippy::absurd_extreme_comparisons)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#[warn(clippy::approx_constant)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#![warn(clippy::integer_arithmetic, clippy::float_arithmetic)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#[allow(dead_code, unused_assignments)]
|
||||
#[warn(clippy::assign_op_pattern)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#[allow(unused_assignments)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#![warn(clippy::inline_always, clippy::deprecated_semver)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
const THREE_BITS : i64 = 7;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#![allow(dead_code, clippy::similar_names, clippy::single_match, clippy::toplevel_ref_arg, unused_mut, unused_variables)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#![warn(clippy::block_in_if_condition_expr)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#[warn(clippy::bool_comparison)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![warn(clippy::nonminimal_bool, clippy::logic_bug)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#![deny(clippy::borrowed_box)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#![warn(clippy::all)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![warn(clippy::builtin_type_shadow)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#[deny(clippy::naive_bytecount)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#[warn(clippy::cast_precision_loss, clippy::cast_possible_truncation, clippy::cast_sign_loss, clippy::cast_possible_wrap, clippy::cast_lossless)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
//! Test casts for alignment issues
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#[warn(clippy::cast_lossless)]
|
||||
#[allow(clippy::no_effect, clippy::unnecessary_operation)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
#[warn(clippy::cast_lossless)]
|
||||
#[allow(clippy::no_effect, clippy::unnecessary_operation)]
|
||||
fn main() {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#[warn(clippy::cast_precision_loss, clippy::cast_possible_truncation, clippy::cast_sign_loss, clippy::cast_possible_wrap, clippy::cast_lossless)]
|
||||
#[allow(clippy::no_effect, clippy::unnecessary_operation)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#![warn(clippy::char_lit_as_u8)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
||||
#![allow(clippy::if_same_then_else)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
pub fn dec_read_dec(i: &mut i32) -> i32 {
|
||||
*i -= 1;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#[warn(clippy::cmp_nan)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![warn(clippy::cmp_null)]
|
||||
#![allow(unused_mut)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#[warn(clippy::cmp_owned)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#[warn(clippy::collapsible_if)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![warn(clippy::all)]
|
||||
#![allow(unused, clippy::needless_pass_by_value)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![allow(clippy::blacklisted_name, clippy::collapsible_if, clippy::cyclomatic_complexity, clippy::eq_op, clippy::needless_continue,
|
||||
clippy::needless_return, clippy::never_loop, clippy::no_effect, clippy::zero_divided_by_zero)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![warn(clippy::copy_iterator)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
fn main() {}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![allow(clippy::all)]
|
||||
#![warn(clippy::cyclomatic_complexity)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![warn(clippy::cyclomatic_complexity)]
|
||||
#![warn(unused)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#[warn(clippy::decimal_literal_representation)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![warn(clippy::default_trait_access)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![feature(untagged_unions)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![feature(never_type)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![feature(alloc)]
|
||||
#![feature(associated_type_defaults)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
//! This file tests for the DOC_MARKDOWN lint
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#[warn(clippy::double_neg)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#![warn(clippy::double_parens)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#![warn(clippy::drop_copy, clippy::forget_copy)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#![warn(clippy::drop_ref, clippy::forget_ref)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#![warn(clippy::duplicate_underscore_argument)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![warn(clippy::duration_subsec)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![warn(clippy::all)]
|
||||
#![warn(clippy::else_if_without_else)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#![allow(dead_code)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
#![warn(clippy::empty_line_after_outer_attr)]
|
||||
|
||||
// This should produce a warning
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![allow(unused, clippy::needless_pass_by_value)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![warn(clippy::all, clippy::pedantic)]
|
||||
#![allow(unused_imports, dead_code, clippy::missing_docs_in_private_items)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![feature(non_ascii_idents)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
// ignore-x86
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#[warn(clippy::eq_op)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#[allow(clippy::no_effect)]
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
#![allow(unknown_lints, unused, clippy::no_effect, clippy::redundant_closure_call, clippy::many_single_char_names, clippy::needless_pass_by_value, clippy::option_map_unit_fn, clippy::trivially_copy_pass_by_ref)]
|
||||
|
||||
#![allow(unused, clippy::no_effect, clippy::redundant_closure_call, clippy::many_single_char_names, clippy::needless_pass_by_value, clippy::option_map_unit_fn, clippy::trivially_copy_pass_by_ref)]
|
||||
#![warn(clippy::redundant_closure, clippy::needless_borrow)]
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#[warn(clippy::eval_order_dependence)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
#![warn(clippy::excessive_precision)]
|
||||
#![allow(clippy::print_literal)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![warn(clippy::explicit_write)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![deny(clippy::fallible_impl_from)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#![warn(clippy::all, clippy::pedantic)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#![warn(clippy::float_cmp)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#![warn(clippy::float_cmp_const)]
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
|
||||
// only-64bit
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![warn(clippy::fn_to_numeric_cast, clippy::fn_to_numeric_cast_with_truncation)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
use std::collections::*;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
#![allow(clippy::print_literal)]
|
||||
#![warn(clippy::useless_format)]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#![warn(clippy::all)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
|
||||
#![warn(clippy::all)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
|
||||
#![feature(tool_lints)]
|
||||
|
||||
|
||||
#![warn(clippy::default_hash_types)]
|
||||
#![feature(rustc_private)]
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue