1
Fork 0

Merge 'rust-clippy/master' into clippyup

This commit is contained in:
xFrednet 2022-05-21 13:24:00 +02:00
parent 8d04a32ab4
commit 4587b6628d
239 changed files with 4446 additions and 1708 deletions

View file

@ -12,7 +12,7 @@ use rustc_middle::ty::{self, Ty};
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::source_map::Span;
#[allow(clippy::module_name_repetitions)]
#[expect(clippy::module_name_repetitions)]
#[derive(Copy, Clone)]
pub struct UselessVec {
pub too_large_for_stack: u64,
@ -83,7 +83,7 @@ impl UselessVec {
let snippet = match *vec_args {
higher::VecArgs::Repeat(elem, len) => {
if let Some((Constant::Int(len_constant), _)) = constant(cx, cx.typeck_results(), len) {
#[allow(clippy::cast_possible_truncation)]
#[expect(clippy::cast_possible_truncation)]
if len_constant as u64 * size_of(cx, elem) > self.too_large_for_stack {
return;
}
@ -110,7 +110,6 @@ impl UselessVec {
},
higher::VecArgs::Vec(args) => {
if let Some(last) = args.iter().last() {
#[allow(clippy::cast_possible_truncation)]
if args.len() as u64 * size_of(cx, last) > self.too_large_for_stack {
return;
}