From e10271838ee5d746616f0484933016620a0891fb Mon Sep 17 00:00:00 2001 From: Jason Newcomb Date: Mon, 16 Feb 2026 05:22:50 -0500 Subject: [PATCH 01/14] `clippy_dev`: Move config parsing to the new parsing framework. --- clippy_config/src/conf.rs | 14 +- clippy_dev/src/fmt.rs | 250 +++------------------------------ clippy_dev/src/generate.rs | 31 +++- clippy_dev/src/parse.rs | 107 ++++++++++++++ clippy_dev/src/parse/cursor.rs | 167 ++++++++++++++++++++-- 5 files changed, 323 insertions(+), 246 deletions(-) diff --git a/clippy_config/src/conf.rs b/clippy_config/src/conf.rs index 7b2a7e0010f7..b1278a3461bb 100644 --- a/clippy_config/src/conf.rs +++ b/clippy_config/src/conf.rs @@ -472,7 +472,12 @@ define_Conf! { #[lints(inconsistent_struct_constructor)] check_inconsistent_struct_field_initializers("check-inconsistent-struct-field-initializers"): bool = false, /// Whether to also run the listed lints on private items. - #[lints(missing_errors_doc, missing_panics_doc, missing_safety_doc, unnecessary_safety_doc)] + #[lints( + missing_errors_doc, + missing_panics_doc, + missing_safety_doc, + unnecessary_safety_doc, + )] check_private_items("check-private-items"): bool = false, /// The maximum cognitive complexity a function can have #[lints(cognitive_complexity)] @@ -572,7 +577,12 @@ define_Conf! { #[lints(large_futures)] future_size_threshold("future-size-threshold"): u64 = 16 * 1024, /// A list of paths to types that should be treated as if they do not contain interior mutability - #[lints(borrow_interior_mutable_const, declare_interior_mutable_const, ifs_same_cond, mutable_key_type)] + #[lints( + borrow_interior_mutable_const, + declare_interior_mutable_const, + ifs_same_cond, + mutable_key_type, + )] ignore_interior_mutability("ignore-interior-mutability"): Vec = DEFAULT_IGNORE_INTERIOR_MUTABILITY, /// Sets the scope ("crate", "file", or "module") in which duplicate inherent `impl` blocks for the same type are linted. #[lints(multiple_inherent_impl)] diff --git a/clippy_dev/src/fmt.rs b/clippy_dev/src/fmt.rs index 992eb049e741..d5a52f63fc09 100644 --- a/clippy_dev/src/fmt.rs +++ b/clippy_dev/src/fmt.rs @@ -4,232 +4,10 @@ use crate::utils::{ ErrAction, FileUpdater, UpdateMode, UpdateStatus, VecBuf, expect_action, run_with_output, split_args_for_threads, walk_dir_no_dot_or_target, }; -use itertools::Itertools as _; -use rustc_lexer::{FrontmatterAllowed, TokenKind, tokenize}; -use std::fmt::Write as _; -use std::fs; -use std::io::{self, Read as _}; -use std::ops::ControlFlow; -use std::path::PathBuf; +use core::fmt::Write as _; +use std::io::Read as _; use std::process::{self, Command, Stdio}; -pub enum Error { - Io(io::Error), - Parse(PathBuf, usize, String), - CheckFailed, -} - -impl From for Error { - fn from(error: io::Error) -> Self { - Self::Io(error) - } -} - -impl Error { - fn display(&self) { - match self { - Self::CheckFailed => { - eprintln!("Formatting check failed!\nRun `cargo dev fmt` to update."); - }, - Self::Io(err) => { - eprintln!("error: {err}"); - }, - Self::Parse(path, line, msg) => { - eprintln!("error parsing `{}:{line}`: {msg}", path.display()); - }, - } - } -} - -struct ClippyConf<'a> { - name: &'a str, - attrs: &'a str, - lints: Vec<&'a str>, - field: &'a str, -} - -fn offset_to_line(text: &str, offset: usize) -> usize { - match text.split('\n').try_fold((1usize, 0usize), |(line, pos), s| { - let pos = pos + s.len() + 1; - if pos > offset { - ControlFlow::Break(line) - } else { - ControlFlow::Continue((line + 1, pos)) - } - }) { - ControlFlow::Break(x) | ControlFlow::Continue((x, _)) => x, - } -} - -/// Formats the configuration list in `clippy_config/src/conf.rs` -#[expect(clippy::too_many_lines)] -fn fmt_conf(check: bool) -> Result<(), Error> { - #[derive(Clone, Copy)] - enum State { - Start, - Docs, - Pound, - OpenBracket, - Attr(u32), - Lints, - EndLints, - Field, - } - - let path = "clippy_config/src/conf.rs"; - let text = fs::read_to_string(path)?; - - let (pre, conf) = text - .split_once("define_Conf! {\n") - .expect("can't find config definition"); - let (conf, post) = conf.split_once("\n}\n").expect("can't find config definition"); - let conf_offset = pre.len() + 15; - - let mut pos = 0u32; - let mut attrs_start = 0; - let mut attrs_end = 0; - let mut field_start = 0; - let mut lints = Vec::new(); - let mut name = ""; - let mut fields = Vec::new(); - let mut state = State::Start; - - for (i, t) in tokenize(conf, FrontmatterAllowed::No) - .map(|x| { - let start = pos; - pos += x.len; - (start as usize, x) - }) - .filter(|(_, t)| !matches!(t.kind, TokenKind::Whitespace)) - { - match (state, t.kind) { - (State::Start, TokenKind::LineComment { doc_style: Some(_) }) => { - attrs_start = i; - attrs_end = i + t.len as usize; - state = State::Docs; - }, - (State::Start, TokenKind::Pound) => { - attrs_start = i; - attrs_end = i; - state = State::Pound; - }, - (State::Docs, TokenKind::LineComment { doc_style: Some(_) }) => attrs_end = i + t.len as usize, - (State::Docs, TokenKind::Pound) => state = State::Pound, - (State::Pound, TokenKind::OpenBracket) => state = State::OpenBracket, - (State::OpenBracket, TokenKind::Ident) => { - state = if conf[i..i + t.len as usize] == *"lints" { - State::Lints - } else { - State::Attr(0) - }; - }, - (State::Attr(0), TokenKind::CloseBracket) => { - attrs_end = i + 1; - state = State::Docs; - }, - (State::Attr(x), TokenKind::OpenParen | TokenKind::OpenBracket | TokenKind::OpenBrace) => { - state = State::Attr(x + 1); - }, - (State::Attr(x), TokenKind::CloseParen | TokenKind::CloseBracket | TokenKind::CloseBrace) => { - state = State::Attr(x - 1); - }, - (State::Lints, TokenKind::Ident) => lints.push(&conf[i..i + t.len as usize]), - (State::Lints, TokenKind::CloseBracket) => state = State::EndLints, - (State::EndLints | State::Docs, TokenKind::Ident) => { - field_start = i; - name = &conf[i..i + t.len as usize]; - state = State::Field; - }, - (State::Field, TokenKind::LineComment { doc_style: Some(_) }) => { - #[expect(clippy::drain_collect)] - fields.push(ClippyConf { - name, - attrs: &conf[attrs_start..attrs_end], - lints: lints.drain(..).collect(), - field: conf[field_start..i].trim_end(), - }); - attrs_start = i; - attrs_end = i + t.len as usize; - state = State::Docs; - }, - (State::Field, TokenKind::Pound) => { - #[expect(clippy::drain_collect)] - fields.push(ClippyConf { - name, - attrs: &conf[attrs_start..attrs_end], - lints: lints.drain(..).collect(), - field: conf[field_start..i].trim_end(), - }); - attrs_start = i; - attrs_end = i; - state = State::Pound; - }, - (State::Field | State::Attr(_), _) - | (State::Lints, TokenKind::Comma | TokenKind::OpenParen | TokenKind::CloseParen) => {}, - _ => { - return Err(Error::Parse( - PathBuf::from(path), - offset_to_line(&text, conf_offset + i), - format!("unexpected token `{}`", &conf[i..i + t.len as usize]), - )); - }, - } - } - - if !matches!(state, State::Field) { - return Err(Error::Parse( - PathBuf::from(path), - offset_to_line(&text, conf_offset + conf.len()), - "incomplete field".into(), - )); - } - fields.push(ClippyConf { - name, - attrs: &conf[attrs_start..attrs_end], - lints, - field: conf[field_start..].trim_end(), - }); - - for field in &mut fields { - field.lints.sort_unstable(); - } - fields.sort_by_key(|x| x.name); - - let new_text = format!( - "{pre}define_Conf! {{\n{}}}\n{post}", - fields.iter().format_with("", |field, f| { - if field.lints.is_empty() { - f(&format_args!(" {}\n {}\n", field.attrs, field.field)) - } else if field.lints.iter().map(|x| x.len() + 2).sum::() < 120 - 14 { - f(&format_args!( - " {}\n #[lints({})]\n {}\n", - field.attrs, - field.lints.iter().join(", "), - field.field, - )) - } else { - f(&format_args!( - " {}\n #[lints({}\n )]\n {}\n", - field.attrs, - field - .lints - .iter() - .format_with("", |x, f| f(&format_args!("\n {x},"))), - field.field, - )) - } - }) - ); - - if text != new_text { - if check { - return Err(Error::CheckFailed); - } - fs::write(path, new_text)?; - } - Ok(()) -} - /// Format the symbols list fn fmt_syms(update_mode: UpdateMode) { FileUpdater::default().update_file_checked( @@ -329,21 +107,17 @@ fn run_rustfmt(update_mode: UpdateMode) { // the "main" function of cargo dev fmt pub fn run(update_mode: UpdateMode) { fmt_syms(update_mode); - if let Err(e) = fmt_conf(update_mode.is_check()) { - e.display(); - process::exit(1); - } - new_parse_cx(|cx| { - let mut data = cx.parse_lint_decls(); + let mut lint_data = cx.parse_lint_decls(); + let mut conf_data = cx.parse_conf_mac(); cx.dcx.exit_on_err(); let mut updater = FileUpdater::default(); #[expect(clippy::mutable_key_type)] - let mut lints = data.mk_file_to_lint_decl_map(); + let mut lints = lint_data.mk_file_to_lint_decl_map(); let mut ranges = VecBuf::with_capacity(256); - for passes in data.iter_passes_by_file_mut() { + for passes in lint_data.iter_passes_by_file_mut() { let file = passes[0].decl_sp.file; let mut lints = lints.remove(file); let lints = lints.as_deref_mut().unwrap_or_default(); @@ -358,6 +132,18 @@ pub fn run(update_mode: UpdateMode) { UpdateStatus::from_changed(src != dst) }); } + + updater.update_loaded_file_checked( + "cargo dev fmt", + update_mode, + conf_data.decl_sp.file, + &mut |_, src, dst| { + dst.push_str(&src[..conf_data.decl_sp.range.start as usize]); + conf_data.gen_mac(src, dst); + dst.push_str(&src[conf_data.decl_sp.range.end as usize..]); + UpdateStatus::from_changed(src != dst) + }, + ); }); run_rustfmt(update_mode); diff --git a/clippy_dev/src/generate.rs b/clippy_dev/src/generate.rs index f250c92f4551..cd18b03dde37 100644 --- a/clippy_dev/src/generate.rs +++ b/clippy_dev/src/generate.rs @@ -1,5 +1,5 @@ use crate::parse::cursor::Cursor; -use crate::parse::{LintData, LintPass, ParsedLints}; +use crate::parse::{ConfDef, LintData, LintPass, ParsedLints}; use crate::utils::{FileUpdater, UpdateMode, UpdateStatus, VecBuf, slice_groups, update_text_region_fn}; use core::range::Range; use itertools::Itertools as _; @@ -218,6 +218,35 @@ impl LintPass<'_> { } } +impl ConfDef<'_> { + pub fn gen_mac(&mut self, src: &str, dst: &mut String) { + self.opts.sort_unstable_by_key(|o| o.name); + dst.push_str("define_Conf! {"); + for opt in &mut self.opts { + let pre_lints = src[opt.decl_range.start as usize..opt.lints_range.start as usize].trim_end(); + if !pre_lints.is_empty() { + dst.push_str("\n "); + dst.push_str(pre_lints); + } + let pre_name_text = if opt.lints.is_empty() { + "\n " + } else { + opt.lints.sort_unstable(); + dst.push_str("\n #[lints("); + let fmt = write_list(opt.lints.iter().copied(), 80 - 14, " ", dst); + match fmt { + ListFmt::SingleLine => ")]\n ", + ListFmt::MultiLine => "\n )]\n ", + } + }; + dst.push_str(pre_name_text); + dst.push_str(src[opt.lints_range.end as usize..opt.decl_range.end as usize].trim()); + dst.push(','); + } + dst.push_str("\n}"); + } +} + fn write_comment_lines(s: &str, prefix: &str, dst: &mut String) -> bool { let mut has_doc = false; for line in s.split('\n') { diff --git a/clippy_dev/src/parse.rs b/clippy_dev/src/parse.rs index e589485dc8f4..f7f235ba8c8b 100644 --- a/clippy_dev/src/parse.rs +++ b/clippy_dev/src/parse.rs @@ -173,7 +173,114 @@ impl<'cx> ParsedLints<'cx> { } } +pub struct ConfOpt<'cx> { + pub name: &'cx str, + pub decl_range: Range, + pub lints: &'cx mut [&'cx str], + pub lints_range: Range, +} + +pub struct ConfDef<'cx> { + pub decl_sp: Span<'cx>, + pub opts: Vec>, +} + impl<'cx> ParseCxImpl<'cx> { + pub fn parse_conf_mac(&mut self) -> ConfDef<'cx> { + #[allow(clippy::enum_glob_use)] + use cursor::Pat::*; + + let file = &*self.source_files.alloc(SourceFile::load(self.str_buf.alloc_collect( + self.arena, + [ + "clippy_config", + path::MAIN_SEPARATOR_STR, + "src", + path::MAIN_SEPARATOR_STR, + "conf.rs", + ], + ))); + + let mut data = ConfDef { + decl_sp: Span::new(file, 0..0), + opts: Vec::with_capacity(100), + }; + let mut cursor = Cursor::new(&file.contents); + let mut captures = [Capture::EMPTY; 2]; + + if let Err(expected) = cursor + .find_mac_call("define_Conf") + .ok_or("`define_Conf!`") + .and_then(|name| { + data.decl_sp.range.start = name.pos; + cursor.eat_open_brace().ok_or("`{`") + }) + .and_then(|()| { + cursor.eat_list(|cursor| { + let docs = cursor.capture_doc_lines(); + let mut lints: &mut [_] = &mut []; + let mut lints_range = None; + let mut started = docs.len != 0; + while let Some((attr_start, name)) = cursor.capture_opt_attr_start()? { + started = true; + if cursor.get_text(name) == "lints" { + cursor + .eat_open_paren() + .ok_or("`(`") + .and_then(|()| { + cursor.capture_list(&mut self.str_list_buf, self.arena, |cursor| { + Ok(cursor.capture_ident().map(|x| cursor.get_text(x))) + }) + }) + .and_then(|res| { + lints = res; + cursor.match_all(&[CloseParen, CloseBracket], &mut []) + })?; + lints_range = Some(attr_start..cursor.pos()); + } else { + cursor.find_close_bracket().ok_or("`]`")?; + } + } + match cursor.opt_match_all(&[CaptureIdent, OpenParen, CaptureLitStr, CloseParen], &mut captures) { + Ok(true) => {}, + Ok(false) if started => return Err("an identifier"), + Ok(false) => return Ok(false), + Err(e) => return Err(e), + } + let name = cursor.get_text(captures[0]); + let name_str_sp = captures[1].mk_sp(file); + if let Some(name_str) = self.parse_str_lit(cursor.get_text(captures[1]), name_str_sp) + && name_str + .bytes() + .ne(name.bytes().map(|x| if x == b'_' { b'-' } else { x })) + { + self.dcx + .emit_spanned_err(name_str_sp, "the name string does not match the identifier"); + } + if cursor.eat_colon() { + cursor.eat_ty()?; + if cursor.eat_eq() { + cursor.eat_list_item(); + } + } + data.opts.push(ConfOpt { + name: cursor.get_text(captures[0]), + decl_range: docs.pos..cursor.pos(), + lints, + lints_range: lints_range.unwrap_or(captures[0].pos..captures[0].pos), + }); + Ok(true) + }) + }) + .and_then(|()| cursor.eat_close_brace().ok_or("`}`")) + { + cursor.emit_unexpected(&mut self.dcx, file, expected); + } + + data.decl_sp.range.end = cursor.pos(); + data + } + /// Finds and parses all lint declarations. pub fn parse_lint_decls(&mut self) -> ParsedLints<'cx> { let mut data = ParsedLints { diff --git a/clippy_dev/src/parse/cursor.rs b/clippy_dev/src/parse/cursor.rs index 2ee007615a67..6f19f4cdc0ef 100644 --- a/clippy_dev/src/parse/cursor.rs +++ b/clippy_dev/src/parse/cursor.rs @@ -2,7 +2,7 @@ use crate::utils::{StrBuf, VecBuf}; use crate::{DiagCx, SourceFile, Span}; use core::{ptr, slice}; use rustc_arena::DroplessArena; -use rustc_lexer::{self as lex, LiteralKind, Token, TokenKind}; +use rustc_lexer::{self as lex, DocStyle, LiteralKind, Token, TokenKind}; /// A token pattern used for searching and matching by the [`Cursor`]. /// @@ -257,17 +257,14 @@ impl<'txt> Cursor<'txt> { return true; }, - (Pat::CaptureDocLines, TokenKind::LineComment { doc_style: Some(_) }) => { + ( + Pat::CaptureDocLines, + TokenKind::LineComment { + doc_style: Some(DocStyle::Outer), + }, + ) => { let pos = self.pos; - loop { - self.step(); - if !matches!( - self.next_token.kind, - TokenKind::Whitespace | TokenKind::LineComment { doc_style: Some(_) } - ) { - break; - } - } + self.eat_doc_lines(); *captures.next().unwrap() = Capture { pos, len: self.pos - pos, @@ -327,6 +324,18 @@ impl<'txt> Cursor<'txt> { } } + /// Finds the next call to a macro with the specified name and returns it's captured + /// name. + #[must_use] + pub fn find_mac_call(&mut self, name: &str) -> Option { + while let Some(mac) = self.find_capture_ident() { + if self.eat_bang() && self.get_text(mac) == name { + return Some(mac); + } + } + None + } + /// Consumes and captures the text of a path without any internal whitespace. Returns /// `Err` if the path ends with `::`, and `None` if no path component exists at the /// current position. @@ -406,6 +415,130 @@ impl<'txt> Cursor<'txt> { }) } + /// Consumes all doc line comments until another non-whitespace token is found. + pub fn eat_doc_lines(&mut self) { + while matches!( + self.next_token.kind, + TokenKind::Whitespace + | TokenKind::LineComment { + doc_style: Some(DocStyle::Outer) + } + ) { + self.step(); + } + } + + /// Consumes and captures all doc line comments until another non-whitespace token is + /// found. + pub fn capture_doc_lines(&mut self) -> Capture { + loop { + match self.next_token.kind { + TokenKind::Whitespace => self.step(), + TokenKind::LineComment { + doc_style: Some(DocStyle::Outer), + } => { + let pos = self.pos; + self.step(); + self.eat_doc_lines(); + return Capture { + pos, + len: self.pos - pos, + }; + }, + _ => return Capture { pos: self.pos, len: 0 }, + } + } + } + + /// Consumes and captures the next outer attribute. Returns `Err` is the attribute + /// could not be parsed and `None` if the next token does not start an attribute. + pub fn capture_opt_attr_start(&mut self) -> Result, &'static str> { + if !self.eat_pound() { + return Ok(None); + } + let start = self.pos - 1; + self.eat_open_bracket() + .ok_or("`[`") + .and_then(|()| self.capture_ident().ok_or("an identifier")) + .map(|name| Some((start, name))) + } + + /// Consumes everything until the end of a list item indicated by either an unwrapped + /// comma or an unmatched closing delimiter. + pub fn eat_list_item(&mut self) { + let mut depth: u32 = 0; + loop { + match self.next_token.kind { + TokenKind::OpenBrace | TokenKind::OpenBracket | TokenKind::OpenParen => depth += 1, + TokenKind::CloseBrace | TokenKind::CloseBracket | TokenKind::CloseParen if depth > 0 => depth -= 1, + TokenKind::Comma if depth > 0 => {}, + TokenKind::Eof + | TokenKind::Comma + | TokenKind::CloseBrace + | TokenKind::CloseBracket + | TokenKind::CloseParen => break, + _ => {}, + } + self.step(); + } + } + + /// Consumes a (possibly invalid) type by consuming all tokens up to, but not + /// including, a follow-set token. Returns `Err` if a type could not be read. + pub fn eat_ty(&mut self) -> Result<(), &'static str> { + let mut has_non_ws = false; + let mut depth: u32 = 0; + loop { + match self.next_token.kind { + TokenKind::OpenBrace if depth > 1 => { + self.step(); + self.eat_remaining_tt(); + }, + TokenKind::OpenBracket | TokenKind::OpenParen | TokenKind::Lt => { + depth += 1; + has_non_ws = true; + }, + TokenKind::CloseBracket | TokenKind::CloseParen | TokenKind::Gt if depth > 0 => depth -= 1, + TokenKind::Colon | TokenKind::Comma | TokenKind::Eq | TokenKind::Or | TokenKind::Semi if depth > 0 => { + }, + TokenKind::Eof + | TokenKind::Colon + | TokenKind::Comma + | TokenKind::CloseBrace + | TokenKind::CloseBracket + | TokenKind::CloseParen + | TokenKind::Eq + | TokenKind::Gt + | TokenKind::Or + | TokenKind::OpenBrace + | TokenKind::Semi => break, + TokenKind::Whitespace | TokenKind::LineComment { .. } | TokenKind::BlockComment { .. } => {}, + _ => has_non_ws = true, + } + self.step(); + } + if has_non_ws { Ok(()) } else { Err("a type") } + } + + /// Eats the remainder of the current token tree. + pub fn eat_remaining_tt(&mut self) { + let mut depth: u32 = 0; + loop { + match self.next_token.kind { + TokenKind::OpenBrace | TokenKind::OpenBracket | TokenKind::OpenParen => depth += 1, + TokenKind::CloseBrace | TokenKind::CloseBracket | TokenKind::CloseParen if depth > 0 => depth -= 1, + TokenKind::Comma if depth > 0 => {}, + TokenKind::Eof => break, + TokenKind::CloseBrace | TokenKind::CloseBracket | TokenKind::CloseParen => { + self.step(); + break; + }, + _ => {}, + } + self.step(); + } + } + /// Attempts to match a sequence of patterns at the current position. Returns whether /// all patterns were successfully matched. /// @@ -494,14 +627,26 @@ mk_tk_methods! { close_brace(&mut self) { TokenKind::CloseBrace } ["`]`"] close_bracket(&mut self) { TokenKind::CloseBracket } + ["`:`"] + colon(&mut self) { TokenKind::Colon } ["`,`"] comma(&mut self) { TokenKind::Comma } ["`::`"] double_colon(&mut self) { TokenKind::Colon if self.inner.as_str().starts_with(':') => { self.step(); } } + ["`=`"] + eq(&mut self) { TokenKind::Eq } ["the specified identifier"] ident(&mut self, s: &str) { TokenKind::Ident if self.peek_text() == s } + ["`{`"] + open_brace(&mut self) { TokenKind::OpenBrace } + ["`[`"] + open_bracket(&mut self) { TokenKind::OpenBracket } + ["`(`"] + open_paren(&mut self) { TokenKind::OpenParen } + ["`#`"] + pound(&mut self) { TokenKind::Pound } ["`;`"] semi(&mut self) { TokenKind::Semi } } From a26f660f035c8bcea8883f56c50b57973ff6bd56 Mon Sep 17 00:00:00 2001 From: Jason Newcomb Date: Mon, 20 Oct 2025 17:17:39 -0400 Subject: [PATCH 02/14] `clippy_dev`: Panic immediately instead of returning errors in `add_lint`. --- clippy_dev/src/main.rs | 8 +-- clippy_dev/src/new_lint.rs | 133 +++++++++++-------------------------- clippy_dev/src/utils.rs | 47 ++++++++++--- 3 files changed, 80 insertions(+), 108 deletions(-) diff --git a/clippy_dev/src/main.rs b/clippy_dev/src/main.rs index 9e0f2fa14cb0..7f8543e9f2df 100644 --- a/clippy_dev/src/main.rs +++ b/clippy_dev/src/main.rs @@ -37,13 +37,13 @@ fn main() { category, r#type, msrv, - } => match new_lint::create(clippy.version, pass, &name, &category, r#type.as_deref(), msrv) { - Ok(()) => new_parse_cx(|cx| { + } => { + new_lint::create(clippy.version, pass, &name, &category, r#type.as_deref(), msrv); + new_parse_cx(|cx| { let data = cx.parse_lint_decls(); cx.dcx.exit_on_err(); data.gen_decls(UpdateMode::Change); - }), - Err(e) => eprintln!("Unable to create lint: {e}"), + }); }, DevCommand::Setup(SetupCommand { subcommand }) => match subcommand { SetupSubcommand::Intellij { remove, repo_path } => { diff --git a/clippy_dev/src/new_lint.rs b/clippy_dev/src/new_lint.rs index 3c797fb2247e..dee25aebad2b 100644 --- a/clippy_dev/src/new_lint.rs +++ b/clippy_dev/src/new_lint.rs @@ -1,10 +1,9 @@ use crate::parse::cursor::{self, Capture, Cursor}; -use crate::utils::Version; +use crate::utils::{File, Version, create_new_dir}; use clap::ValueEnum; use indoc::{formatdoc, writedoc}; use std::fmt::{self, Write as _}; -use std::fs::{self, OpenOptions}; -use std::io::{self, Write as _}; +use std::fs::OpenOptions; use std::path::{Path, PathBuf}; #[derive(Clone, Copy, PartialEq, ValueEnum)] @@ -30,35 +29,12 @@ struct LintData<'a> { ty: Option<&'a str>, } -trait Context { - fn context>(self, text: C) -> Self; -} - -impl Context for io::Result { - fn context>(self, text: C) -> Self { - match self { - Ok(t) => Ok(t), - Err(e) => { - let message = format!("{}: {e}", text.as_ref()); - Err(io::Error::other(message)) - }, - } - } -} - /// Creates the files required to implement and test a new lint and runs `update_lints`. /// /// # Errors /// /// This function errors out if the files couldn't be created or written to. -pub fn create( - clippy_version: Version, - pass: Pass, - name: &str, - category: &str, - mut ty: Option<&str>, - msrv: bool, -) -> io::Result<()> { +pub fn create(clippy_version: Version, pass: Pass, name: &str, category: &str, mut ty: Option<&str>, msrv: bool) { if category == "cargo" && ty.is_none() { // `cargo` is a special category, these lints should always be in `clippy_lints/src/cargo` ty = Some("cargo"); @@ -72,11 +48,11 @@ pub fn create( ty, }; - create_lint(&lint, msrv).context("Unable to create lint implementation")?; - create_test(&lint, msrv).context("Unable to create a test for the new lint")?; + create_lint(&lint, msrv); + create_test(&lint, msrv); if lint.ty.is_none() { - add_lint(&lint, msrv).context("Unable to add lint to clippy_lints/src/lib.rs")?; + add_lint(&lint, msrv); } if pass == Pass::Early { @@ -86,45 +62,36 @@ pub fn create( an early pass, as they lack many features and utilities" ); } - - Ok(()) } -fn create_lint(lint: &LintData<'_>, enable_msrv: bool) -> io::Result<()> { +fn create_lint(lint: &LintData<'_>, enable_msrv: bool) { if let Some(ty) = lint.ty { - create_lint_for_ty(lint, enable_msrv, ty) + create_lint_for_ty(lint, enable_msrv, ty); } else { - let lint_contents = get_lint_file_contents(lint, enable_msrv); - let lint_path = format!("clippy_lints/src/{}.rs", lint.name); - write_file(&lint_path, lint_contents.as_bytes())?; - println!("Generated lint file: `{lint_path}`"); - - Ok(()) + let path = format!("clippy_lints/src/{}.rs", lint.name); + File::create_new(&path).write(get_lint_file_contents(lint, enable_msrv)); + println!("Generated lint file: `{path}`"); } } -fn create_test(lint: &LintData<'_>, msrv: bool) -> io::Result<()> { - fn create_project_layout>( - lint_name: &str, - location: P, - case: &str, - hint: &str, - msrv: bool, - ) -> io::Result<()> { +fn create_test(lint: &LintData<'_>, msrv: bool) { + fn create_project_layout>(lint_name: &str, location: P, case: &str, hint: &str, msrv: bool) { let mut path = location.into().join(case); - fs::create_dir(&path)?; - write_file(path.join("Cargo.toml"), get_manifest_contents(lint_name, hint))?; + create_new_dir(&path); - path.push("src"); - fs::create_dir(&path)?; - write_file(path.join("main.rs"), get_test_file_contents(lint_name, msrv))?; + path.push("Cargo.toml"); + File::create_new(&path).write(get_manifest_contents(lint_name, hint)); + path.pop(); - Ok(()) + path.push("src"); + create_new_dir(&path); + path.push("main.rs"); + File::create_new(&path).write(get_test_file_contents(lint_name, msrv)); } if lint.category == "cargo" { let test_dir = format!("tests/ui-cargo/{}", lint.name); - fs::create_dir(&test_dir)?; + create_new_dir(&test_dir); create_project_layout( lint.name, @@ -132,30 +99,28 @@ fn create_test(lint: &LintData<'_>, msrv: bool) -> io::Result<()> { "fail", "Content that triggers the lint goes here", msrv, - )?; + ); create_project_layout( lint.name, &test_dir, "pass", "This file should not trigger the lint", false, - )?; + ); println!("Generated test directories: `{test_dir}/pass`, `{test_dir}/fail`"); } else { let test_path = format!("tests/ui/{}.rs", lint.name); - let test_contents = get_test_file_contents(lint.name, msrv); - write_file(&test_path, test_contents)?; - + File::create_new(&test_path).write(get_test_file_contents(lint.name, msrv)); println!("Generated test file: `{test_path}`"); } - - Ok(()) } -fn add_lint(lint: &LintData<'_>, enable_msrv: bool) -> io::Result<()> { +fn add_lint(lint: &LintData<'_>, enable_msrv: bool) { let path = "clippy_lints/src/lib.rs"; - let mut lib_rs = fs::read_to_string(path).context("reading")?; + let mut file = File::open(&path, OpenOptions::new().read(true).write(true)); + let mut lib_rs = String::new(); + file.read_append_to_string(&mut lib_rs); let module_name = lint.name; let camel_name = to_camel_case(lint.name); @@ -183,19 +148,7 @@ fn add_lint(lint: &LintData<'_>, enable_msrv: bool) -> io::Result<()> { lib_rs.insert_str(comment_start, &new_lint); - fs::write(path, lib_rs).context("writing") -} - -fn write_file, C: AsRef<[u8]>>(path: P, contents: C) -> io::Result<()> { - fn inner(path: &Path, contents: &[u8]) -> io::Result<()> { - OpenOptions::new() - .write(true) - .create_new(true) - .open(path)? - .write_all(contents) - } - - inner(path.as_ref(), contents.as_ref()).context(format!("writing to file: {}", path.as_ref().display())) + file.replace_contents(lib_rs); } fn to_camel_case(name: &str) -> String { @@ -372,7 +325,7 @@ fn get_lint_declaration(version: Version, name_upper: &str, category: &str) -> S ) } -fn create_lint_for_ty(lint: &LintData<'_>, enable_msrv: bool, ty: &str) -> io::Result<()> { +fn create_lint_for_ty(lint: &LintData<'_>, enable_msrv: bool, ty: &str) { match ty { "cargo" => assert_eq!( lint.category, "cargo", @@ -397,7 +350,7 @@ fn create_lint_for_ty(lint: &LintData<'_>, enable_msrv: bool, ty: &str) -> io::R ); let mod_file_path = ty_dir.join("mod.rs"); - let context_import = setup_mod_file(&mod_file_path, lint)?; + let context_import = setup_mod_file(&mod_file_path, lint); let (pass_lifetimes, msrv_ty, msrv_ref, msrv_cx) = match context_import { "LateContext" => ("<'_>", "Msrv", "", "cx, "), _ => ("", "MsrvStack", "&", ""), @@ -440,20 +393,21 @@ fn create_lint_for_ty(lint: &LintData<'_>, enable_msrv: bool, ty: &str) -> io::R ); } - write_file(lint_file_path.as_path(), lint_file_contents)?; + File::create_new(&lint_file_path).write(lint_file_contents); println!("Generated lint file: `clippy_lints/src/{ty}/{}.rs`", lint.name); println!( "Be sure to add a call to `{}::check` in `clippy_lints/src/{ty}/mod.rs`!", lint.name ); - - Ok(()) } -fn setup_mod_file(path: &Path, lint: &LintData<'_>) -> io::Result<&'static str> { +fn setup_mod_file(path: &Path, lint: &LintData<'_>) -> &'static str { let lint_name_upper = lint.name.to_uppercase(); - let mut file_contents = fs::read_to_string(path)?; + let mut file = File::open(path, OpenOptions::new().read(true).write(true)); + let mut file_contents = String::new(); + file.read_append_to_string(&mut file_contents); + assert!( !file_contents.contains(&format!("pub {lint_name_upper},")), "Lint `{}` already defined in `{}`", @@ -509,15 +463,8 @@ fn setup_mod_file(path: &Path, lint: &LintData<'_>) -> io::Result<&'static str> // Just add the mod declaration at the top, it'll be fixed by rustfmt file_contents.insert_str(0, &format!("mod {};\n", lint.name)); - let mut file = OpenOptions::new() - .write(true) - .truncate(true) - .open(path) - .context(format!("trying to open: `{}`", path.display()))?; - file.write_all(file_contents.as_bytes()) - .context(format!("writing to file: `{}`", path.display()))?; - - Ok(lint_context) + file.replace_contents(file_contents); + lint_context } // Find both the last lint declaration (declare_clippy_lint!) and the lint pass impl diff --git a/clippy_dev/src/utils.rs b/clippy_dev/src/utils.rs index 3680f167bc74..2aaaa190ecf6 100644 --- a/clippy_dev/src/utils.rs +++ b/clippy_dev/src/utils.rs @@ -107,6 +107,20 @@ impl<'a> File<'a> { Self::open(path, OpenOptions::new().read(true)) } + /// Creates a new file with the specified contents, panicking on failure. + #[track_caller] + pub fn create_new(path: &'a impl AsRef) -> Self { + let path = path.as_ref(); + Self { + inner: expect_action( + OpenOptions::new().create_new(true).write(true).open(path), + ErrAction::Open, + path, + ), + path, + } + } + /// Read the entire contents of a file to the given buffer. #[track_caller] pub fn read_append_to_string<'dst>(&mut self, dst: &'dst mut String) -> &'dst mut String { @@ -122,21 +136,24 @@ impl<'a> File<'a> { /// Writes the entire contents of the specified buffer to the file, panicking on failure. #[track_caller] - pub fn write(&mut self, data: &[u8]) { - expect_action(self.inner.write_all(data), ErrAction::Write, self.path); + pub fn write(&mut self, data: impl AsRef<[u8]>) { + expect_action(self.inner.write_all(data.as_ref()), ErrAction::Write, self.path); } /// Replaces the entire contents of a file. #[track_caller] - pub fn replace_contents(&mut self, data: &[u8]) { - let res = match self.inner.seek(SeekFrom::Start(0)) { - Ok(_) => { - self.write(data); - self.inner.set_len(data.len() as u64) - }, - Err(e) => Err(e), - }; - expect_action(res, ErrAction::Write, self.path); + pub fn replace_contents(&mut self, data: impl AsRef<[u8]>) { + fn f(file: &mut File<'_>, data: &[u8]) { + let res = match file.inner.seek(SeekFrom::Start(0)) { + Ok(_) => { + file.write(data); + file.inner.set_len(data.len() as u64) + }, + Err(e) => Err(e), + }; + expect_action(res, ErrAction::Write, file.path); + } + f(self, data.as_ref()); } } @@ -465,6 +482,14 @@ pub fn update_text_region_fn( move |path, src, dst| update_text_region(path, start, end, src, dst, &mut insert) } +/// Creates a new directory, panicking on failure. +/// +/// This will fail if the parent directory does not exist. +#[track_caller] +pub fn create_new_dir(path: impl AsRef) { + expect_action(fs::create_dir(path.as_ref()), ErrAction::Create, path.as_ref()); +} + #[track_caller] pub fn try_rename_file(old_name: impl AsRef, new_name: impl AsRef) -> bool { #[track_caller] From 62b4f853818e0d5922ad22a6f5619e7a202e826e Mon Sep 17 00:00:00 2001 From: Jason Newcomb Date: Thu, 26 Feb 2026 10:51:51 -0500 Subject: [PATCH 03/14] `clippy_dev`: Parse more parts of `declare_clippy_lint` macro calls. --- clippy_dev/src/edit_lints.rs | 20 +-- clippy_dev/src/fmt.rs | 4 +- clippy_dev/src/generate.rs | 57 ++++--- clippy_dev/src/parse.rs | 151 ++++++++++++------ clippy_dev/src/parse/cursor.rs | 35 ++-- clippy_lints/src/functions/mod.rs | 2 - clippy_lints/src/methods/mod.rs | 56 +++---- .../src/needless_parens_on_range_literals.rs | 54 +++---- clippy_lints/src/option_if_let_else.rs | 4 +- 9 files changed, 235 insertions(+), 148 deletions(-) diff --git a/clippy_dev/src/edit_lints.rs b/clippy_dev/src/edit_lints.rs index cd1ae61f88e5..5a0256ea8c92 100644 --- a/clippy_dev/src/edit_lints.rs +++ b/clippy_dev/src/edit_lints.rs @@ -1,5 +1,7 @@ use crate::parse::cursor::{self, Capture, Cursor}; -use crate::parse::{ActiveLint, DeprecatedLint, Lint, LintData, LintName, ParseCx, ParsedLints, RenamedLint}; +use crate::parse::{ + ActiveLintData, DeprecatedLintData, Lint, LintData, LintName, ParseCx, ParsedLints, RenamedLintData, +}; use crate::utils::{ ErrAction, FileUpdater, UpdateMode, UpdateStatus, Version, delete_dir_if_exists, delete_file_if_exists, expect_action, try_rename_dir, try_rename_file, walk_dir_no_dot_or_target, @@ -31,10 +33,8 @@ pub fn deprecate<'cx, 'env: 'cx>(cx: ParseCx<'cx>, clippy_version: Version, name lint.get_mut(), Lint { name_sp: Span::new(data.deprecated_file, 0..0), - data: LintData::Deprecated(DeprecatedLint { - reason, - version: cx.str_buf.alloc_display(cx.arena, clippy_version.rust_display()), - }), + version: cx.str_buf.alloc_display(cx.arena, clippy_version.rust_display()), + data: LintData::Deprecated(DeprecatedLintData { reason }), }, ); let LintData::Active(prev_lint_data) = prev_lint.data else { @@ -65,9 +65,9 @@ pub fn uplift<'cx, 'env: 'cx>(cx: ParseCx<'cx>, clippy_version: Version, old_nam lint.get_mut(), Lint { name_sp: Span::new(data.deprecated_file, 0..0), - data: LintData::Renamed(RenamedLint { + version: cx.str_buf.alloc_display(cx.arena, clippy_version.rust_display()), + data: LintData::Renamed(RenamedLintData { new_name: LintName::new_rustc(new_name), - version: cx.str_buf.alloc_display(cx.arena, clippy_version.rust_display()), }), }, ); @@ -117,9 +117,9 @@ pub fn rename<'cx, 'env: 'cx>(cx: ParseCx<'cx>, clippy_version: Version, old_nam lint.get_mut(), Lint { name_sp: Span::new(data.deprecated_file, 0..0), - data: LintData::Renamed(RenamedLint { + version: cx.str_buf.alloc_display(cx.arena, clippy_version.rust_display()), + data: LintData::Renamed(RenamedLintData { new_name: LintName::new_clippy(new_name), - version: cx.str_buf.alloc_display(cx.arena, clippy_version.rust_display()), }), }, ); @@ -173,7 +173,7 @@ pub fn rename<'cx, 'env: 'cx>(cx: ParseCx<'cx>, clippy_version: Version, old_nam fn remove_lint_declaration( name: &str, lint_file: &SourceFile<'_>, - lint_data: &ActiveLint<'_>, + lint_data: &ActiveLintData<'_>, data: &ParsedLints<'_>, updater: &mut FileUpdater, ) -> bool { diff --git a/clippy_dev/src/fmt.rs b/clippy_dev/src/fmt.rs index d5a52f63fc09..6afb3fdddb82 100644 --- a/clippy_dev/src/fmt.rs +++ b/clippy_dev/src/fmt.rs @@ -115,9 +115,9 @@ pub fn run(update_mode: UpdateMode) { let mut updater = FileUpdater::default(); #[expect(clippy::mutable_key_type)] - let mut lints = lint_data.mk_file_to_lint_decl_map(); + let mut lints = lint_data.lints.mk_by_file_map(); let mut ranges = VecBuf::with_capacity(256); - for passes in lint_data.iter_passes_by_file_mut() { + for passes in lint_data.lint_passes.iter_by_file_mut() { let file = passes[0].decl_sp.file; let mut lints = lints.remove(file); let lints = lints.as_deref_mut().unwrap_or_default(); diff --git a/clippy_dev/src/generate.rs b/clippy_dev/src/generate.rs index cd18b03dde37..669746765f16 100644 --- a/clippy_dev/src/generate.rs +++ b/clippy_dev/src/generate.rs @@ -1,5 +1,5 @@ use crate::parse::cursor::Cursor; -use crate::parse::{ConfDef, LintData, LintPass, ParsedLints}; +use crate::parse::{ActiveLint, ConfDef, LintData, LintPass, ParsedLints}; use crate::utils::{FileUpdater, UpdateMode, UpdateStatus, VecBuf, slice_groups, update_text_region_fn}; use core::range::Range; use itertools::Itertools as _; @@ -41,8 +41,8 @@ impl ParsedLints<'_> { for &(name, lint) in &lints { match &lint.data { LintData::Active(_) => active.push((name, lint.name_sp.file.path_as_krate_mod())), - LintData::Deprecated(lint) => deprecated.push((name, lint)), - LintData::Renamed(lint) => renamed.push((name, lint)), + LintData::Deprecated(data) => deprecated.push((name, lint.version, data.reason)), + LintData::Renamed(data) => renamed.push((name, lint.version, data.new_name)), } } active.sort_by_key(|&(_, path)| path); @@ -78,11 +78,10 @@ impl ParsedLints<'_> { ); dst.push_str(&src[..cursor.pos() as usize]); dst.push_str("! { DEPRECATED(DEPRECATED_VERSION) = [\n"); - for &(name, data) in &deprecated { + for &(name, version, reason) in &deprecated { write!( dst, - " #[clippy::version = \"{}\"]\n (\"clippy::{name}\", \"{}\"),\n", - data.version, data.reason, + " #[clippy::version = \"{version}\"]\n (\"clippy::{name}\", \"{reason}\"),\n", ) .unwrap(); } @@ -92,11 +91,10 @@ impl ParsedLints<'_> { declare_with_version! { RENAMED(RENAMED_VERSION) = [\n\ ", ); - for &(name, data) in &renamed { + for &(name, version, new_name) in &renamed { write!( dst, - " #[clippy::version = \"{}\"]\n (\"clippy::{name}\", \"{}\"),\n", - data.version, data.new_name, + " #[clippy::version = \"{version}\"]\n (\"clippy::{name}\", \"{new_name}\"),\n", ) .unwrap(); } @@ -110,7 +108,7 @@ impl ParsedLints<'_> { "tests/ui/deprecated.rs", &mut |_, src, dst| { dst.push_str(GENERATED_FILE_COMMENT); - for &(lint, _) in &deprecated { + for &(lint, _, _) in &deprecated { writeln!(dst, "#![warn(clippy::{lint})] //~ ERROR: lint `clippy::{lint}`").unwrap(); } dst.push_str("\nfn main() {}\n"); @@ -125,12 +123,12 @@ impl ParsedLints<'_> { let mut seen_lints = HashSet::new(); dst.push_str(GENERATED_FILE_COMMENT); dst.push_str("#![allow(clippy::duplicated_attributes)]\n"); - for &(_, lint) in &renamed { - if seen_lints.insert(lint.new_name) { - writeln!(dst, "#![allow({})]", lint.new_name).unwrap(); + for &(_, _, new_name) in &renamed { + if seen_lints.insert(new_name) { + writeln!(dst, "#![allow({new_name})]").unwrap(); } } - for &(lint, _) in &renamed { + for &(lint, _, _) in &renamed { writeln!(dst, "#![warn(clippy::{lint})] //~ ERROR: lint `clippy::{lint}`").unwrap(); } dst.push_str("\nfn main() {}\n"); @@ -188,6 +186,27 @@ impl ParsedLints<'_> { } } +impl ActiveLint<'_, '_> { + pub fn gen_mac(&self, dst: &mut String) { + dst.push_str("declare_clippy_lint! {"); + write_comment_lines(self.data.docs, "\n ", dst); + dst.extend(["\n #[clippy::version = \"", self.version, "\"]\n pub "]); + + // Lint names are stored in lower case, but the declaration needs to be upper case. + let name_pos = dst.len(); + dst.push_str(self.name); + dst[name_pos..].make_ascii_uppercase(); + dst.push(','); + + write_comment_lines(self.data.group_comments, "\n ", dst); + dst.extend(["\n ", self.data.group, ",\n ", self.data.desc]); + if !self.data.opts.is_empty() { + dst.extend([",\n ", self.data.opts]); + } + dst.push_str("\n}"); + } +} + impl LintPass<'_> { pub fn gen_mac(&self, dst: &mut String) { let mut line_start = dst.len(); @@ -288,23 +307,23 @@ fn write_list<'a>( pub fn gen_sorted_lints_file( src: &str, dst: &mut String, - lints: &mut [(&str, Range)], + lints: &mut [ActiveLint<'_, '_>], passes: &mut [LintPass<'_>], ranges: &mut VecBuf>, ) { ranges.with(|ranges| { - ranges.extend(lints.iter().map(|&(_, x)| x)); + ranges.extend(lints.iter().map(|x| x.data.decl_range)); ranges.extend(passes.iter().map(|x| x.decl_sp.range)); ranges.sort_unstable_by_key(|x| x.start); - lints.sort_unstable_by_key(|&(x, _)| x); + lints.sort_unstable_by_key(|x| x.name); passes.sort_by_key(|x| x.name); let mut ranges = ranges.iter(); let pos = if let Some(range) = ranges.next() { dst.push_str(&src[..range.start as usize]); - for &(_, range) in &*lints { - dst.push_str(&src[range.start as usize..range.end as usize]); + for lint in &*lints { + lint.gen_mac(dst); dst.push_str("\n\n"); } for pass in passes { diff --git a/clippy_dev/src/parse.rs b/clippy_dev/src/parse.rs index f7f235ba8c8b..a6c0972591b5 100644 --- a/clippy_dev/src/parse.rs +++ b/clippy_dev/src/parse.rs @@ -4,6 +4,7 @@ use self::cursor::{Capture, Cursor, IdentPat}; use crate::utils::{ErrAction, Scoped, StrBuf, VecBuf, expect_action, slice_groups_mut, walk_dir_no_dot_or_target}; use crate::{DiagCx, SourceFile, Span}; use core::fmt::{self, Display}; +use core::ops::{Deref, DerefMut}; use core::range::Range; use rustc_arena::{DroplessArena, TypedArena}; use rustc_data_structures::fx::FxHashMap; @@ -78,29 +79,45 @@ impl Display for LintName<'_> { } } -pub struct ActiveLint<'cx> { - pub group: &'cx str, +pub struct ActiveLintData<'cx> { pub decl_range: Range, + /// The raw text of the documentation comments. May include leading/trailing + /// whitespace and empty lines. + pub docs: &'cx str, + /// The raw text of the line comments. May include leading/trailing whitespace + /// and empty lines. + pub group_comments: &'cx str, + pub group: &'cx str, + /// The raw text of the string literal including the quotation marks. + pub desc: &'cx str, + /// The raw text of any additional `@option` values. Starts at the comma after + /// the description and may include trailing whitespace. + pub opts: &'cx str, } -pub struct DeprecatedLint<'cx> { +pub struct DeprecatedLintData<'cx> { pub reason: &'cx str, - pub version: &'cx str, } -pub struct RenamedLint<'cx> { +pub struct RenamedLintData<'cx> { pub new_name: LintName<'cx>, - pub version: &'cx str, } pub enum LintData<'cx> { - Active(ActiveLint<'cx>), - Deprecated(DeprecatedLint<'cx>), - Renamed(RenamedLint<'cx>), + Active(ActiveLintData<'cx>), + Deprecated(DeprecatedLintData<'cx>), + Renamed(RenamedLintData<'cx>), +} + +pub struct ActiveLint<'a, 'cx> { + pub name: &'cx str, + pub version: &'cx str, + pub data: &'a ActiveLintData<'cx>, } pub struct Lint<'cx> { pub name_sp: Span<'cx>, + pub version: &'cx str, pub data: LintData<'cx>, } @@ -129,41 +146,35 @@ pub struct LintPass<'cx> { pub lints: &'cx mut [&'cx str], } -pub struct ParsedLints<'cx> { - pub lints: FxHashMap<&'cx str, Lint<'cx>>, - pub lint_passes: Vec>, - pub deprecated_file: &'cx SourceFile<'cx>, -} -impl<'cx> ParsedLints<'cx> { +pub struct LintMap<'cx>(FxHashMap<&'cx str, Lint<'cx>>); +impl<'cx> LintMap<'cx> { #[expect(clippy::mutable_key_type)] - pub fn mk_file_to_lint_decl_map(&self) -> FxHashMap<&'cx SourceFile<'cx>, Vec<(&'cx str, Range)>> { + pub fn mk_by_file_map<'s>(&'s self) -> FxHashMap<&'cx SourceFile<'cx>, Vec>> { #[expect(clippy::default_trait_access)] let mut lints = FxHashMap::with_capacity_and_hasher(500, Default::default()); - for (&name, lint) in &self.lints { + for (&name, lint) in &self.0 { if let LintData::Active(lint_data) = &lint.data { lints .entry(lint.name_sp.file) .or_insert_with(|| Vec::with_capacity(8)) - .push((name, lint_data.decl_range)); + .push(ActiveLint { + name, + version: lint.version, + data: lint_data, + }); } } lints } - pub fn iter_passes_by_file_mut<'s>(&'s mut self) -> impl Iterator]> { - slice_groups_mut(&mut self.lint_passes, |head, tail| { - tail.iter().take_while(|&x| x.decl_sp.file == head.decl_sp.file).count() - }) - } - #[track_caller] - fn get_vacant_lint<'a>( - &'a mut self, + fn get_vacant_lint<'s>( + &'s mut self, dcx: &mut DiagCx, name: &'cx str, name_sp: Span<'cx>, - ) -> Option>> { - match self.lints.entry(name) { + ) -> Option>> { + match self.0.entry(name) { Entry::Vacant(e) => Some(e), Entry::Occupied(e) => { dcx.emit_duplicate_lint(name_sp, e.get().name_sp); @@ -172,6 +183,38 @@ impl<'cx> ParsedLints<'cx> { } } } +impl<'cx> Deref for LintMap<'cx> { + type Target = FxHashMap<&'cx str, Lint<'cx>>; + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl DerefMut for LintMap<'_> { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} + +pub struct LintPasses<'cx>(Vec>); +impl<'cx> LintPasses<'cx> { + pub fn iter_by_file_mut<'s>(&'s mut self) -> impl Iterator]> { + slice_groups_mut(&mut self.0, |head, tail| { + tail.iter().take_while(|&x| x.decl_sp.file == head.decl_sp.file).count() + }) + } +} +impl<'cx> Deref for LintPasses<'cx> { + type Target = [LintPass<'cx>]; + fn deref(&self) -> &Self::Target { + self.0.deref() + } +} + +pub struct ParsedLints<'cx> { + pub lints: LintMap<'cx>, + pub lint_passes: LintPasses<'cx>, + pub deprecated_file: &'cx SourceFile<'cx>, +} pub struct ConfOpt<'cx> { pub name: &'cx str, @@ -285,8 +328,8 @@ impl<'cx> ParseCxImpl<'cx> { pub fn parse_lint_decls(&mut self) -> ParsedLints<'cx> { let mut data = ParsedLints { #[expect(clippy::default_trait_access)] - lints: FxHashMap::with_capacity_and_hasher(1000, Default::default()), - lint_passes: Vec::with_capacity(400), + lints: LintMap(FxHashMap::with_capacity_and_hasher(1000, Default::default())), + lint_passes: LintPasses(Vec::with_capacity(400)), deprecated_file: self.source_files.alloc(SourceFile::load(self.str_buf.alloc_collect( self.arena, [ @@ -339,7 +382,7 @@ impl<'cx> ParseCxImpl<'cx> { use cursor::Pat::*; let mut cursor = Cursor::new(&file.contents); - let mut captures = [Capture::EMPTY; 3]; + let mut captures = [Capture::EMPTY; 6]; while let Some(mac_name) = cursor.find_capture_ident() { if !cursor.eat_bang() { continue; @@ -349,13 +392,13 @@ impl<'cx> ParseCxImpl<'cx> { #[rustfmt::skip] static DECL_START: &[cursor::Pat] = &[ // { /// docs - OpenBrace, AnyComments, + OpenBrace, CaptureDocLines, // #[clippy::version = "version"] Pound, OpenBracket, Ident(IdentPat::clippy), DoubleColon, Ident(IdentPat::version), Eq, CaptureLitStr, CloseBracket, // pub NAME, GROUP, "desc", Ident(IdentPat::r#pub), CaptureIdent, Comma, - AnyComments, CaptureIdent, Comma, AnyComments, LitStr, + CaptureLineComments, CaptureIdent, Comma, CaptureLitStr, ]; #[rustfmt::skip] static OPTION: &[cursor::Pat] = &[ @@ -363,26 +406,38 @@ impl<'cx> ParseCxImpl<'cx> { AnyComments, At, AnyIdent, Eq, Lit, ]; + let mut opts_text = ""; if let Err(expected) = cursor .match_all(DECL_START, &mut captures) .and_then(|()| { - (!cursor.eat_comma()).ok_or(()).or_else(|()| { - cursor.eat_list(|cursor| cursor.match_all(OPTION, &mut []).map(|()| true)) - }) + if cursor.eat_comma() { + let pos = cursor.pos(); + cursor.eat_list(|cursor| cursor.match_all(OPTION, &mut []).map(|()| true))?; + opts_text = file.contents[pos as usize..cursor.pos() as usize].trim(); + } + Ok(()) }) .and_then(|()| cursor.eat_close_brace().ok_or("`}`")) { cursor.emit_unexpected(&mut self.dcx, file, expected); - } else if let name = self.str_buf.alloc_ascii_lower(self.arena, cursor.get_text(captures[1])) - && let name_sp = captures[1].mk_sp(file) - && let Some(e) = data.get_vacant_lint(&mut self.dcx, name, name_sp) + } else if let [docs, version, name, group_comments, group, desc] = captures + && let name_sp = name.mk_sp(file) + && let name = self.str_buf.alloc_ascii_lower(self.arena, cursor.get_text(name)) + && let (Some(e), Some(version)) = ( + data.lints.get_vacant_lint(&mut self.dcx, name, name_sp), + self.parse_version(cursor.get_text(version), version.mk_sp(file)), + ) { - let _ = self.parse_version(cursor.get_text(captures[0]), captures[0].mk_sp(file)); e.insert(Lint { name_sp, - data: LintData::Active(ActiveLint { - group: cursor.get_text(captures[2]), + version, + data: LintData::Active(ActiveLintData { decl_range: mac_name.pos..cursor.pos(), + docs: cursor.get_text(docs), + group_comments: cursor.get_text(group_comments), + group: cursor.get_text(group), + desc: cursor.get_text(desc), + opts: opts_text, }), }); } @@ -409,7 +464,7 @@ impl<'cx> ParseCxImpl<'cx> { { cursor.emit_unexpected(&mut self.dcx, file, expected); } else { - data.lint_passes.push(LintPass { + data.lint_passes.0.push(LintPass { docs: cursor.get_text(captures[0]), name: cursor.get_text(captures[1]), lt: has_lt.then(|| cursor.get_text(captures[2])), @@ -477,11 +532,12 @@ impl<'cx> ParseCxImpl<'cx> { self.parse_clippy_lint_name(cursor.get_text(name), name_sp), self.parse_str_lit(cursor.get_text(reason), reason.mk_sp(file)), ) - && let Some(e) = data.get_vacant_lint(&mut self.dcx, name, name_sp) + && let Some(e) = data.lints.get_vacant_lint(&mut self.dcx, name, name_sp) { e.insert(Lint { name_sp, - data: LintData::Deprecated(DeprecatedLint { reason, version }), + version, + data: LintData::Deprecated(DeprecatedLintData { reason }), }); } Ok(parsed) @@ -504,11 +560,12 @@ impl<'cx> ParseCxImpl<'cx> { self.parse_clippy_lint_name(cursor.get_text(name), name_sp), self.parse_lint_name(cursor.get_text(new_name), new_name.mk_sp(file)), ) - && let Some(e) = data.get_vacant_lint(&mut self.dcx, name, name_sp) + && let Some(e) = data.lints.get_vacant_lint(&mut self.dcx, name, name_sp) { e.insert(Lint { name_sp, - data: LintData::Renamed(RenamedLint { new_name, version }), + version, + data: LintData::Renamed(RenamedLintData { new_name }), }); } Ok(parsed) diff --git a/clippy_dev/src/parse/cursor.rs b/clippy_dev/src/parse/cursor.rs index 6f19f4cdc0ef..18a90fbd8f21 100644 --- a/clippy_dev/src/parse/cursor.rs +++ b/clippy_dev/src/parse/cursor.rs @@ -17,6 +17,7 @@ pub enum Pat { CaptureDocLines, CaptureIdent, CaptureLifetime, + CaptureLineComments, CaptureLitStr, AnyIdent, At, @@ -31,7 +32,6 @@ pub enum Pat { Ident(IdentPat), Lifetime, Lit, - LitStr, Lt, OpenBrace, OpenBracket, @@ -44,6 +44,8 @@ impl Pat { match self { Self::AnyComments => "comments", Self::CaptureDocLines => "doc line comments", + Self::CaptureLineComments => "line comments", + Self::CaptureLitStr => "a string literal", Self::AnyIdent | Self::CaptureIdent => "an identifier", Self::At => "`@`", Self::Bang => "`!`", @@ -57,7 +59,6 @@ impl Pat { Self::Ident(x) => x.desc(), Self::Lifetime | Self::CaptureLifetime => "a lifetime", Self::Lit => "a literal", - Self::LitStr | Self::CaptureLitStr => "a string literal", Self::Lt => "`<`", Self::OpenBrace => "`{`", Self::OpenBracket => "`[`", @@ -222,14 +223,7 @@ impl<'txt> Cursor<'txt> { | (Pat::OpenBracket, TokenKind::OpenBracket) | (Pat::OpenParen, TokenKind::OpenParen) | (Pat::Pound, TokenKind::Pound) - | (Pat::Semi, TokenKind::Semi) - | ( - Pat::LitStr, - TokenKind::Literal { - kind: LiteralKind::Str { terminated: true } | LiteralKind::RawStr { .. }, - .. - }, - ) => break, + | (Pat::Semi, TokenKind::Semi) => break, (Pat::DoubleColon, TokenKind::Colon) if self.inner.as_str().starts_with(':') => { self.step(); @@ -257,6 +251,15 @@ impl<'txt> Cursor<'txt> { return true; }, + (Pat::CaptureLineComments, TokenKind::LineComment { doc_style: None }) => { + let pos = self.pos; + self.eat_line_comments(); + *captures.next().unwrap() = Capture { + pos, + len: self.pos - pos, + }; + return true; + }, ( Pat::CaptureDocLines, TokenKind::LineComment { @@ -271,7 +274,7 @@ impl<'txt> Cursor<'txt> { }; return true; }, - (Pat::CaptureDocLines, _) => { + (Pat::CaptureDocLines | Pat::CaptureLineComments, _) => { *captures.next().unwrap() = Capture::EMPTY; return true; }, @@ -450,6 +453,16 @@ impl<'txt> Cursor<'txt> { } } + /// Consumes all line comments until another non-whitespace token is found. + pub fn eat_line_comments(&mut self) { + while matches!( + self.next_token.kind, + TokenKind::Whitespace | TokenKind::LineComment { doc_style: None } + ) { + self.step(); + } + } + /// Consumes and captures the next outer attribute. Returns `Err` is the attribute /// could not be parsed and `None` if the next token does not start an attribute. pub fn capture_opt_attr_start(&mut self) -> Result, &'static str> { diff --git a/clippy_lints/src/functions/mod.rs b/clippy_lints/src/functions/mod.rs index 4c23f21a7318..d04de4ef44c9 100644 --- a/clippy_lints/src/functions/mod.rs +++ b/clippy_lints/src/functions/mod.rs @@ -110,7 +110,6 @@ declare_clippy_lint! { /// It is most likely that such a method is a bug caused by a typo or by copy-pasting. /// /// ### Example - /// ```no_run /// struct A { /// a: String, @@ -122,7 +121,6 @@ declare_clippy_lint! { /// &self.b /// } /// } - /// ``` /// Use instead: /// ```no_run diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs index 84decf478295..765275a6a835 100644 --- a/clippy_lints/src/methods/mod.rs +++ b/clippy_lints/src/methods/mod.rs @@ -1855,7 +1855,7 @@ declare_clippy_lint! { /// Redundant code in the `filter` and `map` operations is poor style and /// less performant. /// - /// ### Example + /// ### Example /// ```no_run /// (0_i32..10) /// .filter(|n| n.checked_add(1).is_some()) @@ -1881,7 +1881,7 @@ declare_clippy_lint! { /// Redundant code in the `find` and `map` operations is poor style and /// less performant. /// - /// ### Example + /// ### Example /// ```no_run /// (0_i32..10) /// .find(|n| n.checked_add(1).is_some()) @@ -2577,28 +2577,28 @@ declare_clippy_lint! { } declare_clippy_lint! { - /// ### What it does - /// It detects useless calls to `str::as_bytes()` before calling `len()` or `is_empty()`. - /// - /// ### Why is this bad? - /// The `len()` and `is_empty()` methods are also directly available on strings, and they - /// return identical results. In particular, `len()` on a string returns the number of - /// bytes. - /// - /// ### Example - /// ``` - /// let len = "some string".as_bytes().len(); - /// let b = "some string".as_bytes().is_empty(); - /// ``` - /// Use instead: - /// ``` - /// let len = "some string".len(); - /// let b = "some string".is_empty(); - /// ``` - #[clippy::version = "1.84.0"] - pub NEEDLESS_AS_BYTES, - complexity, - "detect useless calls to `as_bytes()`" + /// ### What it does + /// It detects useless calls to `str::as_bytes()` before calling `len()` or `is_empty()`. + /// + /// ### Why is this bad? + /// The `len()` and `is_empty()` methods are also directly available on strings, and they + /// return identical results. In particular, `len()` on a string returns the number of + /// bytes. + /// + /// ### Example + /// ``` + /// let len = "some string".as_bytes().len(); + /// let b = "some string".as_bytes().is_empty(); + /// ``` + /// Use instead: + /// ``` + /// let len = "some string".len(); + /// let b = "some string".is_empty(); + /// ``` + #[clippy::version = "1.84.0"] + pub NEEDLESS_AS_BYTES, + complexity, + "detect useless calls to `as_bytes()`" } declare_clippy_lint! { @@ -3680,10 +3680,10 @@ declare_clippy_lint! { /// let s = "Lorem ipsum"; /// &s.as_bytes()[1..5]; /// ``` - #[clippy::version = "1.86.0"] - pub SLICED_STRING_AS_BYTES, - perf, - "slicing a string and immediately calling as_bytes is less efficient and can lead to panics" + #[clippy::version = "1.86.0"] + pub SLICED_STRING_AS_BYTES, + perf, + "slicing a string and immediately calling as_bytes is less efficient and can lead to panics" } declare_clippy_lint! { diff --git a/clippy_lints/src/needless_parens_on_range_literals.rs b/clippy_lints/src/needless_parens_on_range_literals.rs index 1ee87f3f4f2f..971d23143afa 100644 --- a/clippy_lints/src/needless_parens_on_range_literals.rs +++ b/clippy_lints/src/needless_parens_on_range_literals.rs @@ -8,33 +8,33 @@ use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass, declare_lint_pass}; declare_clippy_lint! { - /// ### What it does - /// The lint checks for parenthesis on literals in range statements that are - /// superfluous. - /// - /// ### Why is this bad? - /// Having superfluous parenthesis makes the code less readable - /// overhead when reading. - /// - /// ### Example - /// - /// ```no_run - /// for i in (0)..10 { - /// println!("{i}"); - /// } - /// ``` - /// - /// Use instead: - /// - /// ```no_run - /// for i in 0..10 { - /// println!("{i}"); - /// } - /// ``` - #[clippy::version = "1.63.0"] - pub NEEDLESS_PARENS_ON_RANGE_LITERALS, - style, - "needless parenthesis on range literals can be removed" + /// ### What it does + /// The lint checks for parenthesis on literals in range statements that are + /// superfluous. + /// + /// ### Why is this bad? + /// Having superfluous parenthesis makes the code less readable + /// overhead when reading. + /// + /// ### Example + /// + /// ```no_run + /// for i in (0)..10 { + /// println!("{i}"); + /// } + /// ``` + /// + /// Use instead: + /// + /// ```no_run + /// for i in 0..10 { + /// println!("{i}"); + /// } + /// ``` + #[clippy::version = "1.63.0"] + pub NEEDLESS_PARENS_ON_RANGE_LITERALS, + style, + "needless parenthesis on range literals can be removed" } declare_lint_pass!(NeedlessParensOnRangeLiterals => [ diff --git a/clippy_lints/src/option_if_let_else.rs b/clippy_lints/src/option_if_let_else.rs index e39dbc3b51a7..728233a9def4 100644 --- a/clippy_lints/src/option_if_let_else.rs +++ b/clippy_lints/src/option_if_let_else.rs @@ -71,10 +71,10 @@ declare_clippy_lint! { /// y*y /// }, |foo| foo); /// ``` - // FIXME: Before moving this lint out of nursery, the lint name needs to be updated. It now also - // covers matches and `Result`. #[clippy::version = "1.47.0"] pub OPTION_IF_LET_ELSE, + // FIXME: Before moving this lint out of nursery, the lint name needs to be updated. It now also + // covers matches and `Result`. nursery, "reimplementation of Option::map_or" } From 1be332aa90de4c0f7ff40360c6af9f1b81694bc1 Mon Sep 17 00:00:00 2001 From: Jason Newcomb Date: Wed, 26 Aug 2026 14:33:16 -0400 Subject: [PATCH 04/14] Move module lists to be the first thing after `extern crate` and inner attributes/doc comments. --- clippy_lints/src/derive/mod.rs | 10 +++---- clippy_lints/src/doc/mod.rs | 28 +++++++++---------- .../src/floating_point_arithmetic/mod.rs | 10 +++---- clippy_lints/src/ifs/mod.rs | 10 +++---- clippy_lints/src/lib.rs | 15 +++++----- clippy_lints/src/matches/mod.rs | 3 +- clippy_lints/src/ptr/mod.rs | 6 ++-- clippy_lints/src/returns/mod.rs | 8 +++--- clippy_lints/src/write/mod.rs | 10 +++---- 9 files changed, 50 insertions(+), 50 deletions(-) diff --git a/clippy_lints/src/derive/mod.rs b/clippy_lints/src/derive/mod.rs index 1968a054f95b..72e8c8030287 100644 --- a/clippy_lints/src/derive/mod.rs +++ b/clippy_lints/src/derive/mod.rs @@ -1,14 +1,14 @@ -use clippy_utils::res::MaybeResPath as _; -use rustc_hir::def::Res; -use rustc_hir::{Impl, Item, ItemKind}; -use rustc_lint::{LateContext, LateLintPass, declare_lint_pass}; - mod derive_ord_xor_partial_ord; mod derive_partial_eq_without_eq; mod derived_hash_with_manual_eq; mod expl_impl_clone_on_copy; mod unsafe_derive_deserialize; +use clippy_utils::res::MaybeResPath as _; +use rustc_hir::def::Res; +use rustc_hir::{Impl, Item, ItemKind}; +use rustc_lint::{LateContext, LateLintPass, declare_lint_pass}; + declare_clippy_lint! { /// ### What it does /// Lints against manual `PartialOrd` and `Ord` implementations for types with a derived `Ord` diff --git a/clippy_lints/src/doc/mod.rs b/clippy_lints/src/doc/mod.rs index 4b81c73582e2..b51787f80175 100644 --- a/clippy_lints/src/doc/mod.rs +++ b/clippy_lints/src/doc/mod.rs @@ -1,3 +1,17 @@ +mod broken_link; +mod doc_comment_double_space_linebreaks; +mod doc_paragraphs_missing_punctuation; +mod doc_suspicious_footnotes; +mod include_in_doc_without_cfg; +mod lazy_continuation; +mod link_with_quotes; +mod markdown; +mod missing_headers; +mod needless_doctest_main; +mod suspicious_doc_comments; +mod test_attr_in_doctest; +mod too_long_first_doc_paragraph; + use clippy_config::Conf; use clippy_utils::attrs::is_doc_hidden; use clippy_utils::diagnostics::{span_lint, span_lint_and_help, span_lint_and_then}; @@ -22,20 +36,6 @@ use rustc_span::Span; use std::ops::Range; use url::Url; -mod broken_link; -mod doc_comment_double_space_linebreaks; -mod doc_paragraphs_missing_punctuation; -mod doc_suspicious_footnotes; -mod include_in_doc_without_cfg; -mod lazy_continuation; -mod link_with_quotes; -mod markdown; -mod missing_headers; -mod needless_doctest_main; -mod suspicious_doc_comments; -mod test_attr_in_doctest; -mod too_long_first_doc_paragraph; - declare_clippy_lint! { /// ### What it does /// Checks the doc comments have unbroken links, mostly caused diff --git a/clippy_lints/src/floating_point_arithmetic/mod.rs b/clippy_lints/src/floating_point_arithmetic/mod.rs index 7ab901837bd0..a908e36531a8 100644 --- a/clippy_lints/src/floating_point_arithmetic/mod.rs +++ b/clippy_lints/src/floating_point_arithmetic/mod.rs @@ -1,8 +1,3 @@ -use clippy_utils::res::{MaybeDef as _, MaybeTypeckRes as _}; -use clippy_utils::{is_in_const_context, is_no_std_crate, sym}; -use rustc_hir::{Expr, ExprKind}; -use rustc_lint::{LateContext, LateLintPass, declare_lint_pass}; - mod custom_abs; mod expm1; mod hypot; @@ -15,6 +10,11 @@ mod powf; mod powi; mod radians; +use clippy_utils::res::{MaybeDef as _, MaybeTypeckRes as _}; +use clippy_utils::{is_in_const_context, is_no_std_crate, sym}; +use rustc_hir::{Expr, ExprKind}; +use rustc_lint::{LateContext, LateLintPass, declare_lint_pass}; + declare_clippy_lint! { /// ### What it does /// Looks for floating-point expressions that diff --git a/clippy_lints/src/ifs/mod.rs b/clippy_lints/src/ifs/mod.rs index 3a33a1160d88..9ca97276db76 100644 --- a/clippy_lints/src/ifs/mod.rs +++ b/clippy_lints/src/ifs/mod.rs @@ -1,3 +1,8 @@ +mod branches_sharing_code; +mod if_same_then_else; +mod ifs_same_cond; +mod same_functions_in_if_cond; + use clippy_config::Conf; use clippy_utils::ty::InteriorMut; use clippy_utils::{if_sequence, is_else_clause, is_lint_allowed}; @@ -5,11 +10,6 @@ use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass, impl_lint_pass}; use rustc_middle::ty::TyCtxt; -mod branches_sharing_code; -mod if_same_then_else; -mod ifs_same_cond; -mod same_functions_in_if_cond; - declare_clippy_lint! { /// ### What it does /// Checks if the blocks of an `if`/`else`, or the arms of a `match`, contain shared code that diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 2de51660896c..f5ce2cc49641 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -50,14 +50,6 @@ extern crate clippy_utils; #[macro_use] extern crate declare_clippy_lint; -mod utils; - -mod combined_early_pass; -mod combined_late_pass; - -pub mod declared_lints; -pub mod deprecated_lints; - // begin lints modules, do not remove this comment, it's used in `update_lints` mod absolute_paths; mod almost_complete_range; @@ -415,6 +407,13 @@ mod zero_sized_map_values; mod zombie_processes; // end lints modules, do not remove this comment, it's used in `update_lints` +mod combined_early_pass; +mod combined_late_pass; +mod utils; + +pub mod declared_lints; +pub mod deprecated_lints; + use clippy_config::{Conf, sanitize_explanation}; use clippy_utils::macros::FormatArgsStorage; use rustc_data_structures::fx::FxHashSet; diff --git a/clippy_lints/src/matches/mod.rs b/clippy_lints/src/matches/mod.rs index f1c50b55f9ee..972375fbc451 100644 --- a/clippy_lints/src/matches/mod.rs +++ b/clippy_lints/src/matches/mod.rs @@ -1,6 +1,5 @@ mod collapsible_match; mod infallible_destructuring_match; -pub(crate) mod manual_filter; mod manual_map; mod manual_ok_err; mod manual_unwrap_or; @@ -24,6 +23,8 @@ mod single_match; mod try_err; mod wild_in_or_pats; +pub(crate) mod manual_filter; + use clippy_config::Conf; use clippy_utils::msrvs::{self, Msrv}; use clippy_utils::source::SpanExt as _; diff --git a/clippy_lints/src/ptr/mod.rs b/clippy_lints/src/ptr/mod.rs index 04393dcf60d5..17479187db3a 100644 --- a/clippy_lints/src/ptr/mod.rs +++ b/clippy_lints/src/ptr/mod.rs @@ -1,11 +1,11 @@ -use rustc_hir::{BinOpKind, Body, Expr, ExprKind, ImplItemKind, ItemKind, Node, TraitFn, TraitItem, TraitItemKind}; -use rustc_lint::{LateContext, LateLintPass, declare_lint_pass}; - mod cmp_null; mod mut_from_ref; mod ptr_arg; mod ptr_eq; +use rustc_hir::{BinOpKind, Body, Expr, ExprKind, ImplItemKind, ItemKind, Node, TraitFn, TraitItem, TraitItemKind}; +use rustc_lint::{LateContext, LateLintPass, declare_lint_pass}; + declare_clippy_lint! { /// ### What it does /// This lint checks for equality comparisons with `ptr::null` or `ptr::null_mut` diff --git a/clippy_lints/src/returns/mod.rs b/clippy_lints/src/returns/mod.rs index 5eac2fbb3670..1cb492e87ac5 100644 --- a/clippy_lints/src/returns/mod.rs +++ b/clippy_lints/src/returns/mod.rs @@ -1,13 +1,13 @@ +mod let_and_return; +mod needless_return; +mod needless_return_with_question_mark; + use rustc_hir::intravisit::FnKind; use rustc_hir::{Block, Body, FnDecl, Stmt}; use rustc_lint::{LateContext, LateLintPass, declare_lint_pass}; use rustc_span::Span; use rustc_span::def_id::LocalDefId; -mod let_and_return; -mod needless_return; -mod needless_return_with_question_mark; - declare_clippy_lint! { /// ### What it does /// Checks for `let`-bindings, which are subsequently diff --git a/clippy_lints/src/write/mod.rs b/clippy_lints/src/write/mod.rs index ac8ddd3653e5..803433829e11 100644 --- a/clippy_lints/src/write/mod.rs +++ b/clippy_lints/src/write/mod.rs @@ -1,3 +1,8 @@ +mod empty_string; +mod literal; +mod use_debug; +mod with_newline; + use clippy_config::Conf; use clippy_utils::diagnostics::span_lint; use clippy_utils::macros::{FormatArgsStorage, root_macro_call_first_node}; @@ -5,11 +10,6 @@ use clippy_utils::{is_in_test, sym}; use rustc_hir::{Expr, Impl, Item, ItemKind, OwnerId}; use rustc_lint::{LateContext, LateLintPass, LintContext as _, impl_lint_pass}; -mod empty_string; -mod literal; -mod use_debug; -mod with_newline; - declare_clippy_lint! { /// ### What it does /// This lint warns about the use of literals as `print!`/`println!` args. From 0309dcca91d6cdc32eff4bf227edba42e0ac92f4 Mon Sep 17 00:00:00 2001 From: Jason Newcomb Date: Wed, 29 Oct 2025 22:27:01 -0400 Subject: [PATCH 05/14] `clippy_dev`: Use the shared parsing logic in `new_lint`. --- clippy_dev/Cargo.toml | 1 - clippy_dev/src/edit_lints.rs | 17 +- clippy_dev/src/fmt.rs | 9 +- clippy_dev/src/generate.rs | 39 +- clippy_dev/src/main.rs | 17 +- clippy_dev/src/new_lint.rs | 874 ++++++++++++-------------- clippy_dev/src/parse.rs | 106 +++- clippy_dev/src/parse/cursor.rs | 14 +- clippy_dev/src/utils.rs | 110 +++- tests/lint-attributes-organization.rs | 15 +- 10 files changed, 667 insertions(+), 535 deletions(-) diff --git a/clippy_dev/Cargo.toml b/clippy_dev/Cargo.toml index d26a4cb12843..f9e18b82dfb5 100644 --- a/clippy_dev/Cargo.toml +++ b/clippy_dev/Cargo.toml @@ -9,7 +9,6 @@ annotate-snippets = { version = "0.12.10", features = ["simd"] } anstream = "0.6.20" chrono = { version = "0.4.38", default-features = false, features = ["clock"] } clap = { version = "4.4", features = ["derive"] } -indoc = "1.0" itertools = "0.15" memchr = "2.7.6" opener = "0.8" diff --git a/clippy_dev/src/edit_lints.rs b/clippy_dev/src/edit_lints.rs index 5a0256ea8c92..36eccdd756e1 100644 --- a/clippy_dev/src/edit_lints.rs +++ b/clippy_dev/src/edit_lints.rs @@ -180,7 +180,7 @@ fn remove_lint_declaration( let delete_mod = if data.lints.iter().all(|(_, l)| l.name_sp.file != lint_file) { delete_file_if_exists(lint_file.path.get()) } else { - updater.update_file(lint_file.path.get(), &mut |_, src, dst| -> UpdateStatus { + updater.change_file(lint_file.path.get(), |src, dst| { let mut start = &src[..lint_data.decl_range.start as usize]; if start.ends_with("\n\n") { start = &start[..start.len() - 1]; @@ -191,7 +191,6 @@ fn remove_lint_declaration( } dst.push_str(start); dst.push_str(end); - UpdateStatus::Changed }); false }; @@ -341,7 +340,7 @@ fn snake_to_pascal(s: &str) -> String { fn uplift_update_fn<'a>( old_name: &'a str, new_name: &'a str, - remove_mod: bool, + mut remove_mod: bool, ) -> impl use<'a> + FnMut(&Path, &str, &mut String) -> UpdateStatus { move |_, src, dst| { let mut copy_pos = 0u32; @@ -357,6 +356,17 @@ fn uplift_update_fn<'a>( copy_pos += 1; } changed = true; + remove_mod = false; + }, + "pub" if remove_mod && cursor.eat_ident("mod") && cursor.eat_ident(old_name) && cursor.eat_semi() => { + dst.push_str(&src[copy_pos as usize..ident.pos as usize]); + dst.push_str(new_name); + copy_pos = cursor.pos(); + if src[copy_pos as usize..].starts_with('\n') { + copy_pos += 1; + } + changed = true; + remove_mod = false; }, "clippy" if cursor.eat_double_colon() && cursor.eat_ident(old_name) => { dst.push_str(&src[copy_pos as usize..ident.pos as usize]); @@ -364,7 +374,6 @@ fn uplift_update_fn<'a>( copy_pos = cursor.pos(); changed = true; }, - _ => {}, } } diff --git a/clippy_dev/src/fmt.rs b/clippy_dev/src/fmt.rs index 6afb3fdddb82..b2a1c03b204f 100644 --- a/clippy_dev/src/fmt.rs +++ b/clippy_dev/src/fmt.rs @@ -113,6 +113,7 @@ pub fn run(update_mode: UpdateMode) { cx.dcx.exit_on_err(); let mut updater = FileUpdater::default(); + let copy: &mut dyn FnMut(&str, &mut String) = &mut |src, dst| dst.push_str(src); #[expect(clippy::mutable_key_type)] let mut lints = lint_data.lints.mk_by_file_map(); @@ -122,13 +123,13 @@ pub fn run(update_mode: UpdateMode) { let mut lints = lints.remove(file); let lints = lints.as_deref_mut().unwrap_or_default(); updater.update_loaded_file_checked("cargo dev fmt", update_mode, file, &mut |_, src, dst| { - gen_sorted_lints_file(src, dst, lints, passes, &mut ranges); + gen_sorted_lints_file(src, dst, lints, passes, &mut ranges, copy); UpdateStatus::from_changed(src != dst) }); } for (&file, lints) in &mut lints { updater.update_loaded_file_checked("cargo dev fmt", update_mode, file, &mut |_, src, dst| { - gen_sorted_lints_file(src, dst, lints, &mut [], &mut ranges); + gen_sorted_lints_file(src, dst, lints, &mut [], &mut ranges, copy); UpdateStatus::from_changed(src != dst) }); } @@ -138,9 +139,7 @@ pub fn run(update_mode: UpdateMode) { update_mode, conf_data.decl_sp.file, &mut |_, src, dst| { - dst.push_str(&src[..conf_data.decl_sp.range.start as usize]); - conf_data.gen_mac(src, dst); - dst.push_str(&src[conf_data.decl_sp.range.end as usize..]); + conf_data.gen_file(src, dst); UpdateStatus::from_changed(src != dst) }, ); diff --git a/clippy_dev/src/generate.rs b/clippy_dev/src/generate.rs index 669746765f16..cd77283e1e3f 100644 --- a/clippy_dev/src/generate.rs +++ b/clippy_dev/src/generate.rs @@ -238,6 +238,12 @@ impl LintPass<'_> { } impl ConfDef<'_> { + pub fn gen_file(&mut self, src: &str, dst: &mut String) { + dst.push_str(&src[..self.decl_sp.range.start as usize]); + self.gen_mac(src, dst); + dst.push_str(&src[self.decl_sp.range.end as usize..]); + } + pub fn gen_mac(&mut self, src: &str, dst: &mut String) { self.opts.sort_unstable_by_key(|o| o.name); dst.push_str("define_Conf! {"); @@ -310,6 +316,7 @@ pub fn gen_sorted_lints_file( lints: &mut [ActiveLint<'_, '_>], passes: &mut [LintPass<'_>], ranges: &mut VecBuf>, + copy_src: &mut dyn FnMut(&str, &mut String), ) { ranges.with(|ranges| { ranges.extend(lints.iter().map(|x| x.data.decl_range)); @@ -321,7 +328,7 @@ pub fn gen_sorted_lints_file( let mut ranges = ranges.iter(); let pos = if let Some(range) = ranges.next() { - dst.push_str(&src[..range.start as usize]); + copy_src(&src[..range.start as usize], dst); for lint in &*lints { lint.gen_mac(dst); dst.push_str("\n\n"); @@ -333,29 +340,31 @@ pub fn gen_sorted_lints_file( } range.end } else { - dst.push_str(src); + copy_src(src, dst); return; }; let pos = ranges.fold(pos, |start, range| { let s = &src[start as usize..range.start as usize]; - dst.push_str(if s.trim_start().is_empty() { - // Only whitespace between this and the previous item. No need to keep that. - "" - } else if src[..pos as usize].ends_with("\n\n") - && let Some(s) = s.strip_prefix("\n\n") - { - // Empty line before and after. Remove one of them. - s - } else { - // Remove only full lines unless something is in the way. - s.strip_prefix('\n').unwrap_or(s) - }); + // Don't keep whitespace between declarations. + if !s.trim_start().is_empty() { + let s = if src[..pos as usize].ends_with("\n\n") + && let Some(s) = s.strip_prefix("\n\n") + { + // Empty line before and after. Remove one of them. + s + } else { + // Remove the line end immediately proceeding a declaration. + s.strip_prefix('\n').unwrap_or(s) + }; + copy_src(s, dst); + } range.end }); // Since we always generate an empty line at the end, make sure to always skip it. let s = &src[pos as usize..]; - dst.push_str(s.strip_prefix('\n').map_or(s, |s| s.strip_prefix('\n').unwrap_or(s))); + let s = s.strip_prefix('\n').map_or(s, |s| s.strip_prefix('\n').unwrap_or(s)); + copy_src(s, dst); }); } diff --git a/clippy_dev/src/main.rs b/clippy_dev/src/main.rs index 7f8543e9f2df..d96483763919 100644 --- a/clippy_dev/src/main.rs +++ b/clippy_dev/src/main.rs @@ -35,16 +35,8 @@ fn main() { pass, name, category, - r#type, msrv, - } => { - new_lint::create(clippy.version, pass, &name, &category, r#type.as_deref(), msrv); - new_parse_cx(|cx| { - let data = cx.parse_lint_decls(); - cx.dcx.exit_on_err(); - data.gen_decls(UpdateMode::Change); - }); - }, + } => new_lint::create(clippy.version, &pass, &name, &category, msrv), DevCommand::Setup(SetupCommand { subcommand }) => match subcommand { SetupSubcommand::Intellij { remove, repo_path } => { if remove { @@ -162,9 +154,9 @@ enum DevCommand { #[command(name = "new_lint")] /// Create a new lint and run `cargo dev update_lints` NewLint { - #[arg(short, long, conflicts_with = "type", default_value = "late")] + #[arg(short, long, default_value = "late")] /// Specify whether the lint runs during the early or late pass - pass: new_lint::Pass, + pass: String, #[arg( short, long, @@ -191,9 +183,6 @@ enum DevCommand { /// What category the lint belongs to category: String, #[arg(long)] - /// What directory the lint belongs in - r#type: Option, - #[arg(long)] /// Add MSRV config code to the lint msrv: bool, }, diff --git a/clippy_dev/src/new_lint.rs b/clippy_dev/src/new_lint.rs index dee25aebad2b..8d1da74564aa 100644 --- a/clippy_dev/src/new_lint.rs +++ b/clippy_dev/src/new_lint.rs @@ -1,520 +1,476 @@ -use crate::parse::cursor::{self, Capture, Cursor}; -use crate::utils::{File, Version, create_new_dir}; -use clap::ValueEnum; -use indoc::{formatdoc, writedoc}; -use std::fmt::{self, Write as _}; -use std::fs::OpenOptions; -use std::path::{Path, PathBuf}; - -#[derive(Clone, Copy, PartialEq, ValueEnum)] -pub enum Pass { +use crate::generate::gen_sorted_lints_file; +use crate::parse::cursor::Cursor; +use crate::parse::{ActiveLint, ActiveLintData, Lint, LintData, LintPass, LintPassMac}; +use crate::utils::{FileUpdater, VecBuf, Version, create_new_dir}; +use crate::{SourceFile, Span, UpdateMode, new_parse_cx}; +use rustc_lexer::{DocStyle, TokenKind}; +use std::collections::hash_map::Entry; +use std::path::{self, MAIN_SEPARATOR_STR as PATH_SEP, PathBuf}; + +#[derive(Clone, Copy)] +enum LintPassKind { Early, Late, } -impl fmt::Display for Pass { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.write_str(match self { - Pass::Early => "early", - Pass::Late => "late", - }) - } -} - -struct LintData<'a> { - clippy_version: Version, - pass: Pass, - name: &'a str, - category: &'a str, - ty: Option<&'a str>, -} - /// Creates the files required to implement and test a new lint and runs `update_lints`. /// /// # Errors /// /// This function errors out if the files couldn't be created or written to. -pub fn create(clippy_version: Version, pass: Pass, name: &str, category: &str, mut ty: Option<&str>, msrv: bool) { - if category == "cargo" && ty.is_none() { - // `cargo` is a special category, these lints should always be in `clippy_lints/src/cargo` - ty = Some("cargo"); - } +#[expect(clippy::too_many_lines)] +pub fn create(clippy_version: Version, pass: &str, name: &str, group: &str, has_msrv: bool) { + new_parse_cx(|cx| { + let cx = &mut **cx; + let mut data = cx.parse_lint_decls(); + let conf_data = has_msrv.then(|| cx.parse_conf_mac()); + match (pass, group) { + ("cargo", "cargo") => {}, + ("cargo", _) => cx + .dcx + .emit_spanless_err("a lint added to the `cargo` pass must be part of the `cargo` group"), + (_, "cargo") => cx + .dcx + .emit_spanless_err("a lint added to the `cargo` group must be part of the `cargo` pass"), + _ => {}, + } + let (pass_idx, new_pass) = match pass { + "early" => (None, LintPassKind::Early), + "late" => (None, LintPassKind::Late), + _ => { + let pass_name = cx.str_buf.alloc_kebab_to_pascal(cx.arena, pass); + let pass_idx = data.lint_passes.iter().position(|p| p.name == pass_name); + if pass_idx.is_none() { + cx.dcx.emit_spanless_err(format!("unknown lint pass `{pass}`")); + } + (pass_idx, LintPassKind::Early) + }, + }; + let name_snake = cx.str_buf.alloc_kebab_to_snake(cx.arena, name); + let Entry::Vacant(vacant_lint) = data.lints.entry(name_snake) else { + cx.dcx.emit_unknown_lint(name); + cx.dcx.exit_assume_err(); + }; + cx.dcx.exit_on_err(); + + let name_pascal = cx.str_buf.alloc_kebab_to_pascal(cx.arena, name); + let name_upper = cx.str_buf.alloc_ascii_upper(cx.arena, name_snake); + let version = cx.str_buf.alloc_display(cx.arena, clippy_version.rust_display()); + let mut lint_data = ActiveLintData { + decl_range: 0..0, + docs: if group == "restriction" { + RESTRICTION_DESC + } else { + DEFAULT_DESC + }, + group_comments: "", + group, + desc: r#""default lint description""#, + opts: "", + }; - let lint = LintData { - clippy_version, - pass, - name, - category, - ty, - }; + let mut updater = FileUpdater::default(); + + // Edit clippy source to add the new lint. + if let Some(pass_idx) = pass_idx { + let lint_pass = &mut data.lint_passes[pass_idx]; + let file = lint_pass.decl_sp.file; + let is_late_pass = lint_pass.is_late; + + lint_pass.lints = cx.str_list_buf.with(|buf| { + buf.extend(lint_pass.lints.iter().copied()); + buf.push(name_upper); + cx.arena.alloc_slice(buf) + }); + lint_data.decl_range = lint_pass.decl_sp.range.end..lint_pass.decl_sp.range.end; + vacant_lint.insert(Lint { + name_sp: Span::new(file, lint_data.decl_range), + version, + data: LintData::Active(lint_data), + }); + + let add_mod = if let Some((path, "mod.rs" | "lib.rs")) = file.path.get().rsplit_once(path::MAIN_SEPARATOR) { + updater.write_new_file(String::from_iter([path, PATH_SEP, name_snake, ".rs"]), |dst| { + write_lint_check_file(dst, name_upper, is_late_pass, has_msrv); + }); + true + } else { + false + }; + updater.change_loaded_file(file, |src, dst| { + let mut lints: Vec<_> = data.lints.lints_in_file(file).collect(); + let passes = data.lint_passes.in_same_file_as_mut(pass_idx); + let mut ranges = VecBuf::with_capacity(lints.len() + passes.len()); + let mut copy = mk_sorted_lints_copy_fn(add_mod, name_snake); + gen_sorted_lints_file(src, dst, &mut lints, passes, &mut ranges, &mut copy); + }); + } else { + // Create a new lint pass. + let path = cx + .str_buf + .alloc_collect(cx.arena, ["clippy_lints", PATH_SEP, "src", PATH_SEP, name, ".rs"]); + let file = cx.source_files.alloc(SourceFile::new_empty(path)); + vacant_lint.insert(Lint { + name_sp: Span::new(file, 0..0), + version, + data: LintData::Active(lint_data), + }); + + updater.write_new_file(path, |dst| { + write_lint_file( + dst, + &ActiveLint { + name: name_snake, + version, + data: &lint_data, + }, + &LintPass { + docs: "", + name: name_pascal, + lt: None, + mac: if has_msrv { + LintPassMac::Impl + } else { + LintPassMac::Declare + }, + decl_sp: Span::new(file, 0..0), + lints: cx.arena.alloc_slice(&[name_upper]), + is_early: matches!(new_pass, LintPassKind::Early), + is_late: matches!(new_pass, LintPassKind::Late), + }, + has_msrv, + ); + }); + updater.change_file("clippy_lints/src/lib.rs", |src, dst| { + add_lint_pass(src, dst, name_snake, name_pascal, new_pass, has_msrv); + }); + } - create_lint(&lint, msrv); - create_test(&lint, msrv); + // Register the lint with the MSRV option. + if let Some(mut data) = conf_data + && let Some(opt) = data.opts.iter_mut().find(|x| x.name == "msrv") + { + opt.lints = cx.str_list_buf.with(|buf| { + buf.extend(opt.lints.iter().copied()); + buf.push(name_snake); + cx.arena.alloc_slice(buf) + }); + updater.change_loaded_file(data.decl_sp.file, |src, dst| data.gen_file(src, dst)); + } - if lint.ty.is_none() { - add_lint(&lint, msrv); - } + // Create test files. + if group == "cargo" { + let mut path = PathBuf::from_iter(["tests", "ui-cargo", name_snake]); + create_new_dir(&path); + + let mut mk_project = |name: &str, todo: &str| { + path.push(name); + create_new_dir(&path); + path.push("Cargo.toml"); + updater.write_new_file(&path, |dst| write_cargo_manifest(dst, name_snake, todo)); + path.pop(); + path.push("src"); + create_new_dir(&path); + path.push("main.rs"); + updater.write_new_file(&path, |dst| write_test_file(dst, name_snake, has_msrv)); + path.pop(); + path.pop(); + path.pop(); + }; + mk_project("pass", "Add contents that should pass"); + mk_project("fail", "Add contents the should fail"); + } else { + updater.write_new_file( + String::from_iter(["tests", PATH_SEP, "ui", PATH_SEP, name_snake, ".rs"]), + |dst| write_test_file(dst, name_snake, has_msrv), + ); + } - if pass == Pass::Early { - println!( - "\n\ - NOTE: Use a late pass unless you need something specific from\n\ - an early pass, as they lack many features and utilities" - ); - } + data.gen_decls(UpdateMode::Change); + }); } -fn create_lint(lint: &LintData<'_>, enable_msrv: bool) { - if let Some(ty) = lint.ty { - create_lint_for_ty(lint, enable_msrv, ty); +static DEFAULT_DESC: &str = "\ +/// ### What it does +/// +/// ### Why is this bad? +/// +/// ### Example +/// ```no_run +/// // example code where clippy issues a warning +/// ``` +/// Use instead: +/// ```no_run +/// // example code which does not raise clippy warning +/// ```"; + +static RESTRICTION_DESC: &str = "\ +/// ### What it does +/// +/// ### Why restrict this? +/// +/// ### Example +/// ```no_run +/// // example code where clippy issues a warning +/// ``` +/// Use instead: +/// ```no_run +/// // example code which does not raise clippy warning +/// ```"; + +#[rustfmt::skip] +fn write_lint_check_file(dst: &mut String, name_upper: &str, is_late_pass: bool, has_msrv: bool) { + let (cx_ty, cx_lt, msrv_arg, msrv_import) = if is_late_pass { + ("LateContext", "<'_>", ", msrv: Msrv", "use clippy_utils::msrvs::{self, Msrv};\n") } else { - let path = format!("clippy_lints/src/{}.rs", lint.name); - File::create_new(&path).write(get_lint_file_contents(lint, enable_msrv)); - println!("Generated lint file: `{path}`"); - } -} - -fn create_test(lint: &LintData<'_>, msrv: bool) { - fn create_project_layout>(lint_name: &str, location: P, case: &str, hint: &str, msrv: bool) { - let mut path = location.into().join(case); - create_new_dir(&path); + ("EarlyContext", "", ", msrv: &MsrvStack", "use clippy_utils::msrvs::{self, MsrvStack};\n") + }; + let (msrv_arg, msrv_import) = if has_msrv { (msrv_arg, msrv_import) } else { ("", "") }; - path.push("Cargo.toml"); - File::create_new(&path).write(get_manifest_contents(lint_name, hint)); - path.pop(); + dst.extend([ +msrv_import, "use rustc_lint::", cx_ty, "; - path.push("src"); - create_new_dir(&path); - path.push("main.rs"); - File::create_new(&path).write(get_test_file_contents(lint_name, msrv)); - } +use super::", name_upper, "; - if lint.category == "cargo" { - let test_dir = format!("tests/ui-cargo/{}", lint.name); - create_new_dir(&test_dir); - - create_project_layout( - lint.name, - &test_dir, - "fail", - "Content that triggers the lint goes here", - msrv, - ); - create_project_layout( - lint.name, - &test_dir, - "pass", - "This file should not trigger the lint", - false, - ); - - println!("Generated test directories: `{test_dir}/pass`, `{test_dir}/fail`"); - } else { - let test_path = format!("tests/ui/{}.rs", lint.name); - File::create_new(&test_path).write(get_test_file_contents(lint.name, msrv)); - println!("Generated test file: `{test_path}`"); - } +pub(super) fn check(cx: &", cx_ty, cx_lt, msrv_arg, ") { + todo!(\"implement lint logic\"); +} +"]); } -fn add_lint(lint: &LintData<'_>, enable_msrv: bool) { - let path = "clippy_lints/src/lib.rs"; - let mut file = File::open(&path, OpenOptions::new().read(true).write(true)); - let mut lib_rs = String::new(); - file.read_append_to_string(&mut lib_rs); - - let module_name = lint.name; - let camel_name = to_camel_case(lint.name); +#[rustfmt::skip] +fn write_test_file(dst: &mut String, name: &str, has_msrv: bool) { + let msrv_contents = if has_msrv { + " - let (comment, new_lint) = if lint.pass == Pass::Late { - // Late passes are folded into the statically-combined struct, so a new - // entry is just `Field: Type = constructor` (see `combined_late_pass`). - let new_lint = if enable_msrv { - format!("{camel_name}: {module_name}::{camel_name} = {module_name}::{camel_name}::new(conf),\n ") - } else { - format!("{camel_name}: {module_name}::{camel_name} = {module_name}::{camel_name},\n ") - }; - ("// add late passes here", new_lint) + // TODO: set `xx` to on below the required MSRV and `yy` to the required MSRV. + #[clippy::msrv = \"1.xx\"] + { + // TODO: test which requires the msrv to be set + }; + #[clippy::msrv =\"1.yy\"] + { + // TODO: same test as above + } +" } else { - // Early passes are folded into the statically-combined struct, so a new - // entry is just `Field: Type = constructor` (see `combined_early_pass`). - let new_lint = if enable_msrv { - format!("{camel_name}: {module_name}::{camel_name} = {module_name}::{camel_name}::new(conf),\n ") - } else { - format!("{camel_name}: {module_name}::{camel_name} = {module_name}::{camel_name},\n ") - }; - ("// add early passes here", new_lint) + "" }; - let comment_start = lib_rs.find(comment).expect("Couldn't find comment"); - - lib_rs.insert_str(comment_start, &new_lint); - - file.replace_contents(lib_rs); -} -fn to_camel_case(name: &str) -> String { - name.split('_') - .map(|s| { - if s.is_empty() { - String::new() - } else { - [&s[0..1].to_uppercase(), &s[1..]].concat() - } - }) - .collect() -} + dst.extend(["\ +#![warn(clippy::", name, ")] -fn get_test_file_contents(lint_name: &str, msrv: bool) -> String { - let mut test = formatdoc!( - r" - #![warn(clippy::{lint_name})] - - fn main() {{ - // test code goes here - }} - " - ); - - if msrv { - let _ = writedoc!( - test, - r#" - - // TODO: set xx to the version one below the MSRV used by the lint, and yy to - // the version used by the lint - #[clippy::msrv = "1.xx"] - fn msrv_1_xx() {{ - // a simple example that would trigger the lint if the MSRV were met - }} - - #[clippy::msrv = "1.yy"] - fn msrv_1_yy() {{ - // the same example as above - }} - "# - ); - } - - test +fn main() {{ + // TODO: fill in tests", msrv_contents, " +}} +"]); } -fn get_manifest_contents(lint_name: &str, hint: &str) -> String { - formatdoc!( - r#" - # {hint} +#[rustfmt::skip] +fn write_cargo_manifest(dst: &mut String, name: &str, todo: &str) { + dst.extend(["\ +[package] +name = \"", name, "\" +version = \"0.1.0\" +publish = false - [package] - name = "{lint_name}" - version = "0.1.0" - publish = false +[workspace] - [workspace] - "# - ) +# TODO: \n", todo, " +"]); } -fn get_lint_file_contents(lint: &LintData<'_>, enable_msrv: bool) -> String { - let mut result = String::new(); - - let (pass_type, pass_lifetimes, pass_import, context_import) = match lint.pass { - Pass::Early => ("EarlyLintPass", "", "use rustc_ast::ast::*;", "EarlyContext"), - Pass::Late => ("LateLintPass", "<'_>", "use rustc_hir::*;", "LateContext"), - }; - let (msrv_ty, extract_msrv) = match lint.pass { - Pass::Early => ("MsrvStack", "\n extract_msrv_attr!();\n"), - Pass::Late => ("Msrv", ""), +#[rustfmt::skip] +fn write_lint_file(dst: &mut String, lint: &ActiveLint<'_, '_>, pass: &LintPass<'_>, has_msrv: bool) { + let (pass_ty, pass_lt, cx_ty, msrv_ty, msrv_ctor, extract_msrv) = if pass.is_late { + ("LateLintPass", "<'_>", "LateContext", "Msrv", "conf.msrv.into()", "") + } else { + ("EarlyLintPass", "", "EarlyContext", "MsrvStack", "MsrvStack::new(conf.msrv)", "\n extract_msrv_attr!();") }; - - let lint_name = lint.name; - let category = lint.category; - let name_camel = to_camel_case(lint.name); - let name_upper = lint_name.to_uppercase(); - - if enable_msrv { - let _: fmt::Result = writedoc!( - result, - r" - use clippy_config::Conf; - use clippy_utils::msrvs::{{self, {msrv_ty}}}; - {pass_import} - use rustc_lint::{{{context_import}, {pass_type}}}; - use rustc_lint::impl_lint_pass; - - " - ); + let extract_msrv = if has_msrv { + dst.extend(["\ +use clippy::config::Conf; +use clippy_utils::msrvs::{self, ", msrv_ty, "}; +"]); + extract_msrv } else { - let _: fmt::Result = writedoc!( - result, - r" - {pass_import} - use rustc_lint::{{{context_import}, {pass_type}}}; - use rustc_lint::declare_lint_pass; - - " - ); - } - - let _: fmt::Result = writeln!( - result, - "{}", - get_lint_declaration(lint.clippy_version, &name_upper, category) - ); - - if enable_msrv { - let _: fmt::Result = writedoc!( - result, - r" - pub struct {name_camel} {{ - msrv: {msrv_ty}, - }} - - impl {name_camel} {{ - pub fn new(conf: &'static Conf) -> Self {{ - Self {{ msrv: conf.msrv.into() }} - }} - }} + "" + }; + let pass_mac = pass.mac.name(); + let pass_name = pass.name; - impl_lint_pass!({name_camel} => [{name_upper}]); + dst.extend(["use rustc_lint::{", cx_ty, ", ", pass_ty, ", ", pass_mac, "};\n\n"]); + lint.gen_mac(dst); + dst.push_str("\n\n"); + pass.gen_mac(dst); - impl {pass_type}{pass_lifetimes} for {name_camel} {{{extract_msrv}}} + if has_msrv { + dst.extend([" - // TODO: Add MSRV level to `clippy_utils/src/msrvs.rs` if needed. - // TODO: Update msrv config comment in `clippy_config/src/conf.rs` - " - ); - } else { - let _: fmt::Result = writedoc!( - result, - r" - declare_lint_pass!({name_camel} => [{name_upper}]); +pub struct", pass_name, "{ + msrv: ", msrv_ty, ", +} - impl {pass_type}{pass_lifetimes} for {name_camel} {{}} - " - ); +impl ", pass_name, "{ + pub fn new(conf: &'static Conf) -> Self { + Self { msrv: ", msrv_ctor, "} + } +}"]); } - result + dst.extend([" + +impl ", pass_ty, pass_lt, " for ", pass_name, "{ + // TODO: implement lint logic", extract_msrv, " +} +"]); } -fn get_lint_declaration(version: Version, name_upper: &str, category: &str) -> String { - let justification_heading = if category == "restriction" { - "Why restrict this?" - } else { - "Why is this bad?" +fn add_lint_pass( + src: &str, + dst: &mut String, + name_snake: &str, + name_pascal: &str, + new_pass: LintPassKind, + has_msrv: bool, +) { + let mod_pos = find_mod_decl_after(&mut Cursor::new(src), name_snake); + let (pre, src) = src.split_at(mod_pos.pos as usize); + dst.push_str(pre); + dst.extend(mod_pos.insertion_text(name_snake)); + + let comment = match new_pass { + LintPassKind::Early => "// add early passes here, used by `cargo dev new_lint`", + LintPassKind::Late => "// add late passes here, used by `cargo dev new_lint`", }; - formatdoc!( - r#" - declare_clippy_lint! {{ - /// ### What it does - /// - /// ### {justification_heading} - /// - /// ### Example - /// ```no_run - /// // example code where clippy issues a warning - /// ``` - /// Use instead: - /// ```no_run - /// // example code which does not raise clippy warning - /// ``` - #[clippy::version = "{}"] - pub {name_upper}, - {category}, - "default lint description" - }}"#, - version.rust_display(), - ) + let ctor_call = if has_msrv { "::new(conf)" } else { "" }; + let pos = src.find(comment).unwrap_or_else(|| panic!("failed to find: {comment}")); + let (start, end) = src.split_at(pos); + #[rustfmt::skip] + dst.extend([ + start, + name_pascal, ": ", name_snake, "::", name_pascal, " = ", + name_snake, "::", name_pascal, ctor_call, ",\n ", + end, + ]); } -fn create_lint_for_ty(lint: &LintData<'_>, enable_msrv: bool, ty: &str) { - match ty { - "cargo" => assert_eq!( - lint.category, "cargo", - "Lints of type `cargo` must have the `cargo` category" - ), - _ if lint.category == "cargo" => panic!("Lints of category `cargo` must have the `cargo` type"), - _ => {}, +struct ModPos { + pos: u32, + kind: PosKind, +} +enum PosKind { + /// The position is the end of all leading extern crate declarations and inner attributes/docs. + NewList, + /// The position is the start of the name of the module to insert before. + Name, + /// The position is the end of the module list after the final semicolon. + End, +} +impl ModPos { + fn new_list(pos: u32) -> Self { + Self { + pos, + kind: PosKind::NewList, + } } - let ty_dir = PathBuf::from(format!("clippy_lints/src/{ty}")); - assert!( - ty_dir.exists() && ty_dir.is_dir(), - "Directory `{}` does not exist!", - ty_dir.display() - ); - - let lint_file_path = ty_dir.join(format!("{}.rs", lint.name)); - assert!( - !lint_file_path.exists(), - "File `{}` already exists", - lint_file_path.display() - ); - - let mod_file_path = ty_dir.join("mod.rs"); - let context_import = setup_mod_file(&mod_file_path, lint); - let (pass_lifetimes, msrv_ty, msrv_ref, msrv_cx) = match context_import { - "LateContext" => ("<'_>", "Msrv", "", "cx, "), - _ => ("", "MsrvStack", "&", ""), - }; - - let name_upper = lint.name.to_uppercase(); - let mut lint_file_contents = String::new(); - - if enable_msrv { - let _: fmt::Result = writedoc!( - lint_file_contents, - r#" - use clippy_utils::msrvs::{{self, {msrv_ty}}}; - use rustc_lint::{{{context_import}, LintContext}}; - - use super::{name_upper}; - - // TODO: Adjust the parameters as necessary - pub(super) fn check(cx: &{context_import}{pass_lifetimes}, msrv: {msrv_ref}{msrv_ty}) {{ - if !msrv.meets({msrv_cx}todo!("Add a new entry in `clippy_utils/src/msrvs`")) {{ - return; - }} - todo!(); - }} - "# - ); - } else { - let _: fmt::Result = writedoc!( - lint_file_contents, - r" - use rustc_lint::{{{context_import}, LintContext}}; - - use super::{name_upper}; - - // TODO: Adjust the parameters as necessary - pub(super) fn check(cx: &{context_import}{pass_lifetimes}) {{ - todo!(); - }} - " - ); + fn insertion_text(self, mod_name: &str) -> [&str; 3] { + match self.kind { + PosKind::NewList if self.pos == 0 => ["mod ", mod_name, ";\n\n"], + PosKind::NewList => ["\n\nmod ", mod_name, ";"], + PosKind::Name => [mod_name, ";\nmod ", ""], + PosKind::End => ["\nmod ", mod_name, ";"], + } } - - File::create_new(&lint_file_path).write(lint_file_contents); - println!("Generated lint file: `clippy_lints/src/{ty}/{}.rs`", lint.name); - println!( - "Be sure to add a call to `{}::check` in `clippy_lints/src/{ty}/mod.rs`!", - lint.name - ); } -fn setup_mod_file(path: &Path, lint: &LintData<'_>) -> &'static str { - let lint_name_upper = lint.name.to_uppercase(); - - let mut file = File::open(path, OpenOptions::new().read(true).write(true)); - let mut file_contents = String::new(); - file.read_append_to_string(&mut file_contents); - - assert!( - !file_contents.contains(&format!("pub {lint_name_upper},")), - "Lint `{}` already defined in `{}`", - lint.name, - path.display() - ); - - let (lint_context, lint_decl_end) = parse_mod_file(path, &file_contents); - - // Add the lint declaration to `mod.rs` - file_contents.insert_str( - lint_decl_end, - &format!( - "\n\n{}", - get_lint_declaration(lint.clippy_version, &lint_name_upper, lint.category) - ), - ); - - // Add the lint to `impl_lint_pass`/`declare_lint_pass` - let impl_lint_pass_start = file_contents.find("impl_lint_pass!").unwrap_or_else(|| { - file_contents - .find("declare_lint_pass!") - .unwrap_or_else(|| panic!("failed to find `impl_lint_pass`/`declare_lint_pass`")) - }); - - let mut arr_start = file_contents[impl_lint_pass_start..].find('[').unwrap_or_else(|| { - panic!("malformed `impl_lint_pass`/`declare_lint_pass`"); - }); - - arr_start += impl_lint_pass_start; - - let mut arr_end = file_contents[arr_start..] - .find(']') - .expect("failed to find `impl_lint_pass` terminator"); - - arr_end += arr_start; - - let mut arr_content = file_contents[arr_start + 1..arr_end].to_string(); - arr_content.retain(|c| !c.is_whitespace()); - - let mut new_arr_content = String::new(); - for ident in arr_content - .split(',') - .chain(std::iter::once(&*lint_name_upper)) - .filter(|s| !s.is_empty()) - { - let _: fmt::Result = write!(new_arr_content, "\n {ident},"); +/// Copies the source text to the destination adding a module declaration if `add_mod` is true. +fn mk_sorted_lints_copy_fn(mut add_mod: bool, mod_name: &str) -> impl FnMut(&str, &mut String) { + move |src, dst| { + if add_mod { + add_mod = false; + let pos = find_mod_decl_after(&mut Cursor::new(src), mod_name); + let (pre, post) = src.split_at(pos.pos as usize); + dst.push_str(pre); + dst.extend(pos.insertion_text(mod_name)); + dst.push_str(post); + return; + } + dst.push_str(src); } - new_arr_content.push('\n'); - - file_contents.replace_range(arr_start + 1..arr_end, &new_arr_content); - - // Just add the mod declaration at the top, it'll be fixed by rustfmt - file_contents.insert_str(0, &format!("mod {};\n", lint.name)); - - file.replace_contents(file_contents); - lint_context } -// Find both the last lint declaration (declare_clippy_lint!) and the lint pass impl -fn parse_mod_file(path: &Path, contents: &str) -> (&'static str, usize) { - #[allow(clippy::enum_glob_use)] - use cursor::Pat::*; - - let mut context = None; - let mut decl_end = None; - let mut cursor = Cursor::new(contents); - let mut captures = [Capture::EMPTY]; - while let Some(name) = cursor.find_capture_ident() { - match cursor.get_text(name) { - "declare_clippy_lint" - if cursor.match_all(&[Bang, OpenBrace], &mut []).is_ok() && cursor.find_close_brace() => - { - decl_end = Some(cursor.pos()); +/// Gets the position to insert a pub module with the specified name. +fn find_mod_decl_after(cursor: &mut Cursor<'_>, mod_name: &str) -> ModPos { + let mut lead_end = 0; + let mut take_next_line_comment = true; + loop { + match cursor.peek() { + TokenKind::Whitespace if take_next_line_comment => { + take_next_line_comment = !cursor.peek_text().contains('\n'); + }, + TokenKind::LineComment { doc_style: None } if take_next_line_comment => { + take_next_line_comment = false; + lead_end = cursor.pos() + cursor.peek_len(); }, - "impl" - if cursor - .match_all(&[Lt, Lifetime, Gt, CaptureIdent], &mut captures) - .is_ok() => + TokenKind::LineComment { doc_style } | TokenKind::BlockComment { doc_style, .. } + if matches!(doc_style, Some(DocStyle::Inner)) => { - match cursor.get_text(captures[0]) { - "LateLintPass" => context = Some("LateContext"), - "EarlyLintPass" => context = Some("EarlyContext"), - _ => {}, + take_next_line_comment = false; + lead_end = cursor.pos() + cursor.peek_len(); + }, + TokenKind::Whitespace | TokenKind::LineComment { .. } | TokenKind::BlockComment { .. } => {}, + TokenKind::Pound => { + cursor.step(); + let is_inner = cursor.eat_bang(); + if !cursor.eat_open_bracket() { + return ModPos::new_list(lead_end); + } + cursor.eat_remaining_tt(); + if is_inner { + take_next_line_comment = true; + lead_end = cursor.pos(); + } else { + take_next_line_comment = false; } + continue; }, - _ => {}, + TokenKind::Ident => { + let ident = cursor.peek_text(); + cursor.step(); + match ident { + "extern" if cursor.eat_ident("crate") && cursor.capture_ident().is_some() && cursor.eat_semi() => { + take_next_line_comment = true; + lead_end = cursor.pos(); + }, + "mod" => break, + _ => return ModPos::new_list(lead_end), + } + continue; + }, + _ => return ModPos::new_list(lead_end), } + cursor.step(); } - ( - context.unwrap_or_else(|| panic!("No lint pass implementation found in `{}`", path.display())), - decl_end.unwrap_or_else(|| panic!("No lint declarations found in `{}`", path.display())) as usize, - ) -} - -#[test] -fn test_camel_case() { - let s = "a_lint"; - let s2 = to_camel_case(s); - assert_eq!(s2, "ALint"); - - let name = "a_really_long_new_lint"; - let name2 = to_camel_case(name); - assert_eq!(name2, "AReallyLongNewLint"); - - let name3 = "lint__name"; - let name4 = to_camel_case(name3); - assert_eq!(name4, "LintName"); + while let Some(name) = cursor.capture_ident() { + if !cursor.eat_semi() { + return ModPos::new_list(lead_end); + } + if cursor.get_text(name) > mod_name { + return ModPos { + pos: name.pos, + kind: PosKind::Name, + }; + } + let end = cursor.pos(); + if cursor.at_multi_line_break() || !cursor.eat_ident("mod") { + return ModPos { + pos: end, + kind: PosKind::End, + }; + } + } + ModPos::new_list(lead_end) } diff --git a/clippy_dev/src/parse.rs b/clippy_dev/src/parse.rs index a6c0972591b5..2de43f08ce7e 100644 --- a/clippy_dev/src/parse.rs +++ b/clippy_dev/src/parse.rs @@ -79,6 +79,7 @@ impl Display for LintName<'_> { } } +#[derive(Clone, Copy)] pub struct ActiveLintData<'cx> { pub decl_range: Range, /// The raw text of the documentation comments. May include leading/trailing @@ -95,26 +96,31 @@ pub struct ActiveLintData<'cx> { pub opts: &'cx str, } +#[derive(Clone, Copy)] pub struct DeprecatedLintData<'cx> { pub reason: &'cx str, } +#[derive(Clone, Copy)] pub struct RenamedLintData<'cx> { pub new_name: LintName<'cx>, } +#[derive(Clone, Copy)] pub enum LintData<'cx> { Active(ActiveLintData<'cx>), Deprecated(DeprecatedLintData<'cx>), Renamed(RenamedLintData<'cx>), } +#[derive(Clone, Copy)] pub struct ActiveLint<'a, 'cx> { pub name: &'cx str, pub version: &'cx str, pub data: &'a ActiveLintData<'cx>, } +#[derive(Clone, Copy)] pub struct Lint<'cx> { pub name_sp: Span<'cx>, pub version: &'cx str, @@ -135,6 +141,21 @@ impl LintPassMac { } } +#[derive(Clone, Copy)] +enum ImplTrait { + EarlyLintPass, + LateLintPass, +} +impl ImplTrait { + fn from_str(s: &str) -> Option { + match s { + "EarlyLintPass" => Some(Self::EarlyLintPass), + "LateLintPass" => Some(Self::LateLintPass), + _ => None, + } + } +} + pub struct LintPass<'cx> { /// The raw text of the documentation comments. May include leading/trailing /// whitespace and empty lines. @@ -144,6 +165,16 @@ pub struct LintPass<'cx> { pub mac: LintPassMac, pub decl_sp: Span<'cx>, pub lints: &'cx mut [&'cx str], + pub is_early: bool, + pub is_late: bool, +} +impl LintPass<'_> { + fn add_trait_impl(&mut self, kind: ImplTrait) { + match kind { + ImplTrait::EarlyLintPass => self.is_early = true, + ImplTrait::LateLintPass => self.is_late = true, + } + } } pub struct LintMap<'cx>(FxHashMap<&'cx str, Lint<'cx>>); @@ -167,6 +198,22 @@ impl<'cx> LintMap<'cx> { lints } + pub fn lints_in_file<'s>(&'s self, file: &SourceFile<'_>) -> impl Iterator> { + self.iter().filter_map(move |(&name, lint)| { + if let LintData::Active(data) = &lint.data + && lint.name_sp.file == file + { + Some(ActiveLint { + name, + version: lint.version, + data, + }) + } else { + None + } + }) + } + #[track_caller] fn get_vacant_lint<'s>( &'s mut self, @@ -202,11 +249,23 @@ impl<'cx> LintPasses<'cx> { tail.iter().take_while(|&x| x.decl_sp.file == head.decl_sp.file).count() }) } + + pub fn in_same_file_as_mut<'s>(&'s mut self, i: usize) -> &'s mut [LintPass<'cx>] { + let file = self[i].decl_sp.file; + let pre = self[..i].iter().rev().take_while(|&x| x.decl_sp.file == file).count(); + let post = self[i + 1..].iter().take_while(|&x| x.decl_sp.file == file).count(); + &mut self[i - pre..i + 1 + post] + } } impl<'cx> Deref for LintPasses<'cx> { - type Target = [LintPass<'cx>]; + type Target = Vec>; fn deref(&self) -> &Self::Target { - self.0.deref() + &self.0 + } +} +impl DerefMut for LintPasses<'_> { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } @@ -377,18 +436,19 @@ impl<'cx> ParseCxImpl<'cx> { } /// Parse a source file looking for `declare_clippy_lint` macro invocations. + #[expect(clippy::too_many_lines)] fn parse_lint_src_file(&mut self, data: &mut ParsedLints<'cx>, file: &'cx SourceFile<'cx>) { #[allow(clippy::enum_glob_use)] use cursor::Pat::*; let mut cursor = Cursor::new(&file.contents); let mut captures = [Capture::EMPTY; 6]; + let mut trait_impls = Vec::new(); + let first_lint_pass = data.lint_passes.len(); + while let Some(mac_name) = cursor.find_capture_ident() { - if !cursor.eat_bang() { - continue; - } match cursor.get_text(mac_name) { - "declare_clippy_lint" => { + "declare_clippy_lint" if cursor.eat_bang() => { #[rustfmt::skip] static DECL_START: &[cursor::Pat] = &[ // { /// docs @@ -442,7 +502,7 @@ impl<'cx> ParseCxImpl<'cx> { }); } }, - mac @ ("declare_lint_pass" | "impl_lint_pass") => { + mac @ ("declare_lint_pass" | "impl_lint_pass") if cursor.eat_bang() => { let mut has_lt = false; let mut lints: &mut [_] = &mut []; if let Err(expected) = cursor @@ -464,7 +524,7 @@ impl<'cx> ParseCxImpl<'cx> { { cursor.emit_unexpected(&mut self.dcx, file, expected); } else { - data.lint_passes.0.push(LintPass { + data.lint_passes.push(LintPass { docs: cursor.get_text(captures[0]), name: cursor.get_text(captures[1]), lt: has_lt.then(|| cursor.get_text(captures[2])), @@ -475,12 +535,42 @@ impl<'cx> ParseCxImpl<'cx> { }, decl_sp: Span::new(file, mac_name.pos..cursor.pos()), lints, + is_early: false, + is_late: false, }); } }, + "impl" + if cursor.opt_match_all(&[Lt, Lifetime, Gt], &mut []).is_ok() + && let Some(trait_) = cursor.capture_ident() + && let Some(trait_) = ImplTrait::from_str(cursor.get_text(trait_)) + && cursor.opt_match_all(&[Lt, Lifetime, Gt], &mut []).is_ok() + && cursor + .match_all(&[Ident(IdentPat::r#for), CaptureIdent], &mut captures) + .is_ok() => + { + let impl_ty = cursor.get_text(captures[0]); + if let Some(pass) = data.lint_passes[first_lint_pass..] + .iter_mut() + .find(|pass| pass.name == impl_ty) + { + pass.add_trait_impl(trait_); + } else { + trait_impls.push((impl_ty, trait_)); + } + }, _ => {}, } } + + for &(impl_ty, trait_) in &trait_impls { + if let Some(pass) = data.lint_passes[first_lint_pass..] + .iter_mut() + .find(|pass| pass.name == impl_ty) + { + pass.add_trait_impl(trait_); + } + } } fn parse_deprecated_lints(&mut self, data: &mut ParsedLints<'cx>) { diff --git a/clippy_dev/src/parse/cursor.rs b/clippy_dev/src/parse/cursor.rs index 18a90fbd8f21..490d1dbe4e42 100644 --- a/clippy_dev/src/parse/cursor.rs +++ b/clippy_dev/src/parse/cursor.rs @@ -2,7 +2,7 @@ use crate::utils::{StrBuf, VecBuf}; use crate::{DiagCx, SourceFile, Span}; use core::{ptr, slice}; use rustc_arena::DroplessArena; -use rustc_lexer::{self as lex, DocStyle, LiteralKind, Token, TokenKind}; +use rustc_lexer::{self as lex, DocStyle, LiteralKind, Token, TokenKind, is_whitespace}; /// A token pattern used for searching and matching by the [`Cursor`]. /// @@ -99,6 +99,7 @@ decl_ident_pats! { RENAMED, RENAMED_VERSION, clippy, + r#for = "for", r#pub = "pub", version, } @@ -171,6 +172,17 @@ impl<'txt> Cursor<'txt> { self.pos } + /// Checks whether the current token is a whitespace token with multiple line breaks. + #[must_use] + pub fn at_multi_line_break(&self) -> bool { + let is_whitespace = |c| is_whitespace(c) && c != '\n'; + + self.peek_text() + .trim_start_matches(is_whitespace) + .strip_prefix('\n') + .is_some_and(|s| s.trim_start_matches(is_whitespace).starts_with('\n')) + } + /// Advances the cursor to the next token. If the stream is exhausted this will set /// the next token to [`TokenKind::Eof`]. pub fn step(&mut self) { diff --git a/clippy_dev/src/utils.rs b/clippy_dev/src/utils.rs index 2aaaa190ecf6..9f59a0a9fdc9 100644 --- a/clippy_dev/src/utils.rs +++ b/clippy_dev/src/utils.rs @@ -107,9 +107,21 @@ impl<'a> File<'a> { Self::open(path, OpenOptions::new().read(true)) } + /// Opens a file for reading and writing, panicking of failure. + #[track_caller] + pub fn open_rw(path: &'a (impl AsRef + ?Sized)) -> Self { + Self::open(path, OpenOptions::new().read(true).write(true)) + } + + /// Truncates and opens a file for writing, panicking of failure. + #[track_caller] + pub fn open_truncated(path: &'a (impl AsRef + ?Sized)) -> Self { + Self::open(path, OpenOptions::new().truncate(true).write(true)) + } + /// Creates a new file with the specified contents, panicking on failure. #[track_caller] - pub fn create_new(path: &'a impl AsRef) -> Self { + pub fn create_new(path: &'a (impl AsRef + ?Sized)) -> Self { let path = path.as_ref(); Self { inner: expect_action( @@ -335,11 +347,6 @@ impl UpdateStatus { pub fn from_changed(value: bool) -> Self { if value { Self::Changed } else { Self::Unchanged } } - - #[must_use] - pub fn is_changed(self) -> bool { - matches!(self, Self::Changed) - } } #[derive(Clone, Copy)] @@ -373,7 +380,7 @@ impl FileUpdater { path: &Path, update: &mut dyn FnMut(&Path, &str, &mut String) -> UpdateStatus, ) { - let mut file = File::open(path, OpenOptions::new().read(true).write(true)); + let mut file = File::open_rw(path); file.read_to_cleared_string(&mut self.src_buf); self.dst_buf.clear(); match (mode, update(path, &self.src_buf, &mut self.dst_buf)) { @@ -410,23 +417,12 @@ impl FileUpdater { process::exit(1); }, (UpdateMode::Change, UpdateStatus::Changed) => { - File::open(file.path.get(), OpenOptions::new().truncate(true).write(true)) - .write(self.dst_buf.as_bytes()); + File::open_truncated(file.path.get()).write(self.dst_buf.as_bytes()); }, (UpdateMode::Check | UpdateMode::Change, UpdateStatus::Unchanged) => {}, } } - #[track_caller] - fn update_file_inner(&mut self, path: &Path, update: &mut dyn FnMut(&Path, &str, &mut String) -> UpdateStatus) { - let mut file = File::open(path, OpenOptions::new().read(true).write(true)); - file.read_to_cleared_string(&mut self.src_buf); - self.dst_buf.clear(); - if update(path, &self.src_buf, &mut self.dst_buf).is_changed() { - file.replace_contents(self.dst_buf.as_bytes()); - } - } - #[track_caller] pub fn update_file_checked( &mut self, @@ -444,7 +440,30 @@ impl FileUpdater { path: impl AsRef, update: &mut dyn FnMut(&Path, &str, &mut String) -> UpdateStatus, ) { - self.update_file_inner(path.as_ref(), update); + self.update_file_checked_inner("", UpdateMode::Change, path.as_ref(), update); + } + + #[track_caller] + pub fn write_new_file(&mut self, path: impl AsRef, f: impl FnOnce(&mut String)) { + self.dst_buf.clear(); + f(&mut self.dst_buf); + File::create_new(path.as_ref()).write(&self.dst_buf); + } + + #[track_caller] + pub fn change_file(&mut self, path: impl AsRef, f: impl FnOnce(&str, &mut String)) { + let mut file = File::open_rw(path.as_ref()); + file.read_to_cleared_string(&mut self.src_buf); + self.dst_buf.clear(); + f(&self.src_buf, &mut self.dst_buf); + file.replace_contents(&self.dst_buf); + } + + #[track_caller] + pub fn change_loaded_file(&mut self, file: &SourceFile<'_>, f: impl FnOnce(&str, &mut String)) { + self.dst_buf.clear(); + f(&file.contents, &mut self.dst_buf); + File::open_truncated(file.path.get()).write(&self.dst_buf); } } @@ -759,6 +778,46 @@ impl StrBuf { } } + /// Allocates the string onto the arena with all ascii characters converted to + /// uppercase. + pub fn alloc_ascii_upper<'cx>(&mut self, arena: &'cx DroplessArena, s: &str) -> &'cx str { + self.0.clear(); + self.0.push_str(s); + self.0.make_ascii_uppercase(); + if self.0.is_empty() { + "" + } else { + arena.alloc_str(&self.0) + } + } + + /// Allocates the string onto the arena after converting the kebab-cased identifier + /// to pascal casing. + pub fn alloc_kebab_to_pascal<'cx>(&mut self, arena: &'cx DroplessArena, s: &str) -> &'cx str { + self.0.clear(); + let mut first = true; + for c in s.chars() { + if c == '-' { + first = true; + } else if first { + self.0.push(c.to_ascii_uppercase()); + first = false; + } else { + self.0.push(c); + } + } + if self.0.is_empty() { + "" + } else { + arena.alloc_str(&self.0) + } + } + + /// Allocates the string onto the arena after converting the kebab-cased identifier + /// to snake casing. + pub fn alloc_kebab_to_snake<'cx>(&mut self, arena: &'cx DroplessArena, s: &str) -> &'cx str { + self.alloc_replaced(arena, s, '-', "_") + } /// Collects all elements into the buffer and allocates that onto the arena. pub fn alloc_collect<'cx, I>(&mut self, arena: &'cx DroplessArena, iter: I) -> &'cx str where @@ -829,11 +888,20 @@ pub struct SourceFile<'cx> { pub contents: String, } impl<'cx> SourceFile<'cx> { + #[must_use] + pub fn new_empty(path: &'cx str) -> Self { + Self { + path: Cell::new(path), + line_starts: OnceCell::new(), + contents: String::new(), + } + } + #[must_use] pub fn load(path: &'cx str) -> Self { let mut contents = String::new(); File::open_read(path).read_append_to_string(&mut contents); - SourceFile { + Self { path: Cell::new(path), line_starts: OnceCell::new(), contents, diff --git a/tests/lint-attributes-organization.rs b/tests/lint-attributes-organization.rs index 80c1fa2a0a46..0c6ce9e595ac 100644 --- a/tests/lint-attributes-organization.rs +++ b/tests/lint-attributes-organization.rs @@ -22,14 +22,15 @@ use walkdir::{DirEntry, WalkDir}; mod test_utils; -const SKIPPED_FILES: [&str; 7] = [ - "./tests/lint-attributes-organization.rs", // this file, for the sanity checks +const SKIPPED_FILES: [&str; 8] = [ + "./clippy_dev/src/new_lint.rs", // regex can't parse the file correctly + "./tests/lint-attributes-organization.rs", // this file, for the sanity checks "./tests/ui/blanket_clippy_restriction_lints.rs", // separate lines are better - "./tests/ui/deprecated.rs", // generated - "./tests/ui/duplicated_attributes.rs", // obviously - "./tests/ui/rename.rs", // generated - "./tests/ui/unknown_clippy_lints.rs", // separate lines are better - "./target/", // generated files + "./tests/ui/deprecated.rs", // generated + "./tests/ui/duplicated_attributes.rs", // obviously + "./tests/ui/rename.rs", // generated + "./tests/ui/unknown_clippy_lints.rs", // separate lines are better + "./target/", // generated files ]; #[test] From 4470805d7af7181953b9db7518df24dab7485774 Mon Sep 17 00:00:00 2001 From: Jason Newcomb Date: Fri, 28 Aug 2026 10:07:34 -0400 Subject: [PATCH 06/14] `clippy_dev`: Don't edit the module list `clippy_lints/src/lib.rs` during `update_lints` --- clippy_dev/src/generate.rs | 19 ------------------- clippy_lints/src/lib.rs | 2 -- clippy_lints/src/misc.rs | 2 +- 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/clippy_dev/src/generate.rs b/clippy_dev/src/generate.rs index cd77283e1e3f..99bd9644bcab 100644 --- a/clippy_dev/src/generate.rs +++ b/clippy_dev/src/generate.rs @@ -140,25 +140,6 @@ impl ParsedLints<'_> { tail.iter().take_while(|(_, (x, _))| head == x).count() }) { let (_, (krate, _)) = lints[0]; - updater.update_file_checked( - "cargo dev update_lints", - update_mode, - Path::new(krate).join("src/lib.rs"), - &mut update_text_region_fn( - "// begin lints modules, do not remove this comment, it's used in `update_lints`\n", - "// end lints modules, do not remove this comment, it's used in `update_lints`", - |dst| { - let mut prev = ""; - for &(_, (_, mod_path)) in lints { - let module = mod_path.split_once(path::MAIN_SEPARATOR).map_or(mod_path, |(x, _)| x); - if module != prev { - writeln!(dst, "mod {module};").unwrap(); - prev = module; - } - } - }, - ), - ); updater.update_file_checked( "cargo dev update_lints", update_mode, diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index f5ce2cc49641..916e1328e496 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -50,7 +50,6 @@ extern crate clippy_utils; #[macro_use] extern crate declare_clippy_lint; -// begin lints modules, do not remove this comment, it's used in `update_lints` mod absolute_paths; mod almost_complete_range; mod approx_const; @@ -405,7 +404,6 @@ mod zero_div_zero; mod zero_repeat_side_effects; mod zero_sized_map_values; mod zombie_processes; -// end lints modules, do not remove this comment, it's used in `update_lints` mod combined_early_pass; mod combined_late_pass; diff --git a/clippy_lints/src/misc.rs b/clippy_lints/src/misc.rs index ddc61b244982..549628318ebb 100644 --- a/clippy_lints/src/misc.rs +++ b/clippy_lints/src/misc.rs @@ -152,7 +152,7 @@ impl Id<'_> { } fn get_local_def(self, cx: &LateContext<'_>, e: &Expr<'_>, name: Symbol) -> Option<(HirId, Span)> { - let id = match self { + let id: LocalDefId = match self { Self::Binding(id) if let Node::Pat(p) = cx.tcx.hir_node(id) => return Some((id, p.span)), Self::LocalDef(id) => id, Self::TyRel => cx.typeck_results().type_dependent_def_id(e.hir_id)?.as_local()?, From 02d8a52505636eb61580fa45d78fe630f55610a2 Mon Sep 17 00:00:00 2001 From: Jason Newcomb Date: Sat, 29 Aug 2026 10:38:07 -0400 Subject: [PATCH 07/14] Make all lint module lists public --- clippy_dev/src/edit_lints.rs | 10 - clippy_dev/src/new_lint.rs | 12 +- clippy_lints/src/attrs/mod.rs | 27 +- clippy_lints/src/await_holding_invalid.rs | 2 +- clippy_lints/src/cargo/mod.rs | 10 +- clippy_lints/src/casts/mod.rs | 55 +- clippy_lints/src/derive/mod.rs | 10 +- .../doc/doc_paragraphs_missing_punctuation.rs | 2 +- .../src/doc/doc_suspicious_footnotes.rs | 8 +- clippy_lints/src/doc/link_with_quotes.rs | 2 +- clippy_lints/src/doc/markdown.rs | 2 +- clippy_lints/src/doc/missing_headers.rs | 2 +- clippy_lints/src/doc/mod.rs | 26 +- clippy_lints/src/doc/needless_doctest_main.rs | 2 +- clippy_lints/src/doc/test_attr_in_doctest.rs | 2 +- clippy_lints/src/empty_line_after.rs | 7 +- .../src/floating_point_arithmetic/mod.rs | 22 +- clippy_lints/src/functions/mod.rs | 20 +- clippy_lints/src/ifs/mod.rs | 8 +- clippy_lints/src/lib.rs | 710 +++++++++--------- clippy_lints/src/loops/mod.rs | 51 +- clippy_lints/src/matches/mod.rs | 51 +- clippy_lints/src/methods/mod.rs | 309 ++++---- clippy_lints/src/misc_early/mod.rs | 16 +- clippy_lints/src/operators/mod.rs | 59 +- clippy_lints/src/ptr/mod.rs | 8 +- clippy_lints/src/returns/mod.rs | 6 +- clippy_lints/src/transmute/mod.rs | 31 +- clippy_lints/src/types/mod.rs | 21 +- clippy_lints/src/unit_types/mod.rs | 7 +- clippy_lints/src/write/mod.rs | 8 +- 31 files changed, 751 insertions(+), 755 deletions(-) diff --git a/clippy_dev/src/edit_lints.rs b/clippy_dev/src/edit_lints.rs index 36eccdd756e1..057da10de628 100644 --- a/clippy_dev/src/edit_lints.rs +++ b/clippy_dev/src/edit_lints.rs @@ -348,16 +348,6 @@ fn uplift_update_fn<'a>( let mut cursor = Cursor::new(src); while let Some(ident) = cursor.find_capture_ident() { match cursor.get_text(ident) { - "mod" if remove_mod && cursor.eat_ident(old_name) && cursor.eat_semi() => { - dst.push_str(&src[copy_pos as usize..ident.pos as usize]); - dst.push_str(new_name); - copy_pos = cursor.pos(); - if src[copy_pos as usize..].starts_with('\n') { - copy_pos += 1; - } - changed = true; - remove_mod = false; - }, "pub" if remove_mod && cursor.eat_ident("mod") && cursor.eat_ident(old_name) && cursor.eat_semi() => { dst.push_str(&src[copy_pos as usize..ident.pos as usize]); dst.push_str(new_name); diff --git a/clippy_dev/src/new_lint.rs b/clippy_dev/src/new_lint.rs index 8d1da74564aa..467acbb22bc2 100644 --- a/clippy_dev/src/new_lint.rs +++ b/clippy_dev/src/new_lint.rs @@ -377,10 +377,10 @@ impl ModPos { fn insertion_text(self, mod_name: &str) -> [&str; 3] { match self.kind { - PosKind::NewList if self.pos == 0 => ["mod ", mod_name, ";\n\n"], - PosKind::NewList => ["\n\nmod ", mod_name, ";"], - PosKind::Name => [mod_name, ";\nmod ", ""], - PosKind::End => ["\nmod ", mod_name, ";"], + PosKind::NewList if self.pos == 0 => ["pub mod ", mod_name, ";\n\n"], + PosKind::NewList => ["\n\npub mod ", mod_name, ";"], + PosKind::Name => [mod_name, ";\npub mod ", ""], + PosKind::End => ["\npub mod ", mod_name, ";"], } } } @@ -444,7 +444,7 @@ fn find_mod_decl_after(cursor: &mut Cursor<'_>, mod_name: &str) -> ModPos { take_next_line_comment = true; lead_end = cursor.pos(); }, - "mod" => break, + "pub" if cursor.eat_ident("mod") => break, _ => return ModPos::new_list(lead_end), } continue; @@ -465,7 +465,7 @@ fn find_mod_decl_after(cursor: &mut Cursor<'_>, mod_name: &str) -> ModPos { }; } let end = cursor.pos(); - if cursor.at_multi_line_break() || !cursor.eat_ident("mod") { + if cursor.at_multi_line_break() || !cursor.eat_ident("pub") || !cursor.eat_ident("mod") { return ModPos { pos: end, kind: PosKind::End, diff --git a/clippy_lints/src/attrs/mod.rs b/clippy_lints/src/attrs/mod.rs index 23d5adfb201a..059ae2f63285 100644 --- a/clippy_lints/src/attrs/mod.rs +++ b/clippy_lints/src/attrs/mod.rs @@ -1,16 +1,17 @@ -mod allow_attributes; -mod allow_attributes_without_reason; -mod blanket_clippy_restriction_lints; -mod deprecated_cfg_attr; -mod deprecated_semver; -mod duplicated_attributes; -mod inline_always; -mod mixed_attributes_style; -mod non_minimal_cfg; -mod repr_attributes; -mod should_panic_without_expect; -mod unnecessary_clippy_cfg; -mod useless_attribute; +pub mod allow_attributes; +pub mod allow_attributes_without_reason; +pub mod blanket_clippy_restriction_lints; +pub mod deprecated_cfg_attr; +pub mod deprecated_semver; +pub mod duplicated_attributes; +pub mod inline_always; +pub mod mixed_attributes_style; +pub mod non_minimal_cfg; +pub mod repr_attributes; +pub mod should_panic_without_expect; +pub mod unnecessary_clippy_cfg; +pub mod useless_attribute; + mod utils; use clippy_config::Conf; diff --git a/clippy_lints/src/await_holding_invalid.rs b/clippy_lints/src/await_holding_invalid.rs index fdab7704f381..088f02bb3cf5 100644 --- a/clippy_lints/src/await_holding_invalid.rs +++ b/clippy_lints/src/await_holding_invalid.rs @@ -182,7 +182,7 @@ pub struct AwaitHolding { } impl AwaitHolding { - pub(crate) fn new(tcx: TyCtxt<'_>, conf: &'static Conf) -> Self { + pub fn new(tcx: TyCtxt<'_>, conf: &'static Conf) -> Self { let (def_ids, _) = create_disallowed_map( tcx, &conf.await_holding_invalid_types, diff --git a/clippy_lints/src/cargo/mod.rs b/clippy_lints/src/cargo/mod.rs index 245d33e6b5a9..d1212d16d451 100644 --- a/clippy_lints/src/cargo/mod.rs +++ b/clippy_lints/src/cargo/mod.rs @@ -1,8 +1,8 @@ -mod common_metadata; -mod feature_name; -mod lint_groups_priority; -mod multiple_crate_versions; -mod wildcard_dependencies; +pub mod common_metadata; +pub mod feature_name; +pub mod lint_groups_priority; +pub mod multiple_crate_versions; +pub mod wildcard_dependencies; use cargo_metadata::MetadataCommand; use clippy_config::Conf; diff --git a/clippy_lints/src/casts/mod.rs b/clippy_lints/src/casts/mod.rs index 35806284d3b3..251822782586 100644 --- a/clippy_lints/src/casts/mod.rs +++ b/clippy_lints/src/casts/mod.rs @@ -1,31 +1,32 @@ -mod as_pointer_underscore; -mod as_ptr_cast_mut; -mod as_underscore; -mod borrow_as_ptr; -mod cast_abs_to_unsigned; -mod cast_enum_constructor; -mod cast_lossless; -mod cast_nan_to_int; -mod cast_possible_truncation; -mod cast_possible_wrap; -mod cast_precision_loss; -mod cast_ptr_alignment; -mod cast_sign_loss; -mod cast_slice_different_sizes; -mod cast_slice_from_raw_parts; -mod char_lit_as_u8; -mod confusing_method_to_numeric_cast; -mod fn_to_numeric_cast; -mod fn_to_numeric_cast_any; -mod fn_to_numeric_cast_with_truncation; -mod manual_dangling_ptr; -mod needless_type_cast; -mod ptr_as_ptr; -mod ptr_cast_constness; -mod ref_as_ptr; -mod unnecessary_cast; +pub mod as_pointer_underscore; +pub mod as_ptr_cast_mut; +pub mod as_underscore; +pub mod borrow_as_ptr; +pub mod cast_abs_to_unsigned; +pub mod cast_enum_constructor; +pub mod cast_lossless; +pub mod cast_nan_to_int; +pub mod cast_possible_truncation; +pub mod cast_possible_wrap; +pub mod cast_precision_loss; +pub mod cast_ptr_alignment; +pub mod cast_sign_loss; +pub mod cast_slice_different_sizes; +pub mod cast_slice_from_raw_parts; +pub mod char_lit_as_u8; +pub mod confusing_method_to_numeric_cast; +pub mod fn_to_numeric_cast; +pub mod fn_to_numeric_cast_any; +pub mod fn_to_numeric_cast_with_truncation; +pub mod manual_dangling_ptr; +pub mod needless_type_cast; +pub mod ptr_as_ptr; +pub mod ptr_cast_constness; +pub mod ref_as_ptr; +pub mod unnecessary_cast; +pub mod zero_ptr; + mod utils; -mod zero_ptr; use clippy_config::Conf; use clippy_utils::is_hir_ty_cfg_dependant; diff --git a/clippy_lints/src/derive/mod.rs b/clippy_lints/src/derive/mod.rs index 72e8c8030287..a0c26377d609 100644 --- a/clippy_lints/src/derive/mod.rs +++ b/clippy_lints/src/derive/mod.rs @@ -1,8 +1,8 @@ -mod derive_ord_xor_partial_ord; -mod derive_partial_eq_without_eq; -mod derived_hash_with_manual_eq; -mod expl_impl_clone_on_copy; -mod unsafe_derive_deserialize; +pub mod derive_ord_xor_partial_ord; +pub mod derive_partial_eq_without_eq; +pub mod derived_hash_with_manual_eq; +pub mod expl_impl_clone_on_copy; +pub mod unsafe_derive_deserialize; use clippy_utils::res::MaybeResPath as _; use rustc_hir::def::Res; diff --git a/clippy_lints/src/doc/doc_paragraphs_missing_punctuation.rs b/clippy_lints/src/doc/doc_paragraphs_missing_punctuation.rs index 85772303d743..a99e01acd2e8 100644 --- a/clippy_lints/src/doc/doc_paragraphs_missing_punctuation.rs +++ b/clippy_lints/src/doc/doc_paragraphs_missing_punctuation.rs @@ -9,7 +9,7 @@ use super::{DOC_PARAGRAPHS_MISSING_PUNCTUATION, Fragments}; const MSG: &str = "doc paragraphs should end with a terminal punctuation mark"; const PUNCTUATION_SUGGESTION: char = '.'; -pub fn check(cx: &LateContext<'_>, doc: &str, fragments: Fragments<'_>) { +pub(super) fn check(cx: &LateContext<'_>, doc: &str, fragments: Fragments<'_>) { for missing_punctuation in is_missing_punctuation(doc) { match missing_punctuation { MissingPunctuation::Fixable(offset) => { diff --git a/clippy_lints/src/doc/doc_suspicious_footnotes.rs b/clippy_lints/src/doc/doc_suspicious_footnotes.rs index 39e53dbedb58..171b08391ccc 100644 --- a/clippy_lints/src/doc/doc_suspicious_footnotes.rs +++ b/clippy_lints/src/doc/doc_suspicious_footnotes.rs @@ -10,7 +10,13 @@ use std::ops::Range; use super::{DOC_SUSPICIOUS_FOOTNOTES, Fragments}; -pub fn check(cx: &LateContext<'_>, doc: &str, range: Range, fragments: &Fragments<'_>, attrs: &[Attribute]) { +pub(super) fn check( + cx: &LateContext<'_>, + doc: &str, + range: Range, + fragments: &Fragments<'_>, + attrs: &[Attribute], +) { for i in doc[range.clone()] .bytes() .enumerate() diff --git a/clippy_lints/src/doc/link_with_quotes.rs b/clippy_lints/src/doc/link_with_quotes.rs index 1d4345e4541d..82d6261d0f52 100644 --- a/clippy_lints/src/doc/link_with_quotes.rs +++ b/clippy_lints/src/doc/link_with_quotes.rs @@ -5,7 +5,7 @@ use rustc_lint::LateContext; use super::{DOC_LINK_WITH_QUOTES, Fragments}; -pub fn check(cx: &LateContext<'_>, trimmed_text: &str, range: Range, fragments: Fragments<'_>) { +pub(super) fn check(cx: &LateContext<'_>, trimmed_text: &str, range: Range, fragments: Fragments<'_>) { if ((trimmed_text.starts_with('\'') && trimmed_text.ends_with('\'')) || (trimmed_text.starts_with('"') && trimmed_text.ends_with('"'))) && let Some(span) = fragments.span(cx, range) diff --git a/clippy_lints/src/doc/markdown.rs b/clippy_lints/src/doc/markdown.rs index 1969ae5ef6d5..e7d57e5365bf 100644 --- a/clippy_lints/src/doc/markdown.rs +++ b/clippy_lints/src/doc/markdown.rs @@ -9,7 +9,7 @@ use url::Url; use crate::doc::{DOC_MARKDOWN, Fragments}; use std::ops::Range; -pub fn check( +pub(super) fn check( cx: &LateContext<'_>, valid_idents: &FxHashSet, text: &str, diff --git a/clippy_lints/src/doc/missing_headers.rs b/clippy_lints/src/doc/missing_headers.rs index 5a69a5e0d2e8..ca773f206871 100644 --- a/clippy_lints/src/doc/missing_headers.rs +++ b/clippy_lints/src/doc/missing_headers.rs @@ -11,7 +11,7 @@ use rustc_middle::ty; use rustc_span::{Span, sym}; use std::ops::ControlFlow; -pub fn check( +pub(super) fn check( cx: &LateContext<'_>, owner_id: OwnerId, sig: FnSig<'_>, diff --git a/clippy_lints/src/doc/mod.rs b/clippy_lints/src/doc/mod.rs index b51787f80175..77290c9ada97 100644 --- a/clippy_lints/src/doc/mod.rs +++ b/clippy_lints/src/doc/mod.rs @@ -1,16 +1,16 @@ -mod broken_link; -mod doc_comment_double_space_linebreaks; -mod doc_paragraphs_missing_punctuation; -mod doc_suspicious_footnotes; -mod include_in_doc_without_cfg; -mod lazy_continuation; -mod link_with_quotes; -mod markdown; -mod missing_headers; -mod needless_doctest_main; -mod suspicious_doc_comments; -mod test_attr_in_doctest; -mod too_long_first_doc_paragraph; +pub mod broken_link; +pub mod doc_comment_double_space_linebreaks; +pub mod doc_paragraphs_missing_punctuation; +pub mod doc_suspicious_footnotes; +pub mod include_in_doc_without_cfg; +pub mod lazy_continuation; +pub mod link_with_quotes; +pub mod markdown; +pub mod missing_headers; +pub mod needless_doctest_main; +pub mod suspicious_doc_comments; +pub mod test_attr_in_doctest; +pub mod too_long_first_doc_paragraph; use clippy_config::Conf; use clippy_utils::attrs::is_doc_hidden; diff --git a/clippy_lints/src/doc/needless_doctest_main.rs b/clippy_lints/src/doc/needless_doctest_main.rs index a09e4f7c3251..dec6bd229c76 100644 --- a/clippy_lints/src/doc/needless_doctest_main.rs +++ b/clippy_lints/src/doc/needless_doctest_main.rs @@ -23,7 +23,7 @@ fn returns_unit<'a>(mut tokens: impl Iterator, text: &str, offset: usize, fragments: Fragments<'_>) { +pub(super) fn check(cx: &LateContext<'_>, text: &str, offset: usize, fragments: Fragments<'_>) { if !text.contains("main") { return; } diff --git a/clippy_lints/src/doc/test_attr_in_doctest.rs b/clippy_lints/src/doc/test_attr_in_doctest.rs index 65738434ac28..8cde0c60f1fa 100644 --- a/clippy_lints/src/doc/test_attr_in_doctest.rs +++ b/clippy_lints/src/doc/test_attr_in_doctest.rs @@ -5,7 +5,7 @@ use clippy_utils::tokenize_with_text; use rustc_lexer::TokenKind; use rustc_lint::LateContext; -pub fn check(cx: &LateContext<'_>, text: &str, offset: usize, fragments: Fragments<'_>) { +pub(super) fn check(cx: &LateContext<'_>, text: &str, offset: usize, fragments: Fragments<'_>) { if !text.contains("#[test]") { return; } diff --git a/clippy_lints/src/empty_line_after.rs b/clippy_lints/src/empty_line_after.rs index aa5b8ec2f727..280f9b5a0dfe 100644 --- a/clippy_lints/src/empty_line_after.rs +++ b/clippy_lints/src/empty_line_after.rs @@ -134,16 +134,11 @@ impl ItemInfo { } } +#[derive(Default)] pub struct EmptyLineAfter { items: Vec, } -impl EmptyLineAfter { - pub fn new() -> Self { - Self { items: Vec::new() } - } -} - #[derive(Debug, PartialEq, Clone, Copy)] enum StopKind { Attr, diff --git a/clippy_lints/src/floating_point_arithmetic/mod.rs b/clippy_lints/src/floating_point_arithmetic/mod.rs index a908e36531a8..f80a017ac156 100644 --- a/clippy_lints/src/floating_point_arithmetic/mod.rs +++ b/clippy_lints/src/floating_point_arithmetic/mod.rs @@ -1,14 +1,14 @@ -mod custom_abs; -mod expm1; -mod hypot; -mod lib; -mod ln1p; -mod log_base; -mod log_division; -mod mul_add; -mod powf; -mod powi; -mod radians; +pub mod custom_abs; +pub mod expm1; +pub mod hypot; +pub mod lib; +pub mod ln1p; +pub mod log_base; +pub mod log_division; +pub mod mul_add; +pub mod powf; +pub mod powi; +pub mod radians; use clippy_utils::res::{MaybeDef as _, MaybeTypeckRes as _}; use clippy_utils::{is_in_const_context, is_no_std_crate, sym}; diff --git a/clippy_lints/src/functions/mod.rs b/clippy_lints/src/functions/mod.rs index d04de4ef44c9..92d5ba06ca1d 100644 --- a/clippy_lints/src/functions/mod.rs +++ b/clippy_lints/src/functions/mod.rs @@ -1,13 +1,13 @@ -mod duplicate_underscore_argument; -mod impl_trait_in_params; -mod misnamed_getters; -mod must_use; -mod not_unsafe_ptr_arg_deref; -mod ref_option; -mod renamed_function_params; -mod result; -mod too_many_arguments; -mod too_many_lines; +pub mod duplicate_underscore_argument; +pub mod impl_trait_in_params; +pub mod misnamed_getters; +pub mod must_use; +pub mod not_unsafe_ptr_arg_deref; +pub mod ref_option; +pub mod renamed_function_params; +pub mod result; +pub mod too_many_arguments; +pub mod too_many_lines; use clippy_config::Conf; use clippy_utils::msrvs::Msrv; diff --git a/clippy_lints/src/ifs/mod.rs b/clippy_lints/src/ifs/mod.rs index 9ca97276db76..277f4c723858 100644 --- a/clippy_lints/src/ifs/mod.rs +++ b/clippy_lints/src/ifs/mod.rs @@ -1,7 +1,7 @@ -mod branches_sharing_code; -mod if_same_then_else; -mod ifs_same_cond; -mod same_functions_in_if_cond; +pub mod branches_sharing_code; +pub mod if_same_then_else; +pub mod ifs_same_cond; +pub mod same_functions_in_if_cond; use clippy_config::Conf; use clippy_utils::ty::InteriorMut; diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 916e1328e496..3a6693dc5a26 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -50,360 +50,360 @@ extern crate clippy_utils; #[macro_use] extern crate declare_clippy_lint; -mod absolute_paths; -mod almost_complete_range; -mod approx_const; -mod arbitrary_source_item_ordering; -mod arc_with_non_send_sync; -mod as_conversions; -mod asm_syntax; -mod assert_is_empty; -mod assertions_on_constants; -mod assertions_on_result_states; -mod assigning_clones; -mod async_yields_async; -mod attrs; -mod await_holding_invalid; -mod bit_width; -mod block_scrutinee; -mod blocks_in_conditions; -mod bool_assert_comparison; -mod bool_comparison; -mod bool_to_int_with_if; -mod booleans; -mod borrow_deref_ref; -mod box_default; -mod byte_char_slices; -mod cargo; -mod casts; -mod cfg_not_test; -mod checked_conversions; -mod cloned_ref_to_slice_refs; -mod coerce_container_to_any; -mod cognitive_complexity; -mod collapsible_if; -mod collection_is_never_read; -mod comparison_chain; -mod copy_iterator; -mod crate_in_macro_def; -mod create_dir; -mod dbg_macro; -mod default; -mod default_constructed_unit_structs; -mod default_instead_of_iter_empty; -mod default_numeric_fallback; -mod default_union_representation; -mod definition_in_module_root; -mod dereference; -mod derivable_impls; -mod derive; -mod disallowed_fields; -mod disallowed_macros; -mod disallowed_methods; -mod disallowed_names; -mod disallowed_script_idents; -mod disallowed_types; -mod doc; -mod double_parens; -mod drop_forget_ref; -mod duplicate_mod; -mod duration_suboptimal_units; -mod else_if_without_else; -mod empty_drop; -mod empty_enums; -mod empty_line_after; -mod empty_with_brackets; -mod endian_bytes; -mod entry; -mod enum_clike; -mod equatable_if_let; -mod error_impl_error; -mod escape; -mod eta_reduction; -mod excessive_bools; -mod excessive_nesting; -mod exhaustive_items; -mod exit; -mod explicit_write; -mod extra_unused_type_parameters; -mod fallible_impl_from; -mod field_scoped_visibility_modifiers; -mod float_literal; -mod floating_point_arithmetic; -mod format; -mod format_args; -mod format_impl; -mod format_push_string; -mod formatting; -mod four_forward_slashes; -mod from_over_into; -mod from_raw_with_void_ptr; -mod from_str_radix_10; -mod functions; -mod future_not_send; -mod if_let_mutex; -mod if_not_else; -mod if_then_some_else_none; -mod ifs; -mod ignored_unit_patterns; -mod impl_hash_with_borrow_str_and_bytes; -mod implicit_hasher; -mod implicit_return; -mod implicit_saturating_add; -mod implicit_saturating_sub; -mod implied_bounds_in_impls; -mod incompatible_msrv; -mod inconsistent_struct_constructor; -mod index_refutable_slice; -mod indexing_slicing; -mod ineffective_open_options; -mod infallible_try_from; -mod infinite_iter; -mod inherent_impl; -mod inherent_to_string; -mod init_numbered_fields; -mod inline_fn_without_body; -mod inline_trait_bounds; -mod int_plus_one; -mod item_name_repetitions; -mod items_after_statements; -mod items_after_test_module; -mod iter_not_returning_iterator; -mod iter_over_hash_type; -mod iter_without_into_iter; -mod large_const_arrays; -mod large_enum_variant; -mod large_futures; -mod large_include_file; -mod large_stack_arrays; -mod large_stack_frames; -mod legacy_numeric_constants; -mod len_without_is_empty; -mod len_zero; -mod let_if_seq; -mod let_underscore; -mod let_with_type_underscore; -mod lifetimes; -mod literal_representation; -mod literal_string_with_formatting_args; -mod loops; -mod macro_metavars_in_unsafe; -mod macro_use; -mod main_recursion; -mod manual_abs_diff; -mod manual_assert; -mod manual_assert_eq; -mod manual_async_fn; -mod manual_bits; -mod manual_checked_ops; -mod manual_clamp; -mod manual_float_methods; -mod manual_hash_one; -mod manual_ignore_case_cmp; -mod manual_ilog2; -mod manual_is_ascii_check; -mod manual_is_power_of_two; -mod manual_let_else; -mod manual_main_separator_str; -mod manual_non_exhaustive; -mod manual_noop_waker; -mod manual_option_as_slice; -mod manual_pop_if; -mod manual_range_patterns; -mod manual_rem_euclid; -mod manual_retain; -mod manual_rotate; -mod manual_slice_size_calculation; -mod manual_string_new; -mod manual_strip; -mod manual_take; -mod map_unit_fn; -mod match_result_ok; -mod matches; -mod mem_replace; -mod methods; -mod min_ident_chars; -mod minmax; -mod misc; -mod misc_early; -mod mismatching_type_param_order; -mod missing_assert_message; -mod missing_asserts_for_indexing; -mod missing_const_for_fn; -mod missing_const_for_thread_local; -mod missing_doc; -mod missing_enforced_import_rename; -mod missing_fields_in_debug; -mod missing_inline; -mod missing_trait_methods; -mod mixed_read_write_in_expression; -mod module_style; -mod multi_assignments; -mod multiple_bound_locations; -mod multiple_unsafe_ops_per_block; -mod mut_key; -mod mut_mut; -mod mutable_debug_assertion; -mod mutex_atomic; -mod needless_arbitrary_self_type; -mod needless_bool; -mod needless_borrowed_ref; -mod needless_borrows_for_generic_args; -mod needless_continue; -mod needless_else; -mod needless_for_each; -mod needless_ifs; -mod needless_late_init; -mod needless_maybe_sized; -mod needless_nonzero_get; -mod needless_parens_on_range_literals; -mod needless_pass_by_ref_mut; -mod needless_pass_by_value; -mod needless_question_mark; -mod needless_update; -mod neg_cmp_op_on_partial_ord; -mod neg_multiply; -mod new_without_default; -mod no_effect; -mod no_mangle_with_rust_abi; -mod non_canonical_impls; -mod non_copy_const; -mod non_expressive_names; -mod non_octal_unix_permissions; -mod non_send_fields_in_send_ty; -mod non_std_lazy_statics; -mod non_zero_suggestions; -mod nonnull_unchecked_on_box_ptr; -mod nonstandard_macro_braces; -mod octal_escapes; -mod only_used_in_recursion; -mod operators; -mod option_env_unwrap; -mod option_if_let_else; -mod panic_in_result_fn; -mod panic_unimplemented; -mod panicking_overflow_checks; -mod partial_pub_fields; -mod partialeq_ne_impl; -mod partialeq_to_none; -mod pass_by_ref_or_value; -mod pathbuf_init_then_push; -mod pattern_type_mismatch; -mod permissions_set_readonly_false; -mod pointers_in_nomem_asm_block; -mod precedence; -mod ptr; -mod pub_underscore_fields; -mod pub_use; -mod question_mark; -mod question_mark_used; -mod ranges; -mod raw_strings; -mod rc_clone_in_vec_init; -mod read_zero_byte_vec; -mod redundant_async_block; -mod redundant_clone; -mod redundant_closure_call; -mod redundant_else; -mod redundant_field_names; -mod redundant_locals; -mod redundant_pub_crate; -mod redundant_slicing; -mod redundant_static_lifetimes; -mod redundant_test_prefix; -mod redundant_type_annotations; -mod ref_option_ref; -mod ref_patterns; -mod reference; -mod regex; -mod repeat_vec_with_capacity; -mod replace_box; -mod reserve_after_initialization; -mod rest_when_destructuring_struct; -mod return_self_not_must_use; -mod returns; -mod same_length_and_capacity; -mod same_name_method; -mod self_named_constructors; -mod semicolon_block; -mod semicolon_if_nothing_returned; -mod serde_api; -mod set_contains_or_insert; -mod shadow; -mod significant_drop_tightening; -mod single_call_fn; -mod single_char_lifetime_names; -mod single_component_path_imports; -mod single_option_map; -mod single_range_in_vec_init; -mod size_of_in_element_count; -mod size_of_ref; -mod slow_vector_initialization; -mod std_instead_of_core; -mod string_patterns; -mod strings; -mod strlen_on_c_strings; -mod suspicious_operation_groupings; -mod suspicious_trait_impl; -mod suspicious_xor_used_as_pow; -mod swap; -mod swap_ptr_to_ref; -mod tabs_in_doc_comments; -mod temporary_assignment; -mod tests_outside_test_module; -mod time_subtraction; -mod to_digit_is_some; -mod to_string_trait_impl; -mod toplevel_ref_arg; -mod trailing_empty_array; -mod trait_bounds; -mod transmute; -mod tuple_array_conversions; -mod types; -mod unconditional_recursion; -mod undocumented_unsafe_blocks; -mod unicode; -mod uninhabited_references; -mod uninit_vec; -mod unit_return_expecting_ord; -mod unit_types; -mod unnecessary_box_returns; -mod unnecessary_literal_bound; -mod unnecessary_map_on_constructor; -mod unnecessary_mut_passed; -mod unnecessary_owned_empty_strings; -mod unnecessary_self_imports; -mod unnecessary_semicolon; -mod unnecessary_struct_initialization; -mod unnecessary_wraps; -mod unneeded_struct_pattern; -mod unnested_or_patterns; -mod unsafe_removed_from_name; -mod unused_async; -mod unused_io_amount; -mod unused_peekable; -mod unused_result_ok; -mod unused_rounding; -mod unused_self; -mod unused_trait_names; -mod unused_unit; -mod unwrap; -mod unwrap_in_result; -mod upper_case_acronyms; -mod use_self; -mod useless_concat; -mod useless_conversion; -mod useless_vec; -mod vec_init_then_push; -mod visibility; -mod volatile_composites; -mod wildcard_imports; -mod with_capacity_zero; -mod write; -mod zero_div_zero; -mod zero_repeat_side_effects; -mod zero_sized_map_values; -mod zombie_processes; +pub mod absolute_paths; +pub mod almost_complete_range; +pub mod approx_const; +pub mod arbitrary_source_item_ordering; +pub mod arc_with_non_send_sync; +pub mod as_conversions; +pub mod asm_syntax; +pub mod assert_is_empty; +pub mod assertions_on_constants; +pub mod assertions_on_result_states; +pub mod assigning_clones; +pub mod async_yields_async; +pub mod attrs; +pub mod await_holding_invalid; +pub mod bit_width; +pub mod block_scrutinee; +pub mod blocks_in_conditions; +pub mod bool_assert_comparison; +pub mod bool_comparison; +pub mod bool_to_int_with_if; +pub mod booleans; +pub mod borrow_deref_ref; +pub mod box_default; +pub mod byte_char_slices; +pub mod cargo; +pub mod casts; +pub mod cfg_not_test; +pub mod checked_conversions; +pub mod cloned_ref_to_slice_refs; +pub mod coerce_container_to_any; +pub mod cognitive_complexity; +pub mod collapsible_if; +pub mod collection_is_never_read; +pub mod comparison_chain; +pub mod copy_iterator; +pub mod crate_in_macro_def; +pub mod create_dir; +pub mod dbg_macro; +pub mod default; +pub mod default_constructed_unit_structs; +pub mod default_instead_of_iter_empty; +pub mod default_numeric_fallback; +pub mod default_union_representation; +pub mod definition_in_module_root; +pub mod dereference; +pub mod derivable_impls; +pub mod derive; +pub mod disallowed_fields; +pub mod disallowed_macros; +pub mod disallowed_methods; +pub mod disallowed_names; +pub mod disallowed_script_idents; +pub mod disallowed_types; +pub mod doc; +pub mod double_parens; +pub mod drop_forget_ref; +pub mod duplicate_mod; +pub mod duration_suboptimal_units; +pub mod else_if_without_else; +pub mod empty_drop; +pub mod empty_enums; +pub mod empty_line_after; +pub mod empty_with_brackets; +pub mod endian_bytes; +pub mod entry; +pub mod enum_clike; +pub mod equatable_if_let; +pub mod error_impl_error; +pub mod escape; +pub mod eta_reduction; +pub mod excessive_bools; +pub mod excessive_nesting; +pub mod exhaustive_items; +pub mod exit; +pub mod explicit_write; +pub mod extra_unused_type_parameters; +pub mod fallible_impl_from; +pub mod field_scoped_visibility_modifiers; +pub mod float_literal; +pub mod floating_point_arithmetic; +pub mod format; +pub mod format_args; +pub mod format_impl; +pub mod format_push_string; +pub mod formatting; +pub mod four_forward_slashes; +pub mod from_over_into; +pub mod from_raw_with_void_ptr; +pub mod from_str_radix_10; +pub mod functions; +pub mod future_not_send; +pub mod if_let_mutex; +pub mod if_not_else; +pub mod if_then_some_else_none; +pub mod ifs; +pub mod ignored_unit_patterns; +pub mod impl_hash_with_borrow_str_and_bytes; +pub mod implicit_hasher; +pub mod implicit_return; +pub mod implicit_saturating_add; +pub mod implicit_saturating_sub; +pub mod implied_bounds_in_impls; +pub mod incompatible_msrv; +pub mod inconsistent_struct_constructor; +pub mod index_refutable_slice; +pub mod indexing_slicing; +pub mod ineffective_open_options; +pub mod infallible_try_from; +pub mod infinite_iter; +pub mod inherent_impl; +pub mod inherent_to_string; +pub mod init_numbered_fields; +pub mod inline_fn_without_body; +pub mod inline_trait_bounds; +pub mod int_plus_one; +pub mod item_name_repetitions; +pub mod items_after_statements; +pub mod items_after_test_module; +pub mod iter_not_returning_iterator; +pub mod iter_over_hash_type; +pub mod iter_without_into_iter; +pub mod large_const_arrays; +pub mod large_enum_variant; +pub mod large_futures; +pub mod large_include_file; +pub mod large_stack_arrays; +pub mod large_stack_frames; +pub mod legacy_numeric_constants; +pub mod len_without_is_empty; +pub mod len_zero; +pub mod let_if_seq; +pub mod let_underscore; +pub mod let_with_type_underscore; +pub mod lifetimes; +pub mod literal_representation; +pub mod literal_string_with_formatting_args; +pub mod loops; +pub mod macro_metavars_in_unsafe; +pub mod macro_use; +pub mod main_recursion; +pub mod manual_abs_diff; +pub mod manual_assert; +pub mod manual_assert_eq; +pub mod manual_async_fn; +pub mod manual_bits; +pub mod manual_checked_ops; +pub mod manual_clamp; +pub mod manual_float_methods; +pub mod manual_hash_one; +pub mod manual_ignore_case_cmp; +pub mod manual_ilog2; +pub mod manual_is_ascii_check; +pub mod manual_is_power_of_two; +pub mod manual_let_else; +pub mod manual_main_separator_str; +pub mod manual_non_exhaustive; +pub mod manual_noop_waker; +pub mod manual_option_as_slice; +pub mod manual_pop_if; +pub mod manual_range_patterns; +pub mod manual_rem_euclid; +pub mod manual_retain; +pub mod manual_rotate; +pub mod manual_slice_size_calculation; +pub mod manual_string_new; +pub mod manual_strip; +pub mod manual_take; +pub mod map_unit_fn; +pub mod match_result_ok; +pub mod matches; +pub mod mem_replace; +pub mod methods; +pub mod min_ident_chars; +pub mod minmax; +pub mod misc; +pub mod misc_early; +pub mod mismatching_type_param_order; +pub mod missing_assert_message; +pub mod missing_asserts_for_indexing; +pub mod missing_const_for_fn; +pub mod missing_const_for_thread_local; +pub mod missing_doc; +pub mod missing_enforced_import_rename; +pub mod missing_fields_in_debug; +pub mod missing_inline; +pub mod missing_trait_methods; +pub mod mixed_read_write_in_expression; +pub mod module_style; +pub mod multi_assignments; +pub mod multiple_bound_locations; +pub mod multiple_unsafe_ops_per_block; +pub mod mut_key; +pub mod mut_mut; +pub mod mutable_debug_assertion; +pub mod mutex_atomic; +pub mod needless_arbitrary_self_type; +pub mod needless_bool; +pub mod needless_borrowed_ref; +pub mod needless_borrows_for_generic_args; +pub mod needless_continue; +pub mod needless_else; +pub mod needless_for_each; +pub mod needless_ifs; +pub mod needless_late_init; +pub mod needless_maybe_sized; +pub mod needless_nonzero_get; +pub mod needless_parens_on_range_literals; +pub mod needless_pass_by_ref_mut; +pub mod needless_pass_by_value; +pub mod needless_question_mark; +pub mod needless_update; +pub mod neg_cmp_op_on_partial_ord; +pub mod neg_multiply; +pub mod new_without_default; +pub mod no_effect; +pub mod no_mangle_with_rust_abi; +pub mod non_canonical_impls; +pub mod non_copy_const; +pub mod non_expressive_names; +pub mod non_octal_unix_permissions; +pub mod non_send_fields_in_send_ty; +pub mod non_std_lazy_statics; +pub mod non_zero_suggestions; +pub mod nonnull_unchecked_on_box_ptr; +pub mod nonstandard_macro_braces; +pub mod octal_escapes; +pub mod only_used_in_recursion; +pub mod operators; +pub mod option_env_unwrap; +pub mod option_if_let_else; +pub mod panic_in_result_fn; +pub mod panic_unimplemented; +pub mod panicking_overflow_checks; +pub mod partial_pub_fields; +pub mod partialeq_ne_impl; +pub mod partialeq_to_none; +pub mod pass_by_ref_or_value; +pub mod pathbuf_init_then_push; +pub mod pattern_type_mismatch; +pub mod permissions_set_readonly_false; +pub mod pointers_in_nomem_asm_block; +pub mod precedence; +pub mod ptr; +pub mod pub_underscore_fields; +pub mod pub_use; +pub mod question_mark; +pub mod question_mark_used; +pub mod ranges; +pub mod raw_strings; +pub mod rc_clone_in_vec_init; +pub mod read_zero_byte_vec; +pub mod redundant_async_block; +pub mod redundant_clone; +pub mod redundant_closure_call; +pub mod redundant_else; +pub mod redundant_field_names; +pub mod redundant_locals; +pub mod redundant_pub_crate; +pub mod redundant_slicing; +pub mod redundant_static_lifetimes; +pub mod redundant_test_prefix; +pub mod redundant_type_annotations; +pub mod ref_option_ref; +pub mod ref_patterns; +pub mod reference; +pub mod regex; +pub mod repeat_vec_with_capacity; +pub mod replace_box; +pub mod reserve_after_initialization; +pub mod rest_when_destructuring_struct; +pub mod return_self_not_must_use; +pub mod returns; +pub mod same_length_and_capacity; +pub mod same_name_method; +pub mod self_named_constructors; +pub mod semicolon_block; +pub mod semicolon_if_nothing_returned; +pub mod serde_api; +pub mod set_contains_or_insert; +pub mod shadow; +pub mod significant_drop_tightening; +pub mod single_call_fn; +pub mod single_char_lifetime_names; +pub mod single_component_path_imports; +pub mod single_option_map; +pub mod single_range_in_vec_init; +pub mod size_of_in_element_count; +pub mod size_of_ref; +pub mod slow_vector_initialization; +pub mod std_instead_of_core; +pub mod string_patterns; +pub mod strings; +pub mod strlen_on_c_strings; +pub mod suspicious_operation_groupings; +pub mod suspicious_trait_impl; +pub mod suspicious_xor_used_as_pow; +pub mod swap; +pub mod swap_ptr_to_ref; +pub mod tabs_in_doc_comments; +pub mod temporary_assignment; +pub mod tests_outside_test_module; +pub mod time_subtraction; +pub mod to_digit_is_some; +pub mod to_string_trait_impl; +pub mod toplevel_ref_arg; +pub mod trailing_empty_array; +pub mod trait_bounds; +pub mod transmute; +pub mod tuple_array_conversions; +pub mod types; +pub mod unconditional_recursion; +pub mod undocumented_unsafe_blocks; +pub mod unicode; +pub mod uninhabited_references; +pub mod uninit_vec; +pub mod unit_return_expecting_ord; +pub mod unit_types; +pub mod unnecessary_box_returns; +pub mod unnecessary_literal_bound; +pub mod unnecessary_map_on_constructor; +pub mod unnecessary_mut_passed; +pub mod unnecessary_owned_empty_strings; +pub mod unnecessary_self_imports; +pub mod unnecessary_semicolon; +pub mod unnecessary_struct_initialization; +pub mod unnecessary_wraps; +pub mod unneeded_struct_pattern; +pub mod unnested_or_patterns; +pub mod unsafe_removed_from_name; +pub mod unused_async; +pub mod unused_io_amount; +pub mod unused_peekable; +pub mod unused_result_ok; +pub mod unused_rounding; +pub mod unused_self; +pub mod unused_trait_names; +pub mod unused_unit; +pub mod unwrap; +pub mod unwrap_in_result; +pub mod upper_case_acronyms; +pub mod use_self; +pub mod useless_concat; +pub mod useless_conversion; +pub mod useless_vec; +pub mod vec_init_then_push; +pub mod visibility; +pub mod volatile_composites; +pub mod wildcard_imports; +pub mod with_capacity_zero; +pub mod write; +pub mod zero_div_zero; +pub mod zero_repeat_side_effects; +pub mod zero_sized_map_values; +pub mod zombie_processes; mod combined_early_pass; mod combined_late_pass; @@ -537,7 +537,7 @@ rustc_lint::early_lint_methods!( MultipleBoundLocations: multiple_bound_locations::MultipleBoundLocations = multiple_bound_locations::MultipleBoundLocations, FieldScopedVisibilityModifiers: field_scoped_visibility_modifiers::FieldScopedVisibilityModifiers = field_scoped_visibility_modifiers::FieldScopedVisibilityModifiers, CfgNotTest: cfg_not_test::CfgNotTest = cfg_not_test::CfgNotTest, - EmptyLineAfter: empty_line_after::EmptyLineAfter = empty_line_after::EmptyLineAfter::new(), + EmptyLineAfter: empty_line_after::EmptyLineAfter = empty_line_after::EmptyLineAfter::default(), InlineTraitBounds: inline_trait_bounds::InlineTraitBounds = inline_trait_bounds::InlineTraitBounds::default(), DefinitionInModuleRoot: definition_in_module_root::DefinitionInModuleRoot = definition_in_module_root::DefinitionInModuleRoot::default(), // add early passes here, used by `cargo dev new_lint` diff --git a/clippy_lints/src/loops/mod.rs b/clippy_lints/src/loops/mod.rs index a4d3fe9e2296..458f97886890 100644 --- a/clippy_lints/src/loops/mod.rs +++ b/clippy_lints/src/loops/mod.rs @@ -1,29 +1,30 @@ -mod char_indices_as_byte_indices; -mod empty_loop; -mod explicit_counter_loop; -mod explicit_into_iter_loop; -mod explicit_iter_loop; -mod for_kv_map; -mod for_unbounded_range; -mod infinite_loop; -mod iter_next_loop; -mod manual_find; -mod manual_flatten; -mod manual_memcpy; -mod manual_slice_fill; -mod manual_while_let_some; -mod missing_spin_loop; -mod mut_range_bound; -mod needless_range_loop; -mod never_loop; -mod same_item_push; -mod single_element_loop; -mod unused_enumerate_index; +pub mod char_indices_as_byte_indices; +pub mod empty_loop; +pub mod explicit_counter_loop; +pub mod explicit_into_iter_loop; +pub mod explicit_iter_loop; +pub mod for_kv_map; +pub mod for_unbounded_range; +pub mod infinite_loop; +pub mod iter_next_loop; +pub mod manual_find; +pub mod manual_flatten; +pub mod manual_memcpy; +pub mod manual_slice_fill; +pub mod manual_while_let_some; +pub mod missing_spin_loop; +pub mod mut_range_bound; +pub mod needless_range_loop; +pub mod never_loop; +pub mod same_item_push; +pub mod single_element_loop; +pub mod unused_enumerate_index; +pub mod while_float; +pub mod while_immutable_condition; +pub mod while_let_loop; +pub mod while_let_on_iterator; + mod utils; -mod while_float; -mod while_immutable_condition; -mod while_let_loop; -mod while_let_on_iterator; use clippy_config::Conf; use clippy_utils::msrvs::Msrv; diff --git a/clippy_lints/src/matches/mod.rs b/clippy_lints/src/matches/mod.rs index 972375fbc451..6fd91d2471ee 100644 --- a/clippy_lints/src/matches/mod.rs +++ b/clippy_lints/src/matches/mod.rs @@ -1,29 +1,28 @@ -mod collapsible_match; -mod infallible_destructuring_match; -mod manual_map; -mod manual_ok_err; -mod manual_unwrap_or; -mod manual_utils; -mod match_as_ref; -mod match_bool; -mod match_like_matches; -mod match_ref_pats; -mod match_same_arms; -mod match_single_binding; -mod match_str_case_mismatch; -mod match_wild_enum; -mod match_wild_err_arm; -mod needless_match; -mod overlapping_arms; -mod redundant_guards; -mod redundant_pattern_match; -mod rest_pat_in_fully_bound_struct; -mod significant_drop_in_scrutinee; -mod single_match; -mod try_err; -mod wild_in_or_pats; - -pub(crate) mod manual_filter; +pub mod collapsible_match; +pub mod infallible_destructuring_match; +pub mod manual_filter; +pub mod manual_map; +pub mod manual_ok_err; +pub mod manual_unwrap_or; +pub mod manual_utils; +pub mod match_as_ref; +pub mod match_bool; +pub mod match_like_matches; +pub mod match_ref_pats; +pub mod match_same_arms; +pub mod match_single_binding; +pub mod match_str_case_mismatch; +pub mod match_wild_enum; +pub mod match_wild_err_arm; +pub mod needless_match; +pub mod overlapping_arms; +pub mod redundant_guards; +pub mod redundant_pattern_match; +pub mod rest_pat_in_fully_bound_struct; +pub mod significant_drop_in_scrutinee; +pub mod single_match; +pub mod try_err; +pub mod wild_in_or_pats; use clippy_config::Conf; use clippy_utils::msrvs::{self, Msrv}; diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs index 765275a6a835..d75e13ab31c8 100644 --- a/clippy_lints/src/methods/mod.rs +++ b/clippy_lints/src/methods/mod.rs @@ -1,159 +1,160 @@ -mod bind_instead_of_map; -mod by_ref_peekable_peek; -mod bytecount; -mod bytes_count_to_len; -mod bytes_nth; -mod case_sensitive_file_extension_comparisons; -mod chars_cmp; -mod chars_cmp_with_unwrap; -mod chars_last_cmp; -mod chars_last_cmp_with_unwrap; -mod chars_next_cmp; -mod chars_next_cmp_with_unwrap; -mod chunks_exact_to_as_chunks; -mod clear_with_drain; -mod clone_on_copy; -mod clone_on_ref_ptr; -mod cloned_instead_of_copied; -mod collapsible_str_replace; -mod double_ended_iterator_last; -mod drain_collect; -mod err_expect; -mod expect_fun_call; -mod extend_with_drain; -mod filetype_is_file; -mod filter_map; -mod filter_map_bool_then; -mod filter_map_identity; -mod filter_map_next; -mod filter_next; -mod flat_map_identity; -mod flat_map_option; -mod format_collect; -mod get_first; -mod get_last_with_len; -mod get_unwrap; -mod implicit_clone; -mod inefficient_to_string; -mod inspect_for_each; -mod into_iter_on_ref; -mod io_other_error; -mod ip_constant; -mod is_digit_ascii_radix; -mod is_empty; -mod iter_cloned_collect; -mod iter_count; -mod iter_filter; -mod iter_kv_map; -mod iter_next_slice; -mod iter_nth; -mod iter_nth_zero; -mod iter_on_single_or_empty_collections; -mod iter_out_of_bounds; -mod iter_overeager_cloned; -mod iter_skip_next; -mod iter_skip_zero; -mod iter_with_drain; -mod iterator_step_by_zero; -mod join_absolute_paths; +pub mod bind_instead_of_map; +pub mod by_ref_peekable_peek; +pub mod bytecount; +pub mod bytes_count_to_len; +pub mod bytes_nth; +pub mod case_sensitive_file_extension_comparisons; +pub mod chars_cmp; +pub mod chars_cmp_with_unwrap; +pub mod chars_last_cmp; +pub mod chars_last_cmp_with_unwrap; +pub mod chars_next_cmp; +pub mod chars_next_cmp_with_unwrap; +pub mod chunks_exact_to_as_chunks; +pub mod clear_with_drain; +pub mod clone_on_copy; +pub mod clone_on_ref_ptr; +pub mod cloned_instead_of_copied; +pub mod collapsible_str_replace; +pub mod double_ended_iterator_last; +pub mod drain_collect; +pub mod err_expect; +pub mod expect_fun_call; +pub mod extend_with_drain; +pub mod filetype_is_file; +pub mod filter_map; +pub mod filter_map_bool_then; +pub mod filter_map_identity; +pub mod filter_map_next; +pub mod filter_next; +pub mod flat_map_identity; +pub mod flat_map_option; +pub mod format_collect; +pub mod get_first; +pub mod get_last_with_len; +pub mod get_unwrap; +pub mod implicit_clone; +pub mod inefficient_to_string; +pub mod inspect_for_each; +pub mod into_iter_on_ref; +pub mod io_other_error; +pub mod ip_constant; +pub mod is_digit_ascii_radix; +pub mod is_empty; +pub mod iter_cloned_collect; +pub mod iter_count; +pub mod iter_filter; +pub mod iter_kv_map; +pub mod iter_next_slice; +pub mod iter_nth; +pub mod iter_nth_zero; +pub mod iter_on_single_or_empty_collections; +pub mod iter_out_of_bounds; +pub mod iter_overeager_cloned; +pub mod iter_skip_next; +pub mod iter_skip_zero; +pub mod iter_with_drain; +pub mod iterator_step_by_zero; +pub mod join_absolute_paths; +pub mod lines_filter_map_ok; +pub mod manual_c_str_literals; +pub mod manual_clear; +pub mod manual_contains; +pub mod manual_inspect; +pub mod manual_is_variant_and; +pub mod manual_next_back; +pub mod manual_ok_or; +pub mod manual_option_zip; +pub mod manual_repeat_n; +pub mod manual_saturating_arithmetic; +pub mod manual_str_repeat; +pub mod manual_try_fold; +pub mod map_all_any_identity; +pub mod map_clone; +pub mod map_collect_result_unit; +pub mod map_err_ignore; +pub mod map_flatten; +pub mod map_identity; +pub mod map_or_identity; +pub mod map_unwrap_or; +pub mod map_unwrap_or_else; +pub mod map_with_unused_argument_over_ranges; +pub mod mut_mutex_lock; +pub mod needless_as_bytes; +pub mod needless_character_iteration; +pub mod needless_collect; +pub mod needless_option_as_deref; +pub mod needless_option_take; +pub mod new_ret_no_self; +pub mod no_effect_replace; +pub mod obfuscated_if_else; +pub mod ok_expect; +pub mod open_options; +pub mod option_as_ref_cloned; +pub mod option_as_ref_deref; +pub mod option_map_or_none; +pub mod option_zip_none; +pub mod or_fun_call; +pub mod or_then_unwrap; +pub mod path_buf_push_overwrite; +pub mod path_ends_with_ext; +pub mod ptr_offset_by_literal; +pub mod ptr_offset_with_cast; +pub mod range_zip_with_len; +pub mod read_line_without_trim; +pub mod readonly_write_lock; +pub mod redundant_as_str; +pub mod repeat_once; +pub mod result_map_or_else_none; +pub mod return_and_then; +pub mod search_is_some; +pub mod seek_from_current; +pub mod seek_to_start_instead_of_rewind; +pub mod should_implement_trait; +pub mod single_char_add_str; +pub mod skip_while_next; +pub mod sliced_string_as_bytes; +pub mod some_filter; +pub mod stable_sort_primitive; +pub mod str_split; +pub mod str_splitn; +pub mod string_extend_chars; +pub mod string_lit_chars_any; +pub mod suspicious_command_arg_space; +pub mod suspicious_map; +pub mod suspicious_splitn; +pub mod suspicious_to_owned; +pub mod swap_with_temporary; +pub mod type_id_on_box; +pub mod unbuffered_bytes; +pub mod uninit_assumed_init; +pub mod unit_hash; +pub mod unnecessary_fallible_conversions; +pub mod unnecessary_filter_map; +pub mod unnecessary_first_then_check; +pub mod unnecessary_fold; +pub mod unnecessary_get_then_check; +pub mod unnecessary_iter_cloned; +pub mod unnecessary_join; +pub mod unnecessary_lazy_eval; +pub mod unnecessary_literal_unwrap; +pub mod unnecessary_map_or; +pub mod unnecessary_map_or_else; +pub mod unnecessary_min_or_max; +pub mod unnecessary_sort_by; +pub mod unnecessary_to_owned; +pub mod unnecessary_unwrap_unchecked; +pub mod unwrap_expect_used; +pub mod useless_asref; +pub mod useless_nonzero_new_unchecked; +pub mod vec_resize_to_zero; +pub mod verbose_file_reads; +pub mod waker_clone_wake; +pub mod wrong_self_convention; +pub mod zst_offset; + mod lib; -mod lines_filter_map_ok; -mod manual_c_str_literals; -mod manual_clear; -mod manual_contains; -mod manual_inspect; -mod manual_is_variant_and; -mod manual_next_back; -mod manual_ok_or; -mod manual_option_zip; -mod manual_repeat_n; -mod manual_saturating_arithmetic; -mod manual_str_repeat; -mod manual_try_fold; -mod map_all_any_identity; -mod map_clone; -mod map_collect_result_unit; -mod map_err_ignore; -mod map_flatten; -mod map_identity; -mod map_or_identity; -mod map_unwrap_or; -mod map_unwrap_or_else; -mod map_with_unused_argument_over_ranges; -mod mut_mutex_lock; -mod needless_as_bytes; -mod needless_character_iteration; -mod needless_collect; -mod needless_option_as_deref; -mod needless_option_take; -mod new_ret_no_self; -mod no_effect_replace; -mod obfuscated_if_else; -mod ok_expect; -mod open_options; -mod option_as_ref_cloned; -mod option_as_ref_deref; -mod option_map_or_none; -mod option_zip_none; -mod or_fun_call; -mod or_then_unwrap; -mod path_buf_push_overwrite; -mod path_ends_with_ext; -mod ptr_offset_by_literal; -mod ptr_offset_with_cast; -mod range_zip_with_len; -mod read_line_without_trim; -mod readonly_write_lock; -mod redundant_as_str; -mod repeat_once; -mod result_map_or_else_none; -mod return_and_then; -mod search_is_some; -mod seek_from_current; -mod seek_to_start_instead_of_rewind; -mod should_implement_trait; -mod single_char_add_str; -mod skip_while_next; -mod sliced_string_as_bytes; -mod some_filter; -mod stable_sort_primitive; -mod str_split; -mod str_splitn; -mod string_extend_chars; -mod string_lit_chars_any; -mod suspicious_command_arg_space; -mod suspicious_map; -mod suspicious_splitn; -mod suspicious_to_owned; -mod swap_with_temporary; -mod type_id_on_box; -mod unbuffered_bytes; -mod uninit_assumed_init; -mod unit_hash; -mod unnecessary_fallible_conversions; -mod unnecessary_filter_map; -mod unnecessary_first_then_check; -mod unnecessary_fold; -mod unnecessary_get_then_check; -mod unnecessary_iter_cloned; -mod unnecessary_join; -mod unnecessary_lazy_eval; -mod unnecessary_literal_unwrap; -mod unnecessary_map_or; -mod unnecessary_map_or_else; -mod unnecessary_min_or_max; -mod unnecessary_sort_by; -mod unnecessary_to_owned; -mod unnecessary_unwrap_unchecked; -mod unwrap_expect_used; -mod useless_asref; -mod useless_nonzero_new_unchecked; mod utils; -mod vec_resize_to_zero; -mod verbose_file_reads; -mod waker_clone_wake; -mod wrong_self_convention; -mod zst_offset; use clippy_config::Conf; use clippy_utils::consts::{ConstEvalCtxt, Constant}; diff --git a/clippy_lints/src/misc_early/mod.rs b/clippy_lints/src/misc_early/mod.rs index c47402f72add..eec1a4bdb539 100644 --- a/clippy_lints/src/misc_early/mod.rs +++ b/clippy_lints/src/misc_early/mod.rs @@ -1,11 +1,11 @@ -mod builtin_type_shadow; -mod literal_suffix; -mod mixed_case_hex_literals; -mod redundant_at_rest_pattern; -mod redundant_pattern; -mod unneeded_field_pattern; -mod unneeded_wildcard_pattern; -mod zero_prefixed_literal; +pub mod builtin_type_shadow; +pub mod literal_suffix; +pub mod mixed_case_hex_literals; +pub mod redundant_at_rest_pattern; +pub mod redundant_pattern; +pub mod unneeded_field_pattern; +pub mod unneeded_wildcard_pattern; +pub mod zero_prefixed_literal; use clippy_utils::source::snippet_opt; use rustc_ast::ast::{Expr, ExprKind, Generics, LitFloatType, LitIntType, LitKind, Pat}; diff --git a/clippy_lints/src/operators/mod.rs b/clippy_lints/src/operators/mod.rs index 1bd954bf1421..f994b91d947f 100644 --- a/clippy_lints/src/operators/mod.rs +++ b/clippy_lints/src/operators/mod.rs @@ -1,33 +1,32 @@ -mod absurd_extreme_comparisons; -mod assign_op_pattern; -mod bit_mask; -mod cmp_owned; -mod const_comparisons; -mod decimal_bitwise_operands; -mod double_comparison; -mod duration_subsec; -mod eq_op; -mod erasing_op; -mod float_cmp; -mod float_equality_without_abs; -mod identity_op; -mod integer_division; -mod integer_division_remainder_used; -mod invalid_upcast_comparisons; -mod manual_div_ceil; -mod manual_is_multiple_of; -mod manual_isolate_lowest_one; -mod manual_midpoint; -mod misrefactored_assign_op; -mod modulo_arithmetic; -mod modulo_one; -mod needless_bitwise_bool; -mod numeric_arithmetic; -mod op_ref; -mod self_assignment; -mod verbose_bit_mask; - -pub(crate) mod arithmetic_side_effects; +pub mod absurd_extreme_comparisons; +pub mod arithmetic_side_effects; +pub mod assign_op_pattern; +pub mod bit_mask; +pub mod cmp_owned; +pub mod const_comparisons; +pub mod decimal_bitwise_operands; +pub mod double_comparison; +pub mod duration_subsec; +pub mod eq_op; +pub mod erasing_op; +pub mod float_cmp; +pub mod float_equality_without_abs; +pub mod identity_op; +pub mod integer_division; +pub mod integer_division_remainder_used; +pub mod invalid_upcast_comparisons; +pub mod manual_div_ceil; +pub mod manual_is_multiple_of; +pub mod manual_isolate_lowest_one; +pub mod manual_midpoint; +pub mod misrefactored_assign_op; +pub mod modulo_arithmetic; +pub mod modulo_one; +pub mod needless_bitwise_bool; +pub mod numeric_arithmetic; +pub mod op_ref; +pub mod self_assignment; +pub mod verbose_bit_mask; use clippy_config::Conf; use clippy_utils::msrvs::Msrv; diff --git a/clippy_lints/src/ptr/mod.rs b/clippy_lints/src/ptr/mod.rs index 17479187db3a..9c5887cb99a1 100644 --- a/clippy_lints/src/ptr/mod.rs +++ b/clippy_lints/src/ptr/mod.rs @@ -1,7 +1,7 @@ -mod cmp_null; -mod mut_from_ref; -mod ptr_arg; -mod ptr_eq; +pub mod cmp_null; +pub mod mut_from_ref; +pub mod ptr_arg; +pub mod ptr_eq; use rustc_hir::{BinOpKind, Body, Expr, ExprKind, ImplItemKind, ItemKind, Node, TraitFn, TraitItem, TraitItemKind}; use rustc_lint::{LateContext, LateLintPass, declare_lint_pass}; diff --git a/clippy_lints/src/returns/mod.rs b/clippy_lints/src/returns/mod.rs index 1cb492e87ac5..ef78420be490 100644 --- a/clippy_lints/src/returns/mod.rs +++ b/clippy_lints/src/returns/mod.rs @@ -1,6 +1,6 @@ -mod let_and_return; -mod needless_return; -mod needless_return_with_question_mark; +pub mod let_and_return; +pub mod needless_return; +pub mod needless_return_with_question_mark; use rustc_hir::intravisit::FnKind; use rustc_hir::{Block, Body, FnDecl, Stmt}; diff --git a/clippy_lints/src/transmute/mod.rs b/clippy_lints/src/transmute/mod.rs index 89beedcfe362..9473eb218f03 100644 --- a/clippy_lints/src/transmute/mod.rs +++ b/clippy_lints/src/transmute/mod.rs @@ -1,19 +1,20 @@ -mod crosspointer_transmute; -mod eager_transmute; -mod missing_transmute_annotations; -mod transmute_int_to_bool; -mod transmute_int_to_non_zero; -mod transmute_null_to_fn; -mod transmute_ptr_to_ptr; -mod transmute_ptr_to_ref; -mod transmute_ref_to_ref; -mod transmute_undefined_repr; -mod transmutes_expressible_as_ptr_casts; -mod transmuting_null; -mod unsound_collection_transmute; -mod useless_transmute; +pub mod crosspointer_transmute; +pub mod eager_transmute; +pub mod missing_transmute_annotations; +pub mod transmute_int_to_bool; +pub mod transmute_int_to_non_zero; +pub mod transmute_null_to_fn; +pub mod transmute_ptr_to_ptr; +pub mod transmute_ptr_to_ref; +pub mod transmute_ref_to_ref; +pub mod transmute_undefined_repr; +pub mod transmutes_expressible_as_ptr_casts; +pub mod transmuting_null; +pub mod unsound_collection_transmute; +pub mod useless_transmute; +pub mod wrong_transmute; + mod utils; -mod wrong_transmute; use clippy_config::Conf; use clippy_utils::is_in_const_context; diff --git a/clippy_lints/src/types/mod.rs b/clippy_lints/src/types/mod.rs index 45388800be4b..8b28fbbee20e 100644 --- a/clippy_lints/src/types/mod.rs +++ b/clippy_lints/src/types/mod.rs @@ -1,14 +1,15 @@ -mod borrowed_box; -mod box_collection; -mod linked_list; -mod option_option; -mod owned_cow; -mod rc_buffer; -mod rc_mutex; -mod redundant_allocation; -mod type_complexity; +pub mod borrowed_box; +pub mod box_collection; +pub mod linked_list; +pub mod option_option; +pub mod owned_cow; +pub mod rc_buffer; +pub mod rc_mutex; +pub mod redundant_allocation; +pub mod type_complexity; +pub mod vec_box; + mod utils; -mod vec_box; use clippy_config::Conf; use rustc_hir as hir; diff --git a/clippy_lints/src/unit_types/mod.rs b/clippy_lints/src/unit_types/mod.rs index 11c04a20f902..b7add002dfa1 100644 --- a/clippy_lints/src/unit_types/mod.rs +++ b/clippy_lints/src/unit_types/mod.rs @@ -1,6 +1,7 @@ -mod let_unit_value; -mod unit_arg; -mod unit_cmp; +pub mod let_unit_value; +pub mod unit_arg; +pub mod unit_cmp; + mod utils; use clippy_utils::macros::FormatArgsStorage; diff --git a/clippy_lints/src/write/mod.rs b/clippy_lints/src/write/mod.rs index 803433829e11..c51195a25daf 100644 --- a/clippy_lints/src/write/mod.rs +++ b/clippy_lints/src/write/mod.rs @@ -1,7 +1,7 @@ -mod empty_string; -mod literal; -mod use_debug; -mod with_newline; +pub mod empty_string; +pub mod literal; +pub mod use_debug; +pub mod with_newline; use clippy_config::Conf; use clippy_utils::diagnostics::span_lint; From 843019305f1cddeb0500cbf4f507628bebe1fcac Mon Sep 17 00:00:00 2001 From: Jason Newcomb Date: Tue, 3 Mar 2026 00:22:38 -0500 Subject: [PATCH 08/14] `clippy_dev`: Separate the IR definitions into a separate module. --- clippy_dev/src/edit_lints.rs | 6 +- clippy_dev/src/generate.rs | 2 +- clippy_dev/src/ir.rs | 249 +++++++++++++++++++++++++++++++++ clippy_dev/src/lib.rs | 1 + clippy_dev/src/new_lint.rs | 10 +- clippy_dev/src/parse.rs | 257 +++-------------------------------- 6 files changed, 276 insertions(+), 249 deletions(-) create mode 100644 clippy_dev/src/ir.rs diff --git a/clippy_dev/src/edit_lints.rs b/clippy_dev/src/edit_lints.rs index 057da10de628..2ffe8cbb3e90 100644 --- a/clippy_dev/src/edit_lints.rs +++ b/clippy_dev/src/edit_lints.rs @@ -1,12 +1,10 @@ +use crate::ir::{ActiveLintData, DeprecatedLintData, Lint, LintData, LintName, ParsedLints, RenamedLintData}; use crate::parse::cursor::{self, Capture, Cursor}; -use crate::parse::{ - ActiveLintData, DeprecatedLintData, Lint, LintData, LintName, ParseCx, ParsedLints, RenamedLintData, -}; use crate::utils::{ ErrAction, FileUpdater, UpdateMode, UpdateStatus, Version, delete_dir_if_exists, delete_file_if_exists, expect_action, try_rename_dir, try_rename_file, walk_dir_no_dot_or_target, }; -use crate::{SourceFile, Span}; +use crate::{ParseCx, SourceFile, Span}; use core::mem; use rustc_lexer::TokenKind; use std::collections::hash_map::Entry; diff --git a/clippy_dev/src/generate.rs b/clippy_dev/src/generate.rs index 99bd9644bcab..2eee9dd87ed2 100644 --- a/clippy_dev/src/generate.rs +++ b/clippy_dev/src/generate.rs @@ -1,5 +1,5 @@ +use crate::ir::{ActiveLint, ConfDef, LintData, LintPass, ParsedLints}; use crate::parse::cursor::Cursor; -use crate::parse::{ActiveLint, ConfDef, LintData, LintPass, ParsedLints}; use crate::utils::{FileUpdater, UpdateMode, UpdateStatus, VecBuf, slice_groups, update_text_region_fn}; use core::range::Range; use itertools::Itertools as _; diff --git a/clippy_dev/src/ir.rs b/clippy_dev/src/ir.rs new file mode 100644 index 000000000000..a3e5444a9bbb --- /dev/null +++ b/clippy_dev/src/ir.rs @@ -0,0 +1,249 @@ +use crate::utils::slice_groups_mut; +use crate::{SourceFile, Span}; +use core::fmt::{self, Display}; +use core::ops::{Deref, DerefMut}; +use core::range::Range; +use rustc_data_structures::fx::FxHashMap; + +/// The tool a lint comes from. +#[derive(Clone, Copy, PartialEq, Eq, Hash)] +pub enum LintTool { + Rustc, + Clippy, +} +impl LintTool { + /// Gets the namespace prefix to use when naming a lint including the `::`. + #[must_use] + pub fn prefix(self) -> &'static str { + match self { + Self::Rustc => "", + Self::Clippy => "clippy::", + } + } + + #[must_use] + pub fn from_prefix(s: &str) -> Option { + (s == "clippy").then_some(Self::Clippy) + } +} + +/// The name of a lint and the tool it's from. +#[derive(Clone, Copy, PartialEq, Eq, Hash)] +pub struct LintName<'cx> { + pub tool: LintTool, + pub name: &'cx str, +} +impl<'cx> LintName<'cx> { + #[must_use] + pub fn new_rustc(name: &'cx str) -> Self { + Self { + tool: LintTool::Rustc, + name, + } + } + + #[must_use] + pub fn new_clippy(name: &'cx str) -> Self { + Self { + tool: LintTool::Clippy, + name, + } + } +} +impl Display for LintName<'_> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(self.tool.prefix())?; + f.write_str(self.name) + } +} + +/// The data unique to an active lint. +#[derive(Clone, Copy)] +pub struct ActiveLintData<'cx> { + /// The entire range of the `declare_clippy_lint` macro call. + pub decl_range: Range, + /// The raw text of the documentation comments. May include leading/trailing + /// whitespace and empty lines. + pub docs: &'cx str, + /// The raw text of the line comments. May include leading/trailing whitespace + /// and empty lines. + pub group_comments: &'cx str, + pub group: &'cx str, + /// The raw text of the string literal including the quotation marks. + pub desc: &'cx str, + /// The raw text of any additional `@option` values. Starts at the comma after + /// the description and may include trailing whitespace. + pub opts: &'cx str, +} + +/// The data unique to a deprecated lint. +#[derive(Clone, Copy)] +pub struct DeprecatedLintData<'cx> { + pub reason: &'cx str, +} + +/// The data unique to a renamed lint. +#[derive(Clone, Copy)] +pub struct RenamedLintData<'cx> { + pub new_name: LintName<'cx>, +} + +#[derive(Clone, Copy)] +pub enum LintData<'cx> { + Active(ActiveLintData<'cx>), + Deprecated(DeprecatedLintData<'cx>), + Renamed(RenamedLintData<'cx>), +} + +/// All the data for an active lint, including it's name. +#[derive(Clone, Copy)] +pub struct ActiveLint<'a, 'cx> { + pub name: &'cx str, + pub version: &'cx str, + pub data: &'a ActiveLintData<'cx>, +} + +/// Any declared lint as it's stored in the lint map. Does not include the name. +#[derive(Clone, Copy)] +pub struct Lint<'cx> { + pub name_sp: Span<'cx>, + pub version: &'cx str, + pub data: LintData<'cx>, +} + +/// The macro used to make a lint pass. +#[derive(Clone, Copy)] +pub enum LintPassMac { + Declare, + Impl, +} +impl LintPassMac { + #[must_use] + pub fn name(self) -> &'static str { + match self { + Self::Declare => "declare_lint_pass", + Self::Impl => "impl_lint_pass", + } + } +} + +pub struct LintPass<'cx> { + /// The raw text of the documentation comments. May include leading/trailing + /// whitespace and empty lines. + pub docs: &'cx str, + pub name: &'cx str, + pub lt: Option<&'cx str>, + pub mac: LintPassMac, + pub decl_sp: Span<'cx>, + pub lints: &'cx mut [&'cx str], + pub is_early: bool, + pub is_late: bool, +} + +/// A map from a lint's name to all the other data about it. +pub struct LintMap<'cx>(pub FxHashMap<&'cx str, Lint<'cx>>); +impl<'cx> LintMap<'cx> { + /// Creates a map from each source file to the active lints declared in that file. + #[must_use] + #[expect(clippy::mutable_key_type)] + pub fn mk_by_file_map<'s>(&'s self) -> FxHashMap<&'cx SourceFile<'cx>, Vec>> { + #[expect(clippy::default_trait_access)] + let mut lints = FxHashMap::with_capacity_and_hasher(500, Default::default()); + for (&name, lint) in &self.0 { + if let LintData::Active(lint_data) = &lint.data { + lints + .entry(lint.name_sp.file) + .or_insert_with(|| Vec::with_capacity(8)) + .push(ActiveLint { + name, + version: lint.version, + data: lint_data, + }); + } + } + lints + } + + /// Iterator over all active lints declared in the given file. + pub fn lints_in_file<'s>(&'s self, file: &SourceFile<'_>) -> impl Iterator> { + self.iter().filter_map(move |(&name, lint)| { + if let LintData::Active(data) = &lint.data + && lint.name_sp.file == file + { + Some(ActiveLint { + name, + version: lint.version, + data, + }) + } else { + None + } + }) + } +} +impl<'cx> Deref for LintMap<'cx> { + type Target = FxHashMap<&'cx str, Lint<'cx>>; + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl DerefMut for LintMap<'_> { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} + +/// All lint passes grouped by declaration file. +pub struct LintPasses<'cx>(pub Vec>); +impl<'cx> LintPasses<'cx> { + /// Iterator over all the lint passes chuncked by the declaration file. + pub fn iter_by_file_mut<'s>(&'s mut self) -> impl Iterator]> { + slice_groups_mut(&mut self.0, |head, tail| { + tail.iter().take_while(|&x| x.decl_sp.file == head.decl_sp.file).count() + }) + } + + /// Gets all the lint passes which share a file with the specified pass. + #[must_use] + pub fn all_in_same_file_as_mut<'s>(&'s mut self, i: usize) -> &'s mut [LintPass<'cx>] { + let file = self[i].decl_sp.file; + let pre = self[..i].iter().rev().take_while(|&x| x.decl_sp.file == file).count(); + let post = self[i + 1..].iter().take_while(|&x| x.decl_sp.file == file).count(); + &mut self[i - pre..i + 1 + post] + } +} +impl<'cx> Deref for LintPasses<'cx> { + type Target = Vec>; + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl DerefMut for LintPasses<'_> { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} + +pub struct ParsedLints<'cx> { + pub lints: LintMap<'cx>, + pub lint_passes: LintPasses<'cx>, + pub deprecated_file: &'cx SourceFile<'cx>, +} + +pub struct ConfOpt<'cx> { + pub name: &'cx str, + pub decl_range: Range, + pub lints: &'cx mut [&'cx str], + pub lints_range: Range, +} + +pub struct ConfDef<'cx> { + pub decl_sp: Span<'cx>, + pub opts: Vec>, +} + +#[derive(Clone, Copy)] +pub enum LintPassKind { + Early, + Late, +} diff --git a/clippy_dev/src/lib.rs b/clippy_dev/src/lib.rs index 0e1f985a8ef3..b08851bcc220 100644 --- a/clippy_dev/src/lib.rs +++ b/clippy_dev/src/lib.rs @@ -26,6 +26,7 @@ extern crate termize; pub mod dogfood; pub mod edit_lints; pub mod fmt; +pub mod ir; pub mod lint; pub mod new_lint; pub mod release; diff --git a/clippy_dev/src/new_lint.rs b/clippy_dev/src/new_lint.rs index 467acbb22bc2..94bcf0113f33 100644 --- a/clippy_dev/src/new_lint.rs +++ b/clippy_dev/src/new_lint.rs @@ -1,18 +1,12 @@ use crate::generate::gen_sorted_lints_file; +use crate::ir::{ActiveLint, ActiveLintData, Lint, LintData, LintPass, LintPassKind, LintPassMac}; use crate::parse::cursor::Cursor; -use crate::parse::{ActiveLint, ActiveLintData, Lint, LintData, LintPass, LintPassMac}; use crate::utils::{FileUpdater, VecBuf, Version, create_new_dir}; use crate::{SourceFile, Span, UpdateMode, new_parse_cx}; use rustc_lexer::{DocStyle, TokenKind}; use std::collections::hash_map::Entry; use std::path::{self, MAIN_SEPARATOR_STR as PATH_SEP, PathBuf}; -#[derive(Clone, Copy)] -enum LintPassKind { - Early, - Late, -} - /// Creates the files required to implement and test a new lint and runs `update_lints`. /// /// # Errors @@ -99,7 +93,7 @@ pub fn create(clippy_version: Version, pass: &str, name: &str, group: &str, has_ }; updater.change_loaded_file(file, |src, dst| { let mut lints: Vec<_> = data.lints.lints_in_file(file).collect(); - let passes = data.lint_passes.in_same_file_as_mut(pass_idx); + let passes = data.lint_passes.all_in_same_file_as_mut(pass_idx); let mut ranges = VecBuf::with_capacity(lints.len() + passes.len()); let mut copy = mk_sorted_lints_copy_fn(add_mod, name_snake); gen_sorted_lints_file(src, dst, &mut lints, passes, &mut ranges, &mut copy); diff --git a/clippy_dev/src/parse.rs b/clippy_dev/src/parse.rs index 2de43f08ce7e..484ac1490cd0 100644 --- a/clippy_dev/src/parse.rs +++ b/clippy_dev/src/parse.rs @@ -1,11 +1,12 @@ pub mod cursor; use self::cursor::{Capture, Cursor, IdentPat}; -use crate::utils::{ErrAction, Scoped, StrBuf, VecBuf, expect_action, slice_groups_mut, walk_dir_no_dot_or_target}; +use crate::ir::{ + ActiveLintData, ConfDef, ConfOpt, DeprecatedLintData, Lint, LintData, LintMap, LintName, LintPass, LintPassMac, + LintPasses, LintTool, ParsedLints, RenamedLintData, +}; +use crate::utils::{ErrAction, Scoped, StrBuf, VecBuf, expect_action, walk_dir_no_dot_or_target}; use crate::{DiagCx, SourceFile, Span}; -use core::fmt::{self, Display}; -use core::ops::{Deref, DerefMut}; -use core::range::Range; use rustc_arena::{DroplessArena, TypedArena}; use rustc_data_structures::fx::FxHashMap; use std::collections::hash_map::{Entry, VacantEntry}; @@ -33,114 +34,6 @@ pub fn new_parse_cx<'env, T>(f: impl for<'cx> FnOnce(&'cx mut Scoped<'cx, 'env, })) } -#[derive(Clone, Copy, PartialEq, Eq, Hash)] -pub enum LintTool { - Rustc, - Clippy, -} -impl LintTool { - /// Gets the namespace prefix to use when naming a lint including the `::`. - pub fn prefix(self) -> &'static str { - match self { - Self::Rustc => "", - Self::Clippy => "clippy::", - } - } - - pub fn from_prefix(s: &str) -> Option { - (s == "clippy").then_some(Self::Clippy) - } -} - -#[derive(Clone, Copy, PartialEq, Eq, Hash)] -pub struct LintName<'cx> { - pub tool: LintTool, - pub name: &'cx str, -} -impl<'cx> LintName<'cx> { - pub fn new_rustc(name: &'cx str) -> Self { - Self { - tool: LintTool::Rustc, - name, - } - } - - pub fn new_clippy(name: &'cx str) -> Self { - Self { - tool: LintTool::Clippy, - name, - } - } -} -impl Display for LintName<'_> { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.write_str(self.tool.prefix())?; - f.write_str(self.name) - } -} - -#[derive(Clone, Copy)] -pub struct ActiveLintData<'cx> { - pub decl_range: Range, - /// The raw text of the documentation comments. May include leading/trailing - /// whitespace and empty lines. - pub docs: &'cx str, - /// The raw text of the line comments. May include leading/trailing whitespace - /// and empty lines. - pub group_comments: &'cx str, - pub group: &'cx str, - /// The raw text of the string literal including the quotation marks. - pub desc: &'cx str, - /// The raw text of any additional `@option` values. Starts at the comma after - /// the description and may include trailing whitespace. - pub opts: &'cx str, -} - -#[derive(Clone, Copy)] -pub struct DeprecatedLintData<'cx> { - pub reason: &'cx str, -} - -#[derive(Clone, Copy)] -pub struct RenamedLintData<'cx> { - pub new_name: LintName<'cx>, -} - -#[derive(Clone, Copy)] -pub enum LintData<'cx> { - Active(ActiveLintData<'cx>), - Deprecated(DeprecatedLintData<'cx>), - Renamed(RenamedLintData<'cx>), -} - -#[derive(Clone, Copy)] -pub struct ActiveLint<'a, 'cx> { - pub name: &'cx str, - pub version: &'cx str, - pub data: &'a ActiveLintData<'cx>, -} - -#[derive(Clone, Copy)] -pub struct Lint<'cx> { - pub name_sp: Span<'cx>, - pub version: &'cx str, - pub data: LintData<'cx>, -} - -#[derive(Clone, Copy)] -pub enum LintPassMac { - Declare, - Impl, -} -impl LintPassMac { - pub fn name(self) -> &'static str { - match self { - Self::Declare => "declare_lint_pass", - Self::Impl => "impl_lint_pass", - } - } -} - #[derive(Clone, Copy)] enum ImplTrait { EarlyLintPass, @@ -154,140 +47,32 @@ impl ImplTrait { _ => None, } } -} -pub struct LintPass<'cx> { - /// The raw text of the documentation comments. May include leading/trailing - /// whitespace and empty lines. - pub docs: &'cx str, - pub name: &'cx str, - pub lt: Option<&'cx str>, - pub mac: LintPassMac, - pub decl_sp: Span<'cx>, - pub lints: &'cx mut [&'cx str], - pub is_early: bool, - pub is_late: bool, -} -impl LintPass<'_> { - fn add_trait_impl(&mut self, kind: ImplTrait) { - match kind { - ImplTrait::EarlyLintPass => self.is_early = true, - ImplTrait::LateLintPass => self.is_late = true, + fn add_to_pass(self, pass: &mut LintPass<'_>) { + match self { + Self::EarlyLintPass => pass.is_early = true, + Self::LateLintPass => pass.is_late = true, } } } -pub struct LintMap<'cx>(FxHashMap<&'cx str, Lint<'cx>>); -impl<'cx> LintMap<'cx> { - #[expect(clippy::mutable_key_type)] - pub fn mk_by_file_map<'s>(&'s self) -> FxHashMap<&'cx SourceFile<'cx>, Vec>> { - #[expect(clippy::default_trait_access)] - let mut lints = FxHashMap::with_capacity_and_hasher(500, Default::default()); - for (&name, lint) in &self.0 { - if let LintData::Active(lint_data) = &lint.data { - lints - .entry(lint.name_sp.file) - .or_insert_with(|| Vec::with_capacity(8)) - .push(ActiveLint { - name, - version: lint.version, - data: lint_data, - }); - } - } - lints - } - - pub fn lints_in_file<'s>(&'s self, file: &SourceFile<'_>) -> impl Iterator> { - self.iter().filter_map(move |(&name, lint)| { - if let LintData::Active(data) = &lint.data - && lint.name_sp.file == file - { - Some(ActiveLint { - name, - version: lint.version, - data, - }) - } else { - None - } - }) - } - +impl<'cx> ParseCxImpl<'cx> { #[track_caller] - fn get_vacant_lint<'s>( - &'s mut self, - dcx: &mut DiagCx, + fn get_vacant_lint<'map>( + &mut self, + map: &'map mut LintMap<'cx>, name: &'cx str, name_sp: Span<'cx>, - ) -> Option>> { - match self.0.entry(name) { + ) -> Option>> { + match map.entry(name) { Entry::Vacant(e) => Some(e), Entry::Occupied(e) => { - dcx.emit_duplicate_lint(name_sp, e.get().name_sp); + self.dcx.emit_duplicate_lint(name_sp, e.get().name_sp); None }, } } -} -impl<'cx> Deref for LintMap<'cx> { - type Target = FxHashMap<&'cx str, Lint<'cx>>; - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl DerefMut for LintMap<'_> { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -pub struct LintPasses<'cx>(Vec>); -impl<'cx> LintPasses<'cx> { - pub fn iter_by_file_mut<'s>(&'s mut self) -> impl Iterator]> { - slice_groups_mut(&mut self.0, |head, tail| { - tail.iter().take_while(|&x| x.decl_sp.file == head.decl_sp.file).count() - }) - } - - pub fn in_same_file_as_mut<'s>(&'s mut self, i: usize) -> &'s mut [LintPass<'cx>] { - let file = self[i].decl_sp.file; - let pre = self[..i].iter().rev().take_while(|&x| x.decl_sp.file == file).count(); - let post = self[i + 1..].iter().take_while(|&x| x.decl_sp.file == file).count(); - &mut self[i - pre..i + 1 + post] - } -} -impl<'cx> Deref for LintPasses<'cx> { - type Target = Vec>; - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl DerefMut for LintPasses<'_> { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -pub struct ParsedLints<'cx> { - pub lints: LintMap<'cx>, - pub lint_passes: LintPasses<'cx>, - pub deprecated_file: &'cx SourceFile<'cx>, -} -pub struct ConfOpt<'cx> { - pub name: &'cx str, - pub decl_range: Range, - pub lints: &'cx mut [&'cx str], - pub lints_range: Range, -} - -pub struct ConfDef<'cx> { - pub decl_sp: Span<'cx>, - pub opts: Vec>, -} - -impl<'cx> ParseCxImpl<'cx> { pub fn parse_conf_mac(&mut self) -> ConfDef<'cx> { #[allow(clippy::enum_glob_use)] use cursor::Pat::*; @@ -484,7 +269,7 @@ impl<'cx> ParseCxImpl<'cx> { && let name_sp = name.mk_sp(file) && let name = self.str_buf.alloc_ascii_lower(self.arena, cursor.get_text(name)) && let (Some(e), Some(version)) = ( - data.lints.get_vacant_lint(&mut self.dcx, name, name_sp), + self.get_vacant_lint(&mut data.lints, name, name_sp), self.parse_version(cursor.get_text(version), version.mk_sp(file)), ) { @@ -554,7 +339,7 @@ impl<'cx> ParseCxImpl<'cx> { .iter_mut() .find(|pass| pass.name == impl_ty) { - pass.add_trait_impl(trait_); + trait_.add_to_pass(pass); } else { trait_impls.push((impl_ty, trait_)); } @@ -568,7 +353,7 @@ impl<'cx> ParseCxImpl<'cx> { .iter_mut() .find(|pass| pass.name == impl_ty) { - pass.add_trait_impl(trait_); + trait_.add_to_pass(pass); } } } @@ -622,7 +407,7 @@ impl<'cx> ParseCxImpl<'cx> { self.parse_clippy_lint_name(cursor.get_text(name), name_sp), self.parse_str_lit(cursor.get_text(reason), reason.mk_sp(file)), ) - && let Some(e) = data.lints.get_vacant_lint(&mut self.dcx, name, name_sp) + && let Some(e) = self.get_vacant_lint(&mut data.lints, name, name_sp) { e.insert(Lint { name_sp, @@ -650,7 +435,7 @@ impl<'cx> ParseCxImpl<'cx> { self.parse_clippy_lint_name(cursor.get_text(name), name_sp), self.parse_lint_name(cursor.get_text(new_name), new_name.mk_sp(file)), ) - && let Some(e) = data.lints.get_vacant_lint(&mut self.dcx, name, name_sp) + && let Some(e) = self.get_vacant_lint(&mut data.lints, name, name_sp) { e.insert(Lint { name_sp, From 5238d22064614d5f38ed71fbe73d8a40dd985ee4 Mon Sep 17 00:00:00 2001 From: Jason Newcomb Date: Sun, 1 Mar 2026 16:52:35 -0500 Subject: [PATCH 09/14] `clippy_dev`: Parse lint pass constructors. --- clippy_dev/src/diag.rs | 21 ++-- clippy_dev/src/ir.rs | 116 ++++++++++++++++++++ clippy_dev/src/new_lint.rs | 9 +- clippy_dev/src/parse.rs | 194 +++++++++++++++++++++++++++------ clippy_dev/src/parse/cursor.rs | 72 ++++++++++-- 5 files changed, 355 insertions(+), 57 deletions(-) diff --git a/clippy_dev/src/diag.rs b/clippy_dev/src/diag.rs index 49abd7dad68a..e916d7f66df1 100644 --- a/clippy_dev/src/diag.rs +++ b/clippy_dev/src/diag.rs @@ -52,7 +52,7 @@ impl DiagCx { .with_name("internal error") .primary_title("errors were expected, but failed to occur"), ), - mk_loc_group(), + mk_loc_group(Location::caller()), ]); } process::exit(1); @@ -92,9 +92,7 @@ fn mk_spanned_secondary<'a>(level: Level<'a>, sp: Span<'a>, msg: impl Into Group<'static> { - let loc = Location::caller(); +fn mk_loc_group<'a>(loc: &Location<'a>) -> Group<'a> { Level::INFO.secondary_title("error created here").element( Origin::path(loc.file()) .line(loc.line() as usize) @@ -112,14 +110,21 @@ impl DiagCx { #[track_caller] pub fn emit_spanned_err<'a>(&mut self, sp: Span<'a>, msg: impl Into>) { - self.emit_err(&[mk_spanned_primary(Level::ERROR, sp, msg.into()), mk_loc_group()]); + self.emit_err(&[ + mk_spanned_primary(Level::ERROR, sp, msg.into()), + mk_loc_group(Location::caller()), + ]); + } + + pub fn emit_spanned_err_loc<'a>(&mut self, sp: Span<'a>, msg: impl Into>, loc: &Location<'_>) { + self.emit_err(&[mk_spanned_primary(Level::ERROR, sp, msg.into()), mk_loc_group(loc)]); } #[track_caller] pub fn emit_spanless_err<'a>(&mut self, msg: impl Into>) { self.emit_err(&[ Group::with_title(Level::ERROR.primary_title(msg.into())), - mk_loc_group(), + mk_loc_group(Location::caller()), ]); } @@ -133,7 +138,7 @@ impl DiagCx { self.emit_err(&[ mk_spanned_primary(Level::ERROR, sp, "duplicate lint name declared"), mk_spanned_secondary(Level::NOTE, first_sp, "previous declaration here"), - mk_loc_group(), + mk_loc_group(Location::caller()), ]); } @@ -142,7 +147,7 @@ impl DiagCx { self.emit_err(&[ mk_spanned_primary(Level::ERROR, sp, "not a clippy lint name"), Group::with_title(Level::HELP.secondary_title("add the `clippy::` tool prefix")), - mk_loc_group(), + mk_loc_group(Location::caller()), ]); } diff --git a/clippy_dev/src/ir.rs b/clippy_dev/src/ir.rs index a3e5444a9bbb..20913707aa49 100644 --- a/clippy_dev/src/ir.rs +++ b/clippy_dev/src/ir.rs @@ -3,6 +3,7 @@ use crate::{SourceFile, Span}; use core::fmt::{self, Display}; use core::ops::{Deref, DerefMut}; use core::range::Range; +use core::slice; use rustc_data_structures::fx::FxHashMap; /// The tool a lint comes from. @@ -125,6 +126,120 @@ impl LintPassMac { Self::Impl => "impl_lint_pass", } } + + #[must_use] + pub fn from_has_msrv(has_msrv: bool) -> Self { + if has_msrv { Self::Impl } else { Self::Declare } + } +} + +#[derive(Clone, Copy)] +pub enum LintPassCtorArg { + TyCtxt, + Conf, + FmtArgs, + Attrs, +} +impl LintPassCtorArg { + #[must_use] + #[expect(clippy::should_implement_trait)] + pub fn from_str(s: &str) -> Option { + match s { + "TyCtxt" => Some(Self::TyCtxt), + "Conf" => Some(Self::Conf), + "FormatArgsStorage" => Some(Self::FmtArgs), + "AttrStorage" => Some(Self::Attrs), + _ => None, + } + } +} + +#[derive(Clone, Copy)] +pub struct LintPassCtorArgs { + args: [LintPassCtorArg; 4], + len: u8, +} +#[expect(clippy::trivially_copy_pass_by_ref)] +impl LintPassCtorArgs { + #[must_use] + pub fn new_conf() -> Self { + Self { + args: [LintPassCtorArg::Conf; 4], + len: 1, + } + } + + #[expect(clippy::result_unit_err, clippy::missing_errors_doc)] + pub fn try_push(&mut self, arg: LintPassCtorArg) -> Result<(), ()> { + *self.args.get_mut(self.len as usize).ok_or(())? = arg; + self.len += 1; + Ok(()) + } + + #[must_use] + pub fn has_tcx(&self) -> bool { + self.iter().any(|&x| matches!(x, LintPassCtorArg::TyCtxt)) + } + + #[must_use] + pub fn has_conf(&self) -> bool { + self.iter().any(|&x| matches!(x, LintPassCtorArg::Conf)) + } + + #[must_use] + pub fn has_fmt_args(&self) -> bool { + self.iter().any(|&x| matches!(x, LintPassCtorArg::FmtArgs)) + } + + #[must_use] + pub fn has_attrs(&self) -> bool { + self.iter().any(|&x| matches!(x, LintPassCtorArg::Attrs)) + } + + pub fn iter(&self) -> slice::Iter<'_, LintPassCtorArg> { + self.args[..self.len as usize].iter() + } +} +impl Default for LintPassCtorArgs { + fn default() -> Self { + Self { + args: [LintPassCtorArg::TyCtxt; 4], + len: 0, + } + } +} +impl<'a> IntoIterator for &'a LintPassCtorArgs { + type Item = &'a LintPassCtorArg; + type IntoIter = slice::Iter<'a, LintPassCtorArg>; + + fn into_iter(self) -> Self::IntoIter { + self.iter() + } +} + +/// What constructor to use for a lint pass. +#[derive(Clone, Copy)] +pub enum LintPassCtor { + Unit, + Default, + New(LintPassCtorArgs), +} +impl LintPassCtor { + #[must_use] + pub fn from_has_msrv(has_msrv: bool) -> Self { + if has_msrv { + Self::New(LintPassCtorArgs::new_conf()) + } else { + Self::Unit + } + } + + pub fn add_default(&mut self) { + match self { + Self::Unit => *self = Self::Default, + Self::Default | Self::New(_) => {}, + } + } } pub struct LintPass<'cx> { @@ -136,6 +251,7 @@ pub struct LintPass<'cx> { pub mac: LintPassMac, pub decl_sp: Span<'cx>, pub lints: &'cx mut [&'cx str], + pub ctor: LintPassCtor, pub is_early: bool, pub is_late: bool, } diff --git a/clippy_dev/src/new_lint.rs b/clippy_dev/src/new_lint.rs index 94bcf0113f33..6f0fe1085393 100644 --- a/clippy_dev/src/new_lint.rs +++ b/clippy_dev/src/new_lint.rs @@ -1,5 +1,5 @@ use crate::generate::gen_sorted_lints_file; -use crate::ir::{ActiveLint, ActiveLintData, Lint, LintData, LintPass, LintPassKind, LintPassMac}; +use crate::ir::{ActiveLint, ActiveLintData, Lint, LintData, LintPass, LintPassCtor, LintPassKind, LintPassMac}; use crate::parse::cursor::Cursor; use crate::utils::{FileUpdater, VecBuf, Version, create_new_dir}; use crate::{SourceFile, Span, UpdateMode, new_parse_cx}; @@ -122,13 +122,10 @@ pub fn create(clippy_version: Version, pass: &str, name: &str, group: &str, has_ docs: "", name: name_pascal, lt: None, - mac: if has_msrv { - LintPassMac::Impl - } else { - LintPassMac::Declare - }, + mac: LintPassMac::from_has_msrv(has_msrv), decl_sp: Span::new(file, 0..0), lints: cx.arena.alloc_slice(&[name_upper]), + ctor: LintPassCtor::from_has_msrv(has_msrv), is_early: matches!(new_pass, LintPassKind::Early), is_late: matches!(new_pass, LintPassKind::Late), }, diff --git a/clippy_dev/src/parse.rs b/clippy_dev/src/parse.rs index 484ac1490cd0..4f1fb97ca379 100644 --- a/clippy_dev/src/parse.rs +++ b/clippy_dev/src/parse.rs @@ -1,12 +1,13 @@ pub mod cursor; -use self::cursor::{Capture, Cursor, IdentPat}; +use self::cursor::{Capture, Cursor, IdentPat, UnexpectedErr}; use crate::ir::{ - ActiveLintData, ConfDef, ConfOpt, DeprecatedLintData, Lint, LintData, LintMap, LintName, LintPass, LintPassMac, - LintPasses, LintTool, ParsedLints, RenamedLintData, + ActiveLintData, ConfDef, ConfOpt, DeprecatedLintData, Lint, LintData, LintMap, LintName, LintPass, LintPassCtor, + LintPassCtorArg, LintPassCtorArgs, LintPassMac, LintPasses, LintTool, ParsedLints, RenamedLintData, }; use crate::utils::{ErrAction, Scoped, StrBuf, VecBuf, expect_action, walk_dir_no_dot_or_target}; use crate::{DiagCx, SourceFile, Span}; +use core::panic::Location; use rustc_arena::{DroplessArena, TypedArena}; use rustc_data_structures::fx::FxHashMap; use std::collections::hash_map::{Entry, VacantEntry}; @@ -35,25 +36,35 @@ pub fn new_parse_cx<'env, T>(f: impl for<'cx> FnOnce(&'cx mut Scoped<'cx, 'env, } #[derive(Clone, Copy)] -enum ImplTrait { +enum PassTrait { EarlyLintPass, LateLintPass, + Default, } -impl ImplTrait { +impl PassTrait { fn from_str(s: &str) -> Option { match s { "EarlyLintPass" => Some(Self::EarlyLintPass), "LateLintPass" => Some(Self::LateLintPass), + "Default" => Some(Self::Default), _ => None, } } +} - fn add_to_pass(self, pass: &mut LintPass<'_>) { - match self { - Self::EarlyLintPass => pass.is_early = true, - Self::LateLintPass => pass.is_late = true, - } - } +/// Parsed impl block of a lint pass. +#[derive(Clone, Copy)] +enum PassImplKind { + Trait(PassTrait), + New(LintPassCtorArgs), + UnexpectedErr(UnexpectedErr<'static>), + SpannedErr(Capture, &'static str, &'static Location<'static>), +} + +#[derive(Clone, Copy)] +struct PassImpl<'cx> { + ty: &'cx str, + kind: PassImplKind, } impl<'cx> ParseCxImpl<'cx> { @@ -73,6 +84,19 @@ impl<'cx> ParseCxImpl<'cx> { } } + fn add_impl_to_pass(&mut self, file: &'cx SourceFile<'cx>, impl_: &PassImplKind, pass: &mut LintPass<'_>) { + match impl_ { + PassImplKind::Trait(PassTrait::EarlyLintPass) => pass.is_early = true, + PassImplKind::Trait(PassTrait::LateLintPass) => pass.is_late = true, + PassImplKind::Trait(PassTrait::Default) => pass.ctor.add_default(), + &PassImplKind::New(args) => pass.ctor = LintPassCtor::New(args), + PassImplKind::UnexpectedErr(e) => e.emit(&mut self.dcx, file), + &PassImplKind::SpannedErr(capture, msg, loc) => { + self.dcx.emit_spanned_err_loc(capture.mk_sp(file), msg, loc); + }, + } + } + pub fn parse_conf_mac(&mut self) -> ConfDef<'cx> { #[allow(clippy::enum_glob_use)] use cursor::Pat::*; @@ -161,7 +185,7 @@ impl<'cx> ParseCxImpl<'cx> { }) .and_then(|()| cursor.eat_close_brace().ok_or("`}`")) { - cursor.emit_unexpected(&mut self.dcx, file, expected); + cursor.mk_unexpected_err(expected).emit(&mut self.dcx, file); } data.decl_sp.range.end = cursor.pos(); @@ -228,7 +252,8 @@ impl<'cx> ParseCxImpl<'cx> { let mut cursor = Cursor::new(&file.contents); let mut captures = [Capture::EMPTY; 6]; - let mut trait_impls = Vec::new(); + let mut pass_impls = Vec::new(); + let mut has_derive_default = false; let first_lint_pass = data.lint_passes.len(); while let Some(mac_name) = cursor.find_capture_ident() { @@ -264,7 +289,7 @@ impl<'cx> ParseCxImpl<'cx> { }) .and_then(|()| cursor.eat_close_brace().ok_or("`}`")) { - cursor.emit_unexpected(&mut self.dcx, file, expected); + cursor.mk_unexpected_err(expected).emit(&mut self.dcx, file); } else if let [docs, version, name, group_comments, group, desc] = captures && let name_sp = name.mk_sp(file) && let name = self.str_buf.alloc_ascii_lower(self.arena, cursor.get_text(name)) @@ -307,7 +332,7 @@ impl<'cx> ParseCxImpl<'cx> { cursor.match_all(&[CloseBracket, CloseParen, Semi], &mut []) }) { - cursor.emit_unexpected(&mut self.dcx, file, expected); + cursor.mk_unexpected_err(expected).emit(&mut self.dcx, file); } else { data.lint_passes.push(LintPass { docs: cursor.get_text(captures[0]), @@ -320,44 +345,145 @@ impl<'cx> ParseCxImpl<'cx> { }, decl_sp: Span::new(file, mac_name.pos..cursor.pos()), lints, + ctor: LintPassCtor::Unit, is_early: false, is_late: false, }); } }, - "impl" - if cursor.opt_match_all(&[Lt, Lifetime, Gt], &mut []).is_ok() - && let Some(trait_) = cursor.capture_ident() - && let Some(trait_) = ImplTrait::from_str(cursor.get_text(trait_)) - && cursor.opt_match_all(&[Lt, Lifetime, Gt], &mut []).is_ok() - && cursor - .match_all(&[Ident(IdentPat::r#for), CaptureIdent], &mut captures) - .is_ok() => - { - let impl_ty = cursor.get_text(captures[0]); - if let Some(pass) = data.lint_passes[first_lint_pass..] + "impl" if let Some(impl_) = self.parse_lint_impl(file, &mut cursor) => { + match data.lint_passes[first_lint_pass..] .iter_mut() - .find(|pass| pass.name == impl_ty) + .find(|pass| pass.name == impl_.ty) { - trait_.add_to_pass(pass); - } else { - trait_impls.push((impl_ty, trait_)); + Some(pass) => self.add_impl_to_pass(file, &impl_.kind, pass), + None => pass_impls.push(impl_), + } + }, + "derive" if cursor.eat_open_paren() => { + while let Some(name) = cursor.capture_ident() { + if cursor.get_text(name) == "Default" { + has_derive_default = true; + break; + } + if !cursor.eat_comma() { + break; + } + } + let _ = cursor.find_unnested_close_paren(); + }, + "struct" if has_derive_default => { + has_derive_default = false; + if let Some(ty) = cursor.capture_ident() { + let ty = cursor.get_text(ty); + if let Some(pass) = data.lint_passes[first_lint_pass..] + .iter_mut() + .find(|pass| pass.name == ty) + { + pass.ctor.add_default(); + } else { + pass_impls.push(PassImpl { + ty, + kind: PassImplKind::Trait(PassTrait::Default), + }); + } } }, + "enum" => has_derive_default = false, _ => {}, } } - for &(impl_ty, trait_) in &trait_impls { + for impl_ in &pass_impls { if let Some(pass) = data.lint_passes[first_lint_pass..] .iter_mut() - .find(|pass| pass.name == impl_ty) + .find(|pass| pass.name == impl_.ty) { - trait_.add_to_pass(pass); + self.add_impl_to_pass(file, &impl_.kind, pass); } } } + fn parse_lint_impl(&mut self, file: &'cx SourceFile<'cx>, cursor: &mut Cursor<'cx>) -> Option> { + #[allow(clippy::enum_glob_use)] + use cursor::Pat::*; + + cursor.opt_match_all(&[Lt, Lifetime, Gt], &mut []).ok()?; + let name = cursor.capture_ident().map(|c| cursor.get_text(c))?; + match PassTrait::from_str(name) { + Some(trait_) => { + let pats: &[_] = match trait_ { + PassTrait::LateLintPass => &[Lt, Lifetime, Gt, Ident(IdentPat::r#for)], + PassTrait::EarlyLintPass | PassTrait::Default => &[Ident(IdentPat::r#for)], + }; + if let Err(expected) = cursor.match_all(pats, &mut []) { + cursor.mk_unexpected_err(expected).emit(&mut self.dcx, file); + None + } else { + cursor + .capture_ident() + .filter(|_| { + cursor.opt_match_all(&[Lt, Lifetime, Gt], &mut []).is_ok() && cursor.eat_open_brace() + }) + .map(|name| PassImpl { + ty: cursor.get_text(name), + kind: PassImplKind::Trait(trait_), + }) + } + }, + None if cursor.opt_match_all(&[Lt, Lifetime, Gt], &mut []).is_ok() && cursor.eat_open_brace() => { + while cursor.find_unnested_ident("fn") { + if !cursor.eat_ident("new") { + continue; + } + if !cursor.eat_open_paren() { + return Some(PassImpl { + ty: name, + kind: PassImplKind::UnexpectedErr(cursor.mk_unexpected_err("`(`")), + }); + } + let mut args = LintPassCtorArgs::default(); + let res = cursor.eat_list(|cursor| { + if !cursor.find_unnested_colon() { + return Ok(false); + } + let _ = cursor.eat_and() && cursor.eat_lifetime(); + let Some(ty) = cursor.capture_ident() else { + return Err(PassImplKind::UnexpectedErr(cursor.mk_unexpected_err("an identifier"))); + }; + let Some(arg) = LintPassCtorArg::from_str(cursor.get_text(ty)) else { + return Err(PassImplKind::SpannedErr(ty, "unexpected parameter type, expected `TyCtxt`, `Conf`, `FormatArgsStorage` or `AttrStorage`", Location::caller())); + }; + if args.try_push(arg).is_err() { + return Err(PassImplKind::SpannedErr(ty, "duplicate parameter type", Location::caller())); + } + cursor.eat_list_item(); + Ok(true) + }); + let kind = match res { + Ok(()) => { + match cursor + .eat_close_paren() + .ok_or("`(`") + .and_then(|()| cursor.find_unnested_close_brace().ok_or("`}`")) + { + Ok(()) => PassImplKind::New(args), + Err(expected) => PassImplKind::UnexpectedErr(cursor.mk_unexpected_err(expected)), + } + }, + Err(kind) => { + let _ = cursor.find_unnested_close_paren() && cursor.find_unnested_close_brace(); + kind + }, + }; + return Some(PassImpl { ty: name, kind }); + } + None + }, + None => None, + } + } + fn parse_deprecated_lints(&mut self, data: &mut ParsedLints<'cx>) { #[allow(clippy::enum_glob_use)] use cursor::Pat::*; @@ -447,7 +573,7 @@ impl<'cx> ParseCxImpl<'cx> { }) }) { - cursor.emit_unexpected(&mut self.dcx, file, expected); + cursor.mk_unexpected_err(expected).emit(&mut self.dcx, file); } } diff --git a/clippy_dev/src/parse/cursor.rs b/clippy_dev/src/parse/cursor.rs index 490d1dbe4e42..37edb4d12834 100644 --- a/clippy_dev/src/parse/cursor.rs +++ b/clippy_dev/src/parse/cursor.rs @@ -1,5 +1,7 @@ use crate::utils::{StrBuf, VecBuf}; use crate::{DiagCx, SourceFile, Span}; +use core::panic::Location; +use core::range::Range; use core::{ptr, slice}; use rustc_arena::DroplessArena; use rustc_lexer::{self as lex, DocStyle, LiteralKind, Token, TokenKind, is_whitespace}; @@ -120,6 +122,24 @@ impl Capture { } } +#[derive(Clone, Copy)] +pub struct UnexpectedErr<'a> { + loc: &'static Location<'static>, + expected: &'a str, + range: Range, + is_eof: bool, +} +impl UnexpectedErr<'_> { + pub fn emit<'a>(&self, dcx: &mut DiagCx, file: &'a SourceFile<'a>) { + let msg = if self.is_eof { "end of file" } else { "token" }; + dcx.emit_spanned_err_loc( + Span::new(file, self.range), + format!("unexpected {msg}, expected {}", self.expected), + self.loc, + ); + } +} + /// A unidirectional cursor over a token stream that is lexed on demand. pub struct Cursor<'txt> { next_token: Token, @@ -191,15 +211,15 @@ impl<'txt> Cursor<'txt> { self.next_token = self.inner.advance_token(); } + #[must_use] #[track_caller] - pub fn emit_unexpected<'cx>(&self, dcx: &mut DiagCx, file: &'cx SourceFile<'cx>, expected: &'static str) { - let sp = Span::new(file, self.pos..self.pos + self.next_token.len); - let msg = if matches!(self.next_token.kind, TokenKind::Eof) { - "end of file" - } else { - "token" - }; - dcx.emit_spanned_err(sp, format!("unexpected {msg}, expected {expected}")); + pub fn mk_unexpected_err<'a>(&self, expected: &'a str) -> UnexpectedErr<'a> { + UnexpectedErr { + loc: Location::caller(), + expected, + range: self.pos..self.pos + self.next_token.len, + is_eof: matches!(self.next_token.kind, TokenKind::Eof), + } } /// Consumes tokens until the given pattern is either fully matched of fails to match. @@ -400,7 +420,7 @@ impl<'txt> Cursor<'txt> { }) } - pub fn eat_list(&mut self, mut f: impl FnMut(&mut Self) -> Result) -> Result<(), &'static str> { + pub fn eat_list(&mut self, mut f: impl FnMut(&mut Self) -> Result) -> Result<(), Err> { while f(self)? { if !self.eat_comma() { break; @@ -626,6 +646,34 @@ macro_rules! mk_tk_methods { } } + #[doc = "Consumes all tokens at the current nesting level up to and including "] + #[doc = $desc] + #[doc = " and returns whether the token was found. Any tokens at a deeper nesting level"] + #[doc = "will be skipped without matching."] + #[doc = ""] + #[doc = "Only `()`, `[]`, and `{}` are considered for nesting, `<>` are never be considered."] + #[doc = "If the end of the current level is found the closing bracket will not be consumed."] + #[must_use] + pub fn ${concat(find_unnested_, $name)}(&mut $self $($params)*) -> bool { + let mut depth = 0u32; + loop { + match $self.next_token.kind { + TokenKind::Eof => return false, + $pat if depth == 0 $(&& $guard)? => { + $self.step(); + return true; + }, + TokenKind::OpenBrace | TokenKind::OpenBracket | TokenKind::OpenParen => depth += 1, + TokenKind::CloseBrace | TokenKind::CloseBracket | TokenKind::CloseParen if depth == 0 => { + return false; + }, + TokenKind::CloseBrace | TokenKind::CloseBracket | TokenKind::CloseParen => depth -= 1, + _ => {}, + } + $self.step(); + } + } + #[doc = "Consumes all tokens up to and including "] #[doc = $desc] #[doc = " and returns whether the token was found."] @@ -646,12 +694,16 @@ macro_rules! mk_tk_methods { } } mk_tk_methods! { + ["`&`"] + and(&mut self) { TokenKind::And } ["`!`"] bang(&mut self) { TokenKind::Bang } ["`}`"] close_brace(&mut self) { TokenKind::CloseBrace } ["`]`"] close_bracket(&mut self) { TokenKind::CloseBracket } + ["`)`"] + close_paren(&mut self) { TokenKind::CloseParen } ["`:`"] colon(&mut self) { TokenKind::Colon } ["`,`"] @@ -664,6 +716,8 @@ mk_tk_methods! { eq(&mut self) { TokenKind::Eq } ["the specified identifier"] ident(&mut self, s: &str) { TokenKind::Ident if self.peek_text() == s } + ["a lifetime"] + lifetime(&mut self) { TokenKind::Lifetime { .. } } ["`{`"] open_brace(&mut self) { TokenKind::OpenBrace } ["`[`"] From 60c9536fa15473098c34bace23f0c4df046e0a33 Mon Sep 17 00:00:00 2001 From: Jason Newcomb Date: Sat, 29 Aug 2026 15:29:33 -0400 Subject: [PATCH 10/14] `clippy_dev`: Store the uppercase name when parsing lint declarations. --- clippy_dev/src/generate.rs | 26 ++++++++++---------------- clippy_dev/src/ir.rs | 2 ++ clippy_dev/src/new_lint.rs | 1 + clippy_dev/src/parse.rs | 4 +++- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/clippy_dev/src/generate.rs b/clippy_dev/src/generate.rs index 2eee9dd87ed2..b3d07ab207e9 100644 --- a/clippy_dev/src/generate.rs +++ b/clippy_dev/src/generate.rs @@ -40,7 +40,7 @@ impl ParsedLints<'_> { let mut renamed = Vec::with_capacity(lints.len() / 8); for &(name, lint) in &lints { match &lint.data { - LintData::Active(_) => active.push((name, lint.name_sp.file.path_as_krate_mod())), + LintData::Active(data) => active.push((data.name_upper, lint.name_sp.file.path_as_krate_mod())), LintData::Deprecated(data) => deprecated.push((name, lint.version, data.reason)), LintData::Renamed(data) => renamed.push((name, lint.version, data.new_name)), } @@ -147,17 +147,12 @@ impl ParsedLints<'_> { &mut |_, src, dst| { dst.push_str(GENERATED_FILE_COMMENT); dst.push_str("pub static LINTS: &[&::declare_clippy_lint::LintInfo] = &[\n"); - let mut buf = String::new(); for &(name, (_, mod_path)) in lints { dst.push_str(" crate::"); for part in mod_path.split(path::MAIN_SEPARATOR) { - dst.push_str(part); - dst.push_str("::"); + dst.extend([part, "::"]); } - buf.clear(); - buf.push_str(name); - buf.make_ascii_uppercase(); - let _ = writeln!(dst, "{buf}_INFO,"); + dst.extend([name, "_INFO,\n"]); } dst.push_str("];\n"); UpdateStatus::from_changed(src != dst) @@ -171,14 +166,13 @@ impl ActiveLint<'_, '_> { pub fn gen_mac(&self, dst: &mut String) { dst.push_str("declare_clippy_lint! {"); write_comment_lines(self.data.docs, "\n ", dst); - dst.extend(["\n #[clippy::version = \"", self.version, "\"]\n pub "]); - - // Lint names are stored in lower case, but the declaration needs to be upper case. - let name_pos = dst.len(); - dst.push_str(self.name); - dst[name_pos..].make_ascii_uppercase(); - dst.push(','); - + dst.extend([ + "\n #[clippy::version = \"", + self.version, + "\"]\n pub ", + self.data.name_upper, + ",", + ]); write_comment_lines(self.data.group_comments, "\n ", dst); dst.extend(["\n ", self.data.group, ",\n ", self.data.desc]); if !self.data.opts.is_empty() { diff --git a/clippy_dev/src/ir.rs b/clippy_dev/src/ir.rs index 20913707aa49..29a21dd0209f 100644 --- a/clippy_dev/src/ir.rs +++ b/clippy_dev/src/ir.rs @@ -63,6 +63,8 @@ impl Display for LintName<'_> { pub struct ActiveLintData<'cx> { /// The entire range of the `declare_clippy_lint` macro call. pub decl_range: Range, + /// The uppercase form of the lint name. + pub name_upper: &'cx str, /// The raw text of the documentation comments. May include leading/trailing /// whitespace and empty lines. pub docs: &'cx str, diff --git a/clippy_dev/src/new_lint.rs b/clippy_dev/src/new_lint.rs index 6f0fe1085393..18f723b7dd9a 100644 --- a/clippy_dev/src/new_lint.rs +++ b/clippy_dev/src/new_lint.rs @@ -52,6 +52,7 @@ pub fn create(clippy_version: Version, pass: &str, name: &str, group: &str, has_ let version = cx.str_buf.alloc_display(cx.arena, clippy_version.rust_display()); let mut lint_data = ActiveLintData { decl_range: 0..0, + name_upper, docs: if group == "restriction" { RESTRICTION_DESC } else { diff --git a/clippy_dev/src/parse.rs b/clippy_dev/src/parse.rs index 4f1fb97ca379..fabd0fba3952 100644 --- a/clippy_dev/src/parse.rs +++ b/clippy_dev/src/parse.rs @@ -292,7 +292,8 @@ impl<'cx> ParseCxImpl<'cx> { cursor.mk_unexpected_err(expected).emit(&mut self.dcx, file); } else if let [docs, version, name, group_comments, group, desc] = captures && let name_sp = name.mk_sp(file) - && let name = self.str_buf.alloc_ascii_lower(self.arena, cursor.get_text(name)) + && let name_upper = cursor.get_text(name) + && let name = self.str_buf.alloc_ascii_lower(self.arena, name_upper) && let (Some(e), Some(version)) = ( self.get_vacant_lint(&mut data.lints, name, name_sp), self.parse_version(cursor.get_text(version), version.mk_sp(file)), @@ -303,6 +304,7 @@ impl<'cx> ParseCxImpl<'cx> { version, data: LintData::Active(ActiveLintData { decl_range: mac_name.pos..cursor.pos(), + name_upper, docs: cursor.get_text(docs), group_comments: cursor.get_text(group_comments), group: cursor.get_text(group), From e05e233dfaa1c0a3ad6ad94280ebb9b193bbe068 Mon Sep 17 00:00:00 2001 From: Jason Newcomb Date: Tue, 3 Mar 2026 00:15:32 -0500 Subject: [PATCH 11/14] Make all lint passes public. --- clippy_lints/src/format_push_string.rs | 4 ++-- clippy_lints/src/mut_mut.rs | 2 +- clippy_lints/src/non_canonical_impls.rs | 4 ++-- clippy_lints/src/shadow.rs | 2 +- clippy_lints/src/to_digit_is_some.rs | 4 ++-- clippy_lints/src/unwrap.rs | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/clippy_lints/src/format_push_string.rs b/clippy_lints/src/format_push_string.rs index 9008e9d0a5cd..34a504ba79b0 100644 --- a/clippy_lints/src/format_push_string.rs +++ b/clippy_lints/src/format_push_string.rs @@ -44,7 +44,7 @@ declare_clippy_lint! { impl_lint_pass!(FormatPushString => [FORMAT_PUSH_STRING]); -pub(crate) struct FormatPushString { +pub struct FormatPushString { format_args: FormatArgsStorage, } @@ -69,7 +69,7 @@ enum FormatSearchResults { } impl FormatPushString { - pub(crate) fn new(format_args: FormatArgsStorage) -> Self { + pub fn new(format_args: FormatArgsStorage) -> Self { Self { format_args } } diff --git a/clippy_lints/src/mut_mut.rs b/clippy_lints/src/mut_mut.rs index 3b83a9ecd55c..93bb420e114c 100644 --- a/clippy_lints/src/mut_mut.rs +++ b/clippy_lints/src/mut_mut.rs @@ -40,7 +40,7 @@ declare_clippy_lint! { impl_lint_pass!(MutMut => [MUT_MUT]); #[derive(Default)] -pub(crate) struct MutMut { +pub struct MutMut { skip_id: Option, } diff --git a/clippy_lints/src/non_canonical_impls.rs b/clippy_lints/src/non_canonical_impls.rs index a9b601bbf46a..c7920bf8d573 100644 --- a/clippy_lints/src/non_canonical_impls.rs +++ b/clippy_lints/src/non_canonical_impls.rs @@ -121,7 +121,7 @@ impl_lint_pass!(NonCanonicalImpls => [ reason = "`_trait` suffix is meaningful on its own, \ and creating an inner `StoredTraits` struct would just add a level of indirection" )] -pub(crate) struct NonCanonicalImpls { +pub struct NonCanonicalImpls { partial_ord_trait: Option, ord_trait: Option, clone_trait: Option, @@ -129,7 +129,7 @@ pub(crate) struct NonCanonicalImpls { } impl NonCanonicalImpls { - pub(crate) fn new(tcx: TyCtxt<'_>) -> Self { + pub fn new(tcx: TyCtxt<'_>) -> Self { let lang_items = tcx.lang_items(); Self { partial_ord_trait: lang_items.partial_ord_trait(), diff --git a/clippy_lints/src/shadow.rs b/clippy_lints/src/shadow.rs index 427cf180adf2..3b6e6b15d1a1 100644 --- a/clippy_lints/src/shadow.rs +++ b/clippy_lints/src/shadow.rs @@ -108,7 +108,7 @@ declare_clippy_lint! { impl_lint_pass!(Shadow => [SHADOW_REUSE, SHADOW_SAME, SHADOW_UNRELATED]); #[derive(Default)] -pub(crate) struct Shadow { +pub struct Shadow { bindings: Vec<(FxHashMap>, LocalDefId)>, } diff --git a/clippy_lints/src/to_digit_is_some.rs b/clippy_lints/src/to_digit_is_some.rs index bf716cde4668..5f6c63af1b5f 100644 --- a/clippy_lints/src/to_digit_is_some.rs +++ b/clippy_lints/src/to_digit_is_some.rs @@ -36,12 +36,12 @@ declare_clippy_lint! { impl_lint_pass!(ToDigitIsSome => [TO_DIGIT_IS_SOME]); -pub(crate) struct ToDigitIsSome { +pub struct ToDigitIsSome { msrv: Msrv, } impl ToDigitIsSome { - pub(crate) fn new(conf: &'static Conf) -> Self { + pub fn new(conf: &'static Conf) -> Self { Self { msrv: conf.msrv.into() } } } diff --git a/clippy_lints/src/unwrap.rs b/clippy_lints/src/unwrap.rs index 9266fe4fe89a..9c425c5e02e4 100644 --- a/clippy_lints/src/unwrap.rs +++ b/clippy_lints/src/unwrap.rs @@ -81,7 +81,7 @@ declare_clippy_lint! { impl_lint_pass!(Unwrap => [PANICKING_UNWRAP, UNNECESSARY_UNWRAP]); -pub(crate) struct Unwrap { +pub struct Unwrap { msrv: Msrv, } From a2bd7d5274c4e004c05650df2e5bd69426e50edd Mon Sep 17 00:00:00 2001 From: Jason Newcomb Date: Sat, 29 Aug 2026 19:48:38 -0400 Subject: [PATCH 12/14] Allow some lints in unrelated tests. --- tests/ui/len_without_is_empty.rs | 8 +-- tests/ui/len_without_is_empty.stderr | 68 +++++-------------- tests/ui/needless_bool_assign.fixed | 4 +- tests/ui/needless_bool_assign.rs | 4 +- tests/ui/needless_bool_assign.stderr | 28 ++------ tests/ui/nonminimal_bool.rs | 10 +-- tests/ui/nonminimal_bool.stderr | 97 ++++++++-------------------- tests/ui/string_add_assign.fixed | 22 ------- tests/ui/string_add_assign.rs | 7 +- tests/ui/string_add_assign.stderr | 19 +----- 10 files changed, 59 insertions(+), 208 deletions(-) delete mode 100644 tests/ui/string_add_assign.fixed diff --git a/tests/ui/len_without_is_empty.rs b/tests/ui/len_without_is_empty.rs index da57fdb2740e..65afc6980d55 100644 --- a/tests/ui/len_without_is_empty.rs +++ b/tests/ui/len_without_is_empty.rs @@ -1,4 +1,5 @@ #![warn(clippy::len_without_is_empty)] +#![expect(clippy::result_unit_err)] pub struct PubOne; @@ -240,7 +241,6 @@ pub struct ResultLen; impl ResultLen { pub fn len(&self) -> Result { //~^ len_without_is_empty - //~| result_unit_err Ok(0) } @@ -254,14 +254,10 @@ impl ResultLen { pub struct ResultLen2; impl ResultLen2 { pub fn len(&self) -> Result { - //~^ result_unit_err - Ok(0) } pub fn is_empty(&self) -> Result { - //~^ result_unit_err - Ok(true) } } @@ -269,8 +265,6 @@ impl ResultLen2 { pub struct ResultLen3; impl ResultLen3 { pub fn len(&self) -> Result { - //~^ result_unit_err - Ok(0) } diff --git a/tests/ui/len_without_is_empty.stderr b/tests/ui/len_without_is_empty.stderr index 27c5c3569b06..bb4437aa6c15 100644 --- a/tests/ui/len_without_is_empty.stderr +++ b/tests/ui/len_without_is_empty.stderr @@ -1,5 +1,5 @@ error: struct `PubOne` has a public `len` method, but no `is_empty` method - --> tests/ui/len_without_is_empty.rs:6:5 + --> tests/ui/len_without_is_empty.rs:7:5 | LL | pub fn len(&self) -> isize { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | pub fn len(&self) -> isize { = help: to override `-D warnings` add `#[allow(clippy::len_without_is_empty)]` error: trait `PubTraitsToo` has a `len` method but no (possibly inherited) `is_empty` method - --> tests/ui/len_without_is_empty.rs:56:1 + --> tests/ui/len_without_is_empty.rs:57:1 | LL | / pub trait PubTraitsToo { LL | | @@ -18,45 +18,45 @@ LL | | } | |_^ error: struct `HasIsEmpty` has a public `len` method, but a private `is_empty` method - --> tests/ui/len_without_is_empty.rs:71:5 + --> tests/ui/len_without_is_empty.rs:72:5 | LL | pub fn len(&self) -> isize { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: `is_empty` defined here - --> tests/ui/len_without_is_empty.rs:77:5 + --> tests/ui/len_without_is_empty.rs:78:5 | LL | fn is_empty(&self) -> bool { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: struct `HasWrongIsEmpty` has a public `len` method, but the `is_empty` method has an unexpected signature - --> tests/ui/len_without_is_empty.rs:85:5 + --> tests/ui/len_without_is_empty.rs:86:5 | LL | pub fn len(&self) -> isize { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: `is_empty` defined here - --> tests/ui/len_without_is_empty.rs:91:5 + --> tests/ui/len_without_is_empty.rs:92:5 | LL | pub fn is_empty(&self, x: u32) -> bool { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: expected signature: `(&self) -> bool` error: struct `MismatchedSelf` has a public `len` method, but the `is_empty` method has an unexpected signature - --> tests/ui/len_without_is_empty.rs:99:5 + --> tests/ui/len_without_is_empty.rs:100:5 | LL | pub fn len(self) -> isize { | ^^^^^^^^^^^^^^^^^^^^^^^^^ | note: `is_empty` defined here - --> tests/ui/len_without_is_empty.rs:105:5 + --> tests/ui/len_without_is_empty.rs:106:5 | LL | pub fn is_empty(&self) -> bool { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: expected signature: `(self) -> bool` error: trait `DependsOnFoo` has a `len` method but no (possibly inherited) `is_empty` method - --> tests/ui/len_without_is_empty.rs:180:1 + --> tests/ui/len_without_is_empty.rs:181:1 | LL | / pub trait DependsOnFoo: Foo { LL | | @@ -66,20 +66,20 @@ LL | | } | |_^ error: struct `OptionalLen3` has a public `len` method, but the `is_empty` method has an unexpected signature - --> tests/ui/len_without_is_empty.rs:227:5 + --> tests/ui/len_without_is_empty.rs:228:5 | LL | pub fn len(&self) -> usize { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: `is_empty` defined here - --> tests/ui/len_without_is_empty.rs:234:5 + --> tests/ui/len_without_is_empty.rs:235:5 | LL | pub fn is_empty(&self) -> Option { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: expected signature: `(&self) -> bool` error: struct `ResultLen` has a public `len` method, but the `is_empty` method has an unexpected signature - --> tests/ui/len_without_is_empty.rs:241:5 + --> tests/ui/len_without_is_empty.rs:242:5 | LL | pub fn len(&self) -> Result { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -91,63 +91,29 @@ LL | pub fn is_empty(&self) -> Option { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: expected signature: `(&self) -> bool` or `(&self) -> Result -error: this returns a `Result<_, ()>` - --> tests/ui/len_without_is_empty.rs:241:5 - | -LL | pub fn len(&self) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: use a custom `Error` type instead - = note: `-D clippy::result-unit-err` implied by `-D warnings` - = help: to override `-D warnings` add `#[allow(clippy::result_unit_err)]` - -error: this returns a `Result<_, ()>` - --> tests/ui/len_without_is_empty.rs:256:5 - | -LL | pub fn len(&self) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: use a custom `Error` type instead - -error: this returns a `Result<_, ()>` - --> tests/ui/len_without_is_empty.rs:262:5 - | -LL | pub fn is_empty(&self) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: use a custom `Error` type instead - -error: this returns a `Result<_, ()>` - --> tests/ui/len_without_is_empty.rs:271:5 - | -LL | pub fn len(&self) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: use a custom `Error` type instead - error: struct `AsyncLenWithoutIsEmpty` has a public `len` method, but no `is_empty` method - --> tests/ui/len_without_is_empty.rs:314:5 + --> tests/ui/len_without_is_empty.rs:308:5 | LL | pub async fn len(&self) -> usize { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: struct `AsyncOptionLenWithoutIsEmpty` has a public `len` method, but no `is_empty` method - --> tests/ui/len_without_is_empty.rs:328:5 + --> tests/ui/len_without_is_empty.rs:322:5 | LL | pub async fn len(&self) -> Option { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: struct `AsyncResultLenWithoutIsEmpty` has a public `len` method, but no `is_empty` method - --> tests/ui/len_without_is_empty.rs:352:5 + --> tests/ui/len_without_is_empty.rs:346:5 | LL | pub async fn len(&self) -> Result { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: type `Alias2` has a public `len` method, but no `is_empty` method - --> tests/ui/len_without_is_empty.rs:470:5 + --> tests/ui/len_without_is_empty.rs:464:5 | LL | pub fn len(&self) -> usize { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 16 previous errors +error: aborting due to 12 previous errors diff --git a/tests/ui/needless_bool_assign.fixed b/tests/ui/needless_bool_assign.fixed index 3bd592b471e4..5273b3acf27d 100644 --- a/tests/ui/needless_bool_assign.fixed +++ b/tests/ui/needless_bool_assign.fixed @@ -1,4 +1,5 @@ #![warn(clippy::needless_bool_assign)] +#![allow(clippy::if_same_then_else)] fn random() -> bool { true @@ -23,8 +24,7 @@ fn main() { // This one also triggers lint `clippy::if_same_then_else` // which does not suggest a rewrite. random(); a.field = true; - //~^^^^^ if_same_then_else - //~| needless_bool_assign + //~^^^^^ needless_bool_assign let mut b = false; if random() { a.field = false; diff --git a/tests/ui/needless_bool_assign.rs b/tests/ui/needless_bool_assign.rs index 1279176cb20a..dd1a45a9332c 100644 --- a/tests/ui/needless_bool_assign.rs +++ b/tests/ui/needless_bool_assign.rs @@ -1,4 +1,5 @@ #![warn(clippy::needless_bool_assign)] +#![allow(clippy::if_same_then_else)] fn random() -> bool { true @@ -35,8 +36,7 @@ fn main() { } else { a.field = true; } - //~^^^^^ if_same_then_else - //~| needless_bool_assign + //~^^^^^ needless_bool_assign let mut b = false; if random() { a.field = false; diff --git a/tests/ui/needless_bool_assign.stderr b/tests/ui/needless_bool_assign.stderr index 3dfea7cd1af9..c9f161621253 100644 --- a/tests/ui/needless_bool_assign.stderr +++ b/tests/ui/needless_bool_assign.stderr @@ -1,5 +1,5 @@ error: this if-then-else expression assigns a bool literal - --> tests/ui/needless_bool_assign.rs:12:5 + --> tests/ui/needless_bool_assign.rs:13:5 | LL | / if random() && random() { LL | | a.field = true; @@ -12,7 +12,7 @@ LL | | } = help: to override `-D warnings` add `#[allow(clippy::needless_bool_assign)]` error: this if-then-else expression assigns a bool literal - --> tests/ui/needless_bool_assign.rs:18:5 + --> tests/ui/needless_bool_assign.rs:19:5 | LL | / if random() && random() { LL | | a.field = false; @@ -22,7 +22,7 @@ LL | | } | |_____^ help: you can reduce it to: `a.field = !(random() && random());` error: this if-then-else expression assigns a bool literal - --> tests/ui/needless_bool_assign.rs:33:5 + --> tests/ui/needless_bool_assign.rs:34:5 | LL | / if random() { LL | | a.field = true; @@ -31,26 +31,6 @@ LL | | a.field = true; LL | | } | |_____^ help: you can reduce it to: `random(); a.field = true;` -error: this `if` has identical blocks - --> tests/ui/needless_bool_assign.rs:33:17 - | -LL | if random() { - | _________________^ -LL | | a.field = true; -LL | | } else { - | |_____^ - | -note: same as this - --> tests/ui/needless_bool_assign.rs:35:12 - | -LL | } else { - | ____________^ -LL | | a.field = true; -LL | | } - | |_____^ - = note: `-D clippy::if-same-then-else` implied by `-D warnings` - = help: to override `-D warnings` add `#[allow(clippy::if_same_then_else)]` - error: this if-then-else expression assigns a bool literal --> tests/ui/needless_bool_assign.rs:53:12 | @@ -72,5 +52,5 @@ LL | | dot_0!(skip) = true; LL | | } | |_____^ help: you can reduce it to: `dot_0!(skip) = !invoke!(must_keep, x, y);` -error: aborting due to 6 previous errors +error: aborting due to 5 previous errors diff --git a/tests/ui/nonminimal_bool.rs b/tests/ui/nonminimal_bool.rs index 0ce41d3ac5dc..567efd549705 100644 --- a/tests/ui/nonminimal_bool.rs +++ b/tests/ui/nonminimal_bool.rs @@ -1,7 +1,9 @@ //@no-rustfix: overlapping suggestions #![warn(clippy::nonminimal_bool)] #![expect( + clippy::bool_comparison, clippy::diverging_sub_expression, + clippy::needless_bool, clippy::needless_ifs, clippy::redundant_pattern_matching )] @@ -66,7 +68,6 @@ fn issue3847(a: u32, b: u32) -> bool { return false; } true - //~^^^^ needless_bool } fn issue4548() { @@ -181,16 +182,12 @@ fn issue_5794() { let c = false; if !b == true {} //~^ nonminimal_bool - //~| bool_comparison if !b != true {} //~^ nonminimal_bool - //~| bool_comparison if true == !b {} //~^ nonminimal_bool - //~| bool_comparison if true != !b {} //~^ nonminimal_bool - //~| bool_comparison if !b == !c {} //~^ nonminimal_bool if !b != !c {} @@ -246,9 +243,6 @@ fn dont_simplify_double_not_if_types_differ() { } // The lint must propose `if !!S`, not `if S`. - // FIXME: `bool_comparison` will propose to use `S == true` - // which is invalid. if !S != true {} //~^ nonminimal_bool - //~| bool_comparison } diff --git a/tests/ui/nonminimal_bool.stderr b/tests/ui/nonminimal_bool.stderr index dd8348c3cbf6..76ca7629872d 100644 --- a/tests/ui/nonminimal_bool.stderr +++ b/tests/ui/nonminimal_bool.stderr @@ -1,5 +1,5 @@ error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:16:13 + --> tests/ui/nonminimal_bool.rs:18:13 | LL | let _ = !true; | ^^^^^ @@ -13,7 +13,7 @@ LL + let _ = false; | error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:19:13 + --> tests/ui/nonminimal_bool.rs:21:13 | LL | let _ = !false; | ^^^^^^ @@ -25,7 +25,7 @@ LL + let _ = true; | error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:22:13 + --> tests/ui/nonminimal_bool.rs:24:13 | LL | let _ = !!a; | ^^^ @@ -37,7 +37,7 @@ LL + let _ = a; | error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:25:13 + --> tests/ui/nonminimal_bool.rs:27:13 | LL | let _ = false || a; | ^^^^^^^^^^ @@ -49,7 +49,7 @@ LL + let _ = a; | error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:31:13 + --> tests/ui/nonminimal_bool.rs:33:13 | LL | let _ = !(!a && b); | ^^^^^^^^^^ @@ -61,7 +61,7 @@ LL + let _ = a || !b; | error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:34:13 + --> tests/ui/nonminimal_bool.rs:36:13 | LL | let _ = !(!a || b); | ^^^^^^^^^^ @@ -73,7 +73,7 @@ LL + let _ = a && !b; | error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:37:13 + --> tests/ui/nonminimal_bool.rs:39:13 | LL | let _ = !a && !(b && c); | ^^^^^^^^^^^^^^^ @@ -85,7 +85,7 @@ LL + let _ = !(a || b && c); | error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:46:13 + --> tests/ui/nonminimal_bool.rs:48:13 | LL | let _ = a == b && c == 5 && a == b; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -100,7 +100,7 @@ LL + let _ = a == b && c == 5; | error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:49:13 + --> tests/ui/nonminimal_bool.rs:51:13 | LL | let _ = a == b || c == 5 || a == b; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -115,7 +115,7 @@ LL + let _ = a == b || c == 5; | error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:52:13 + --> tests/ui/nonminimal_bool.rs:54:13 | LL | let _ = a == b && c == 5 && b == a; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -130,7 +130,7 @@ LL + let _ = a == b && c == 5; | error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:55:13 + --> tests/ui/nonminimal_bool.rs:57:13 | LL | let _ = a != b || !(a != b || c == d); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -145,7 +145,7 @@ LL + let _ = a != b || c != d; | error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:58:13 + --> tests/ui/nonminimal_bool.rs:60:13 | LL | let _ = a != b && !(a != b && c == d); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -159,20 +159,8 @@ LL - let _ = a != b && !(a != b && c == d); LL + let _ = a != b && c != d; | -error: this `if` guard returns a bool literal and is followed by another - --> tests/ui/nonminimal_bool.rs:65:5 - | -LL | / if a < THRESHOLD && b >= THRESHOLD || a >= THRESHOLD && b < THRESHOLD { -LL | | return false; -LL | | } -LL | | true - | |________^ help: you can reduce it to: `!(a < THRESHOLD && b >= THRESHOLD || a >= THRESHOLD && b < THRESHOLD)` - | - = note: `-D clippy::needless-bool` implied by `-D warnings` - = help: to override `-D warnings` add `#[allow(clippy::needless_bool)]` - error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:90:8 + --> tests/ui/nonminimal_bool.rs:91:8 | LL | if matches!(true, true) && true { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -184,94 +172,67 @@ LL + if matches!(true, true) { | error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:171:8 + --> tests/ui/nonminimal_bool.rs:172:8 | LL | if !(12 == a) {} | ^^^^^^^^^^ help: try: `(12 != a)` error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:173:8 + --> tests/ui/nonminimal_bool.rs:174:8 | LL | if !(a == 12) {} | ^^^^^^^^^^ help: try: `(a != 12)` error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:175:8 + --> tests/ui/nonminimal_bool.rs:176:8 | LL | if !(12 != a) {} | ^^^^^^^^^^ help: try: `(12 == a)` error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:177:8 + --> tests/ui/nonminimal_bool.rs:178:8 | LL | if !(a != 12) {} | ^^^^^^^^^^ help: try: `(a == 12)` error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:182:8 + --> tests/ui/nonminimal_bool.rs:183:8 | LL | if !b == true {} | ^^^^^^^^^^ help: try: `b != true` -error: equality checks against true are unnecessary - --> tests/ui/nonminimal_bool.rs:182:8 - | -LL | if !b == true {} - | ^^^^^^^^^^ help: try: `!b` - | - = note: `-D clippy::bool-comparison` implied by `-D warnings` - = help: to override `-D warnings` add `#[allow(clippy::bool_comparison)]` - error: this boolean expression can be simplified --> tests/ui/nonminimal_bool.rs:185:8 | LL | if !b != true {} | ^^^^^^^^^^ help: try: `b == true` -error: inequality checks against true can be replaced by a negation - --> tests/ui/nonminimal_bool.rs:185:8 - | -LL | if !b != true {} - | ^^^^^^^^^^ help: try: `b` - error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:188:8 + --> tests/ui/nonminimal_bool.rs:187:8 | LL | if true == !b {} | ^^^^^^^^^^ help: try: `true != b` -error: equality checks against true are unnecessary - --> tests/ui/nonminimal_bool.rs:188:8 - | -LL | if true == !b {} - | ^^^^^^^^^^ help: try: `!b` - error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:191:8 + --> tests/ui/nonminimal_bool.rs:189:8 | LL | if true != !b {} | ^^^^^^^^^^ help: try: `true == b` -error: inequality checks against true can be replaced by a negation - --> tests/ui/nonminimal_bool.rs:191:8 - | -LL | if true != !b {} - | ^^^^^^^^^^ help: try: `b` - error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:194:8 + --> tests/ui/nonminimal_bool.rs:191:8 | LL | if !b == !c {} | ^^^^^^^^ help: try: `b == c` error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:196:8 + --> tests/ui/nonminimal_bool.rs:193:8 | LL | if !b != !c {} | ^^^^^^^^ help: try: `b != c` error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:212:8 + --> tests/ui/nonminimal_bool.rs:209:8 | LL | if !(a < 2.0 && !b) { | ^^^^^^^^^^^^^^^^ @@ -283,7 +244,7 @@ LL + if a >= 2.0 || b { | error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:231:12 + --> tests/ui/nonminimal_bool.rs:228:12 | LL | if !(matches!(ty, TyKind::Ref(_, _, _)) && !is_mutable(&expr)) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -295,16 +256,10 @@ LL + if !matches!(ty, TyKind::Ref(_, _, _)) || is_mutable(&expr) { | error: this boolean expression can be simplified - --> tests/ui/nonminimal_bool.rs:251:8 + --> tests/ui/nonminimal_bool.rs:246:8 | LL | if !S != true {} | ^^^^^^^^^^ help: try: `S == true` -error: inequality checks against true can be replaced by a negation - --> tests/ui/nonminimal_bool.rs:251:8 - | -LL | if !S != true {} - | ^^^^^^^^^^ help: try: `!!S` - -error: aborting due to 32 previous errors +error: aborting due to 26 previous errors diff --git a/tests/ui/string_add_assign.fixed b/tests/ui/string_add_assign.fixed deleted file mode 100644 index a86a304684f2..000000000000 --- a/tests/ui/string_add_assign.fixed +++ /dev/null @@ -1,22 +0,0 @@ -#[allow(clippy::string_add, unused)] -#[warn(clippy::string_add_assign)] -fn main() { - // ignores assignment distinction - let mut x = String::new(); - - for _ in 1..3 { - x += "."; - //~^ string_add_assign - //~| assign_op_pattern - } - - let y = String::new(); - let z = y + "..."; - - assert_eq!(&x, &z); - - let mut x = 1; - x += 1; - //~^ assign_op_pattern - assert_eq!(2, x); -} diff --git a/tests/ui/string_add_assign.rs b/tests/ui/string_add_assign.rs index 042e33cf8413..dbdc97dd426c 100644 --- a/tests/ui/string_add_assign.rs +++ b/tests/ui/string_add_assign.rs @@ -1,5 +1,6 @@ -#[allow(clippy::string_add, unused)] -#[warn(clippy::string_add_assign)] +#![warn(clippy::string_add_assign)] +#![expect(clippy::assign_op_pattern)] + fn main() { // ignores assignment distinction let mut x = String::new(); @@ -7,7 +8,6 @@ fn main() { for _ in 1..3 { x = x + "."; //~^ string_add_assign - //~| assign_op_pattern } let y = String::new(); @@ -17,6 +17,5 @@ fn main() { let mut x = 1; x = x + 1; - //~^ assign_op_pattern assert_eq!(2, x); } diff --git a/tests/ui/string_add_assign.stderr b/tests/ui/string_add_assign.stderr index 198772747927..855229b73b48 100644 --- a/tests/ui/string_add_assign.stderr +++ b/tests/ui/string_add_assign.stderr @@ -1,5 +1,5 @@ error: you assigned the result of adding something to this string. Consider using `String::push_str()` instead - --> tests/ui/string_add_assign.rs:8:9 + --> tests/ui/string_add_assign.rs:9:9 | LL | x = x + "."; | ^^^^^^^^^^^ @@ -7,20 +7,5 @@ LL | x = x + "."; = note: `-D clippy::string-add-assign` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::string_add_assign)]` -error: manual implementation of an assign operation - --> tests/ui/string_add_assign.rs:8:9 - | -LL | x = x + "."; - | ^^^^^^^^^^^ help: replace it with: `x += "."` - | - = note: `-D clippy::assign-op-pattern` implied by `-D warnings` - = help: to override `-D warnings` add `#[allow(clippy::assign_op_pattern)]` - -error: manual implementation of an assign operation - --> tests/ui/string_add_assign.rs:19:5 - | -LL | x = x + 1; - | ^^^^^^^^^ help: replace it with: `x += 1` - -error: aborting due to 3 previous errors +error: aborting due to 1 previous error From e7d3f362967d7df15de0b217d5d85effcd3e3af6 Mon Sep 17 00:00:00 2001 From: Jason Newcomb Date: Sat, 29 Aug 2026 21:26:59 -0400 Subject: [PATCH 13/14] Automatically generate the lint pass registrations. --- clippy_dev/src/generate.rs | 289 +- clippy_dev/src/ir.rs | 19 + clippy_dev/src/main.rs | 2 +- clippy_dev/src/new_lint.rs | 35 +- clippy_dev/src/utils.rs | 70 +- clippy_lints/src/lib.rs | 465 +-- .../matches/significant_drop_in_scrutinee.rs | 3 +- src/combined_passes.rs | 3416 +++++++++++++++++ src/driver.rs | 51 +- src/main.rs | 26 +- .../conf_nonstandard_macro_braces.fixed | 1 - .../conf_nonstandard_macro_braces.rs | 1 - .../conf_nonstandard_macro_braces.stderr | 36 +- 13 files changed, 3857 insertions(+), 557 deletions(-) create mode 100644 src/combined_passes.rs diff --git a/clippy_dev/src/generate.rs b/clippy_dev/src/generate.rs index b3d07ab207e9..baaeafe29e36 100644 --- a/clippy_dev/src/generate.rs +++ b/clippy_dev/src/generate.rs @@ -1,6 +1,10 @@ -use crate::ir::{ActiveLint, ConfDef, LintData, LintPass, ParsedLints}; +use crate::ir::{ + ActiveLint, ConfDef, LintData, LintPass, LintPassCtor, LintPassCtorArg, LintPassCtorArgs, LintPasses, ParsedLints, +}; use crate::parse::cursor::Cursor; -use crate::utils::{FileUpdater, UpdateMode, UpdateStatus, VecBuf, slice_groups, update_text_region_fn}; +use crate::utils::{ + FileUpdater, UpdateMode, UpdateStatus, VecBuf, path_as_crate_mod, slice_groups, update_text_region_fn, +}; use core::range::Range; use itertools::Itertools as _; use std::collections::HashSet; @@ -15,8 +19,10 @@ const DOCS_LINK: &str = "https://rust-lang.github.io/rust-clippy/main/index.html impl ParsedLints<'_> { #[expect(clippy::too_many_lines)] - pub fn gen_decls(&self, update_mode: UpdateMode) { + pub fn gen_decls(&mut self, update_mode: UpdateMode) { let mut updater = FileUpdater::default(); + self.lint_passes + .sort_by_key(|pass| path_as_crate_mod(pass.decl_sp.file.path.get())); let mut lints: Vec<_> = self.lints.iter().map(|(&x, y)| (x, y)).collect(); lints.sort_by_key(|&(x, _)| x); @@ -40,7 +46,9 @@ impl ParsedLints<'_> { let mut renamed = Vec::with_capacity(lints.len() / 8); for &(name, lint) in &lints { match &lint.data { - LintData::Active(data) => active.push((data.name_upper, lint.name_sp.file.path_as_krate_mod())), + LintData::Active(data) => { + active.push((data.name_upper, path_as_crate_mod(lint.name_sp.file.path.get()))); + }, LintData::Deprecated(data) => deprecated.push((name, lint.version, data.reason)), LintData::Renamed(data) => renamed.push((name, lint.version, data.new_name)), } @@ -135,7 +143,6 @@ impl ParsedLints<'_> { UpdateStatus::from_changed(src != dst) }, ); - for lints in slice_groups(&active, |(_, (head, _)), tail| { tail.iter().take_while(|(_, (x, _))| head == x).count() }) { @@ -159,8 +166,208 @@ impl ParsedLints<'_> { }, ); } + active.sort_unstable_by_key(|&(name, _)| name); + updater.update_file_checked( + "cargo dev update_lints", + update_mode, + "src/combined_passes.rs", + &mut |_, src, dst| { + gen_combined_lints_file(dst, &active, &self.lint_passes); + UpdateStatus::from_changed(src != dst) + }, + ); + } +} + +#[expect(clippy::elidable_lifetime_names, clippy::too_many_lines)] +fn gen_combined_lints_file<'cx>( + dst: &mut String, + active_lints: &[(&str, (&str, &str))], + lint_passes: &LintPasses<'cx>, +) { + let write_lint_list = |dst: &mut String, lints: &[&str], indent: &str| { + let [lint, ..] = lints else { return }; + let start = active_lints + .binary_search_by_key(lint, |&(x, _)| x) + .unwrap_or_else(|_| panic!("missing lint `{lint}`")); + let mut active = active_lints[start..].iter(); + for &lint in lints { + let (_, (krate, mod_path)) = active + .find(|&&(name, _)| lint == name) + .unwrap_or_else(|| panic!("missing lint `{lint}`")); + dst.extend(["\n", indent, "::", krate, "::"]); + for part in mod_path.split(path::MAIN_SEPARATOR) { + dst.extend([part, "::"]); + } + dst.extend([lint, ","]); + } + }; + + let (early_passes, late_passes) = lint_passes.split_early_late_passes(); + let mut lints_buf: Vec<&str> = Vec::with_capacity(active_lints.len()); + + dst.push_str(GENERATED_FILE_COMMENT); + dst.push_str( + "\ +#![rustfmt::skip] +#![expect( + non_snake_case, + non_upper_case_globals, + clippy::too_many_lines, + rustc::lint_pass_impl_without_macro, +)] + +use clippy_config::Conf; +use clippy_utils::macros::FormatArgsStorage; +use clippy_lints::utils::attr_collector::AttrStorage; +use rustc_data_structures::unord::UnordSet; +use rustc_lint::{ + EarlyContext, EarlyLintPass, LateContext, LateLintPass, Lint, LintId, LintPass, LintVec, early_lint_methods, + late_lint_methods, +}; +use rustc_middle::ty::TyCtxt; + +fn is_lint_pass_required(skippable: &UnordSet, lints: &[&'static Lint]) -> bool { + let skippable = !lints.is_empty() && lints.iter().all(|lint| skippable.contains(&LintId::of(lint))); + !skippable +} + +", + ); + for &pass in &late_passes { + dst.extend(["static ", pass.name, "_LINTS: &[&Lint] = &["]); + lints_buf.clear(); + lints_buf.extend(pass.lints.iter().map(|&l| l.rsplit_once("::").unwrap_or(("", l)).1)); + lints_buf.sort_unstable(); + write_lint_list(dst, &lints_buf, " "); + dst.push_str("\n];\n"); + } + dst.push_str( + " +pub struct CombinedClippyEarlyPass {", + ); + for pass in &early_passes { + dst.push_str("\n "); + pass.gen_struct_field(dst); + } + dst.push_str( + " +} +impl CombinedClippyEarlyPass { + pub fn new(conf: &'static Conf, fmt_args: &FormatArgsStorage, attrs: &AttrStorage) -> Self { + Self {", + ); + for pass in &early_passes { + dst.push_str("\n "); + pass.gen_struct_init(dst); + } + dst.push_str( + " + } + } +} +impl LintPass for CombinedClippyEarlyPass { + fn name(&self) -> &'static str { + \"CombinedClippyEarlyPass\" + } + fn get_lints(&self) -> LintVec { + vec![", + ); + lints_buf.clear(); + for &pass in &early_passes { + lints_buf.extend(pass.lints.iter().map(|&l| l.rsplit_once("::").unwrap_or(("", l)).1)); + } + lints_buf.sort_unstable(); + lints_buf.dedup(); + write_lint_list(dst, &lints_buf, " "); + dst.push_str( + " + ] + } +} +macro_rules! expand_early_methods { + ((), [$(fn $name:ident($($param:ident: $param_ty:ty),*);)*]) => { + impl EarlyLintPass for CombinedClippyEarlyPass {$( + fn $name(&mut self, cx: &EarlyContext<'_>, $($param: $param_ty),*) {", + ); + for pass in &early_passes { + dst.extend([ + "\n EarlyLintPass::$name(&mut self.", + pass.name, + ", cx, $($param),*);", + ]); + } + dst.push_str( + " + } + )*} + } +} +early_lint_methods!(expand_early_methods, ()); + +pub struct CombinedClippyLatePass<'tcx> {", + ); + for pass in &late_passes { + dst.push_str("\n "); + pass.gen_opt_struct_field(dst); + } + dst.push_str( + " +} +impl<'tcx> CombinedClippyLatePass<'tcx> { + pub fn new(tcx: TyCtxt<'tcx>, conf: &'static Conf, fmt_args: &FormatArgsStorage, attrs: &AttrStorage) -> Self { + let skippable_lints = tcx.skippable_lints(()); + Self {", + ); + for pass in &late_passes { + dst.push_str("\n "); + pass.gen_opt_struct_init(dst); + } + dst.push_str( + " + } + } +} +impl LintPass for CombinedClippyLatePass<'_> { + fn name(&self) -> &'static str { + \"CombinedClippyLatePass\" + } + fn get_lints(&self) -> LintVec { + vec![", + ); + lints_buf.clear(); + for &pass in &late_passes { + lints_buf.extend(pass.lints.iter().map(|&l| l.rsplit_once("::").unwrap_or(("", l)).1)); + } + lints_buf.sort_unstable(); + lints_buf.dedup(); + write_lint_list(dst, &lints_buf, " "); + dst.push_str( + " + ] } } +macro_rules! expand_late_methods { + ((), [$(fn $name:ident($($param:ident: $param_ty:ty),*);)*]) => { + impl<'tcx> LateLintPass<'tcx> for CombinedClippyLatePass<'tcx> {$( + fn $name(&mut self, cx: &LateContext<'tcx>, $($param: $param_ty),*) {", + ); + for pass in &late_passes { + dst.extend([ + "\n if let Some(pass) = &mut self.", + pass.name, + " { LateLintPass::$name(pass, cx, $($param),*); }", + ]); + } + dst.push_str( + " + } + )*} + } +} +late_lint_methods!(expand_late_methods, ());", + ); +} impl ActiveLint<'_, '_> { pub fn gen_mac(&self, dst: &mut String) { @@ -182,6 +389,24 @@ impl ActiveLint<'_, '_> { } } +impl LintPassCtorArgs { + fn gen_args_list(self, dst: &mut String) { + let mut first = true; + for &arg in &self { + if !first { + dst.push_str(", "); + } + first = false; + dst.push_str(match arg { + LintPassCtorArg::TyCtxt => "tcx", + LintPassCtorArg::Conf => "conf", + LintPassCtorArg::FmtArgs => "fmt_args.clone()", + LintPassCtorArg::Attrs => "attrs.clone()", + }); + } + } +} + impl LintPass<'_> { pub fn gen_mac(&self, dst: &mut String) { let mut line_start = dst.len(); @@ -210,6 +435,60 @@ impl LintPass<'_> { } dst.push_str(end); } + + pub fn gen_full_path(&self, dst: &mut String) { + self.decl_sp.file.write_path_as_rust_path(dst); + dst.extend(["::", self.name]); + } + + fn gen_opt_struct_field(&self, dst: &mut String) { + dst.extend([self.name, ": Option<"]); + self.gen_full_path(dst); + dst.push_str(if self.lt.is_some() { "<'tcx>>," } else { ">," }); + } + + fn gen_struct_field(&self, dst: &mut String) { + dst.extend([self.name, ": "]); + self.gen_full_path(dst); + dst.push_str(if self.lt.is_some() { "<'tcx>," } else { "," }); + } + + fn gen_struct_init(&self, dst: &mut String) { + dst.extend([self.name, ": "]); + self.gen_full_path(dst); + match self.ctor { + LintPassCtor::Unit => dst.push(','), + LintPassCtor::Default => dst.push_str("::default(),"), + LintPassCtor::New(args) => { + dst.push_str("::new("); + args.gen_args_list(dst); + dst.push_str("),"); + }, + } + } + + fn gen_opt_struct_init(&self, dst: &mut String) { + dst.extend([self.name, ": is_lint_pass_required(skippable_lints, ", self.name]); + match self.ctor { + LintPassCtor::Unit => { + dst.push_str("_LINTS).then_some("); + self.gen_full_path(dst); + dst.push_str("),"); + }, + LintPassCtor::Default => { + dst.push_str("_LINTS).then("); + self.gen_full_path(dst); + dst.push_str("::default),"); + }, + LintPassCtor::New(args) => { + dst.push_str("_LINTS).then(|| "); + self.gen_full_path(dst); + dst.push_str("::new("); + args.gen_args_list(dst); + dst.push_str(")),"); + }, + } + } } impl ConfDef<'_> { diff --git a/clippy_dev/src/ir.rs b/clippy_dev/src/ir.rs index 29a21dd0209f..e594435ddb88 100644 --- a/clippy_dev/src/ir.rs +++ b/clippy_dev/src/ir.rs @@ -329,6 +329,25 @@ impl<'cx> LintPasses<'cx> { let post = self[i + 1..].iter().take_while(|&x| x.decl_sp.file == file).count(); &mut self[i - pre..i + 1 + post] } + + #[must_use] + pub fn split_early_late_passes<'s>(&'s self) -> (Vec<&'s LintPass<'cx>>, Vec<&'s LintPass<'cx>>) { + let mut early_passes = Vec::with_capacity(100); + let mut late_passes = Vec::with_capacity(self.len()); + for pass in self.iter() { + // HACK: These are pre-expansion passes, but we detect them as early passes. + if pass.name == "EarlyAttributes" || pass.name == "MacroBraces" { + continue; + } + if pass.is_early { + early_passes.push(pass); + } + if pass.is_late { + late_passes.push(pass); + } + } + (early_passes, late_passes) + } } impl<'cx> Deref for LintPasses<'cx> { type Target = Vec>; diff --git a/clippy_dev/src/main.rs b/clippy_dev/src/main.rs index d96483763919..ea1a520d52e7 100644 --- a/clippy_dev/src/main.rs +++ b/clippy_dev/src/main.rs @@ -27,7 +27,7 @@ fn main() { } => dogfood::dogfood(fix, allow_dirty, allow_staged, allow_no_vcs), DevCommand::Fmt { check } => fmt::run(UpdateMode::from_check(check)), DevCommand::UpdateLints { check } => new_parse_cx(|cx| { - let data = cx.parse_lint_decls(); + let mut data = cx.parse_lint_decls(); cx.dcx.exit_on_err(); data.gen_decls(UpdateMode::from_check(check)); }), diff --git a/clippy_dev/src/new_lint.rs b/clippy_dev/src/new_lint.rs index 18f723b7dd9a..9aa796ace50f 100644 --- a/clippy_dev/src/new_lint.rs +++ b/clippy_dev/src/new_lint.rs @@ -134,7 +134,11 @@ pub fn create(clippy_version: Version, pass: &str, name: &str, group: &str, has_ ); }); updater.change_file("clippy_lints/src/lib.rs", |src, dst| { - add_lint_pass(src, dst, name_snake, name_pascal, new_pass, has_msrv); + let mod_pos = find_mod_decl_after(&mut Cursor::new(src), name_snake); + let (pre, post) = src.split_at(mod_pos.pos as usize); + dst.push_str(pre); + dst.extend(mod_pos.insertion_text(name_snake)); + dst.push_str(post); }); } @@ -318,35 +322,6 @@ impl ", pass_ty, pass_lt, " for ", pass_name, "{ "]); } -fn add_lint_pass( - src: &str, - dst: &mut String, - name_snake: &str, - name_pascal: &str, - new_pass: LintPassKind, - has_msrv: bool, -) { - let mod_pos = find_mod_decl_after(&mut Cursor::new(src), name_snake); - let (pre, src) = src.split_at(mod_pos.pos as usize); - dst.push_str(pre); - dst.extend(mod_pos.insertion_text(name_snake)); - - let comment = match new_pass { - LintPassKind::Early => "// add early passes here, used by `cargo dev new_lint`", - LintPassKind::Late => "// add late passes here, used by `cargo dev new_lint`", - }; - let ctor_call = if has_msrv { "::new(conf)" } else { "" }; - let pos = src.find(comment).unwrap_or_else(|| panic!("failed to find: {comment}")); - let (start, end) = src.split_at(pos); - #[rustfmt::skip] - dst.extend([ - start, - name_pascal, ": ", name_snake, "::", name_pascal, " = ", - name_snake, "::", name_pascal, ctor_call, ",\n ", - end, - ]); -} - struct ModPos { pos: u32, kind: PosKind, diff --git a/clippy_dev/src/utils.rs b/clippy_dev/src/utils.rs index 9f59a0a9fdc9..0a9b93862a3a 100644 --- a/clippy_dev/src/utils.rs +++ b/clippy_dev/src/utils.rs @@ -880,6 +880,46 @@ impl VecBuf { } } +/// Splits the file's path into the crate it's a part of and the module it implements. +/// +/// Only supports paths in the form `CRATE_NAME/src/PATH/TO/FILE.rs` using the current +/// platform's path separator. The module path returned will use the current platform's +/// path separator. +pub fn path_as_crate_mod(path: &str) -> (&str, &str) { + let Some((krate, path)) = path.split_once(path::MAIN_SEPARATOR) else { + return ("", ""); + }; + let module = if let Some(path) = path.strip_prefix("src") + && let Some(path) = path.strip_prefix(path::MAIN_SEPARATOR) + && let Some(path) = path.strip_suffix(".rs") + { + if path == "lib" { + "" + } else if let Some(path) = path.strip_suffix("mod") + && let Some(path) = path.strip_suffix(path::MAIN_SEPARATOR) + { + path + } else { + path + } + } else { + "" + }; + (krate, module) +} + +/// Writes the full rust path to the module starting with a leading `::`. +/// +/// Only supports paths in the form `CRATE_NAME/src/PATH/TO/FILE.rs` using the current +/// platform's path separator. +pub fn write_path_as_rust_path(path: &str, dst: &mut String) { + let (krate, mod_path) = path_as_crate_mod(path); + dst.extend(["::", krate]); + for part in mod_path.split(path::MAIN_SEPARATOR) { + dst.extend(["::", part]); + } +} + #[derive(Eq)] pub struct SourceFile<'cx> { // `cargo dev rename_lint` needs to be able to rename files. @@ -898,6 +938,7 @@ impl<'cx> SourceFile<'cx> { } #[must_use] + #[track_caller] pub fn load(path: &'cx str) -> Self { let mut contents = String::new(); File::open_read(path).read_append_to_string(&mut contents); @@ -918,33 +959,8 @@ impl<'cx> SourceFile<'cx> { }) } - /// Splits the file's path into the crate it's a part of and the module it implements. - /// - /// Only supports paths in the form `CRATE_NAME/src/PATH/TO/FILE.rs` using the current - /// platform's path separator. The module path returned will use the current platform's - /// path separator. - pub fn path_as_krate_mod(&self) -> (&'cx str, &'cx str) { - let path = self.path.get(); - let Some((krate, path)) = path.split_once(path::MAIN_SEPARATOR) else { - return ("", ""); - }; - let module = if let Some(path) = path.strip_prefix("src") - && let Some(path) = path.strip_prefix(path::MAIN_SEPARATOR) - && let Some(path) = path.strip_suffix(".rs") - { - if path == "lib" { - "" - } else if let Some(path) = path.strip_suffix("mod") - && let Some(path) = path.strip_suffix(path::MAIN_SEPARATOR) - { - path - } else { - path - } - } else { - "" - }; - (krate, module) + pub fn write_path_as_rust_path(&self, dst: &mut String) { + write_path_as_rust_path(self.path.get(), dst); } } impl PartialEq> for SourceFile<'_> { diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 3a6693dc5a26..5f4f626dddca 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -5,7 +5,6 @@ #![feature(f16)] #![feature(iter_intersperse)] #![feature(iter_partition_in_place)] -#![feature(macro_metavar_expr)] #![feature(macro_metavar_expr_concat)] #![feature(never_type)] #![feature(rustc_private)] @@ -394,6 +393,7 @@ pub mod use_self; pub mod useless_concat; pub mod useless_conversion; pub mod useless_vec; +pub mod utils; pub mod vec_init_then_push; pub mod visibility; pub mod volatile_composites; @@ -405,468 +405,5 @@ pub mod zero_repeat_side_effects; pub mod zero_sized_map_values; pub mod zombie_processes; -mod combined_early_pass; -mod combined_late_pass; -mod utils; - pub mod declared_lints; pub mod deprecated_lints; - -use clippy_config::{Conf, sanitize_explanation}; -use clippy_utils::macros::FormatArgsStorage; -use rustc_data_structures::fx::FxHashSet; -use rustc_lint::is_lint_pass_required; -use rustc_middle::ty::TyCtxt; -use utils::attr_collector::AttrStorage; - -pub fn explain(name: &str) -> i32 { - let target = format!("clippy::{}", name.to_ascii_uppercase()); - if let Some(info) = declared_lints::LINTS.iter().find(|info| info.lint.name == target) { - println!("{}", sanitize_explanation(info.explanation)); - // Check if the lint has configuration - let mut mdconf = Conf::get_metadata(); - let name = name.to_ascii_lowercase(); - mdconf.retain(|cconf| cconf.lints.contains(&&*name)); - if !mdconf.is_empty() { - println!("### Configuration for {}:\n", info.lint.name_lower()); - for conf in mdconf { - println!("{conf}"); - } - } - 0 - } else { - println!("unknown lint: {name}"); - 1 - } -} - -/// Register all lints and lint groups with the rustc lint store -/// -/// Used in `./src/driver.rs`. -pub fn register_lint_passes(store: &mut rustc_lint::LintStore, conf: &'static Conf) { - for (old_name, new_name) in deprecated_lints::RENAMED { - store.register_renamed(old_name, new_name); - } - for (name, reason) in deprecated_lints::DEPRECATED { - store.register_removed(name, reason); - } - - // NOTE: Do not add any more pre-expansion passes. These should be removed eventually. - // Due to the architecture of the compiler, currently `cfg_attr` attributes on crate - // level (i.e `#![cfg_attr(...)]`) will still be expanded even when using a pre-expansion pass. - store.register_pre_expansion_lint_pass(Box::new(move || Box::new(attrs::EarlyAttributes::new(conf)))); - store.register_pre_expansion_lint_pass(Box::new(move || { - Box::new(nonstandard_macro_braces::MacroBraces::new(conf)) - })); - - let format_args_storage = FormatArgsStorage::default(); - let attr_storage = AttrStorage::default(); - - { - let format_args = format_args_storage.clone(); - let attrs = attr_storage.clone(); - store.register_early_lint_pass(Box::new(move || { - Box::new(CombinedEarlyLintPass::new(conf, format_args.clone(), attrs.clone())) - })); - } - - store.register_late_lint_pass(Box::new(move |tcx: TyCtxt<'_>| { - let skippable_lints = tcx.skippable_lints(()); - let is_active = |lints: &rustc_lint::LintVec| is_lint_pass_required(skippable_lints, lints); - Box::new(CombinedLateLintPass::new( - tcx, - conf, - format_args_storage.clone(), - attr_storage.clone(), - &is_active, - )) - })); -} - -// Fold every early pass into one statically-combined struct (see -// `combined_early_pass`); the method list comes from `early_lint_methods!`. -#[rustfmt::skip] -rustc_lint::early_lint_methods!( - crate::combined_early_lint_pass, - [CombinedEarlyLintPass, (conf: &'static Conf, format_args: FormatArgsStorage, attrs: AttrStorage), [ - FormatArgsCollector: utils::format_args_collector::FormatArgsCollector = utils::format_args_collector::FormatArgsCollector::new(format_args.clone()), - AttrCollector: utils::attr_collector::AttrCollector = utils::attr_collector::AttrCollector::new(attrs.clone()), - PostExpansionEarlyAttributes: attrs::PostExpansionEarlyAttributes = attrs::PostExpansionEarlyAttributes::new(conf), - UnnecessarySelfImports: unnecessary_self_imports::UnnecessarySelfImports = unnecessary_self_imports::UnnecessarySelfImports, - RedundantStaticLifetimes: redundant_static_lifetimes::RedundantStaticLifetimes = redundant_static_lifetimes::RedundantStaticLifetimes::new(conf), - RedundantFieldNames: redundant_field_names::RedundantFieldNames = redundant_field_names::RedundantFieldNames::new(conf), - UnnestedOrPatterns: unnested_or_patterns::UnnestedOrPatterns = unnested_or_patterns::UnnestedOrPatterns::new(conf), - EarlyFunctions: functions::EarlyFunctions = functions::EarlyFunctions, - Documentation: doc::Documentation = doc::Documentation::new(conf), - SuspiciousOperationGroupings: suspicious_operation_groupings::SuspiciousOperationGroupings = ::default(), - DoubleParens: double_parens::DoubleParens = double_parens::DoubleParens, - UnsafeNameRemoval: unsafe_removed_from_name::UnsafeNameRemoval = unsafe_removed_from_name::UnsafeNameRemoval, - ElseIfWithoutElse: else_if_without_else::ElseIfWithoutElse = else_if_without_else::ElseIfWithoutElse, - IntPlusOne: int_plus_one::IntPlusOne = int_plus_one::IntPlusOne, - Formatting: formatting::Formatting = formatting::Formatting, - MiscEarlyLints: misc_early::MiscEarlyLints = misc_early::MiscEarlyLints, - UnusedUnit: unused_unit::UnusedUnit = unused_unit::UnusedUnit, - Precedence: precedence::Precedence = precedence::Precedence, - NeedlessArbitrarySelfType: needless_arbitrary_self_type::NeedlessArbitrarySelfType = needless_arbitrary_self_type::NeedlessArbitrarySelfType, - LiteralDigitGrouping: literal_representation::LiteralDigitGrouping = literal_representation::LiteralDigitGrouping::new(conf), - DecimalLiteralRepresentation: literal_representation::DecimalLiteralRepresentation = literal_representation::DecimalLiteralRepresentation::new(conf), - TabsInDocComments: tabs_in_doc_comments::TabsInDocComments = tabs_in_doc_comments::TabsInDocComments, - SingleComponentPathImports: single_component_path_imports::SingleComponentPathImports = single_component_path_imports::SingleComponentPathImports::default(), - OptionEnvUnwrap: option_env_unwrap::OptionEnvUnwrap = option_env_unwrap::OptionEnvUnwrap, - NonExpressiveNames: non_expressive_names::NonExpressiveNames = non_expressive_names::NonExpressiveNames::new(conf), - MacroBraces: nonstandard_macro_braces::MacroBraces = nonstandard_macro_braces::MacroBraces::new(conf), - InlineAsmX86AttSyntax: asm_syntax::InlineAsmX86AttSyntax = asm_syntax::InlineAsmX86AttSyntax, - InlineAsmX86IntelSyntax: asm_syntax::InlineAsmX86IntelSyntax = asm_syntax::InlineAsmX86IntelSyntax, - ModStyle: module_style::ModStyle = module_style::ModStyle::default(), - DisallowedScriptIdents: disallowed_script_idents::DisallowedScriptIdents = disallowed_script_idents::DisallowedScriptIdents::new(conf), - OctalEscapes: octal_escapes::OctalEscapes = octal_escapes::OctalEscapes, - SingleCharLifetimeNames: single_char_lifetime_names::SingleCharLifetimeNames = single_char_lifetime_names::SingleCharLifetimeNames, - CrateInMacroDef: crate_in_macro_def::CrateInMacroDef = crate_in_macro_def::CrateInMacroDef, - PubUse: pub_use::PubUse = pub_use::PubUse, - LargeIncludeFile: large_include_file::LargeIncludeFile = large_include_file::LargeIncludeFile::new(conf), - DuplicateMod: duplicate_mod::DuplicateMod = duplicate_mod::DuplicateMod::default(), - UnusedRounding: unused_rounding::UnusedRounding = unused_rounding::UnusedRounding, - AlmostCompleteRange: almost_complete_range::AlmostCompleteRange = almost_complete_range::AlmostCompleteRange::new(conf), - MultiAssignments: multi_assignments::MultiAssignments = multi_assignments::MultiAssignments, - PartialPubFields: partial_pub_fields::PartialPubFields = partial_pub_fields::PartialPubFields, - UnderscoreTyped: let_with_type_underscore::UnderscoreTyped = let_with_type_underscore::UnderscoreTyped, - ExcessiveNesting: excessive_nesting::ExcessiveNesting = excessive_nesting::ExcessiveNesting::new(conf), - NeedlessElse: needless_else::NeedlessElse = needless_else::NeedlessElse, - RawStrings: raw_strings::RawStrings = raw_strings::RawStrings::new(conf), - Visibility: visibility::Visibility = visibility::Visibility, - MultipleBoundLocations: multiple_bound_locations::MultipleBoundLocations = multiple_bound_locations::MultipleBoundLocations, - FieldScopedVisibilityModifiers: field_scoped_visibility_modifiers::FieldScopedVisibilityModifiers = field_scoped_visibility_modifiers::FieldScopedVisibilityModifiers, - CfgNotTest: cfg_not_test::CfgNotTest = cfg_not_test::CfgNotTest, - EmptyLineAfter: empty_line_after::EmptyLineAfter = empty_line_after::EmptyLineAfter::default(), - InlineTraitBounds: inline_trait_bounds::InlineTraitBounds = inline_trait_bounds::InlineTraitBounds::default(), - DefinitionInModuleRoot: definition_in_module_root::DefinitionInModuleRoot = definition_in_module_root::DefinitionInModuleRoot::default(), - // add early passes here, used by `cargo dev new_lint` - ]] -); - -// Fold every late pass into one statically-combined struct (see -// `combined_late_pass`); the method list comes from `late_lint_methods!`. -#[rustfmt::skip] -rustc_lint::late_lint_methods!( - crate::combined_late_lint_pass, - [CombinedLateLintPass, (tcx: TyCtxt<'tcx>, conf: &'static Conf, format_args: FormatArgsStorage, attrs: AttrStorage), [ - ArithmeticSideEffects: operators::arithmetic_side_effects::ArithmeticSideEffects = operators::arithmetic_side_effects::ArithmeticSideEffects::new(conf), - DumpHir: utils::dump_hir::DumpHir = utils::dump_hir::DumpHir, - Author: utils::author::Author = utils::author::Author, - AwaitHolding: await_holding_invalid::AwaitHolding = await_holding_invalid::AwaitHolding::new(tcx, conf), - SerdeApi: serde_api::SerdeApi = serde_api::SerdeApi, - Types: types::Types = types::Types::new(conf), - NonminimalBool: booleans::NonminimalBool = booleans::NonminimalBool::new(conf), - UnportableVariant: enum_clike::UnportableVariant = enum_clike::UnportableVariant, - FloatLiteral: float_literal::FloatLiteral = float_literal::FloatLiteral::new(conf), - Ptr: ptr::Ptr = ptr::Ptr, - NeedlessBool: needless_bool::NeedlessBool = needless_bool::NeedlessBool, - BoolComparison: bool_comparison::BoolComparison = bool_comparison::BoolComparison, - NeedlessForEach: needless_for_each::NeedlessForEach = needless_for_each::NeedlessForEach, - LintPass: misc::LintPass = misc::LintPass, - EtaReduction: eta_reduction::EtaReduction = eta_reduction::EtaReduction, - MutMut: mut_mut::MutMut = mut_mut::MutMut::default(), - UnnecessaryMutPassed: unnecessary_mut_passed::UnnecessaryMutPassed = unnecessary_mut_passed::UnnecessaryMutPassed, - SignificantDropTightening: significant_drop_tightening::SignificantDropTightening<'tcx> = >::default(), - LenZero: len_zero::LenZero = len_zero::LenZero::new(conf), - AssertIsEmpty: assert_is_empty::AssertIsEmpty = assert_is_empty::AssertIsEmpty, - LenWithoutIsEmpty: len_without_is_empty::LenWithoutIsEmpty = len_without_is_empty::LenWithoutIsEmpty, - Attributes: attrs::Attributes = attrs::Attributes::new(conf), - BlocksInConditions: blocks_in_conditions::BlocksInConditions = blocks_in_conditions::BlocksInConditions, - Unicode: unicode::Unicode = unicode::Unicode, - UninitVec: uninit_vec::UninitVec = uninit_vec::UninitVec, - UnitReturnExpectingOrd: unit_return_expecting_ord::UnitReturnExpectingOrd = unit_return_expecting_ord::UnitReturnExpectingOrd, - StringAdd: strings::StringAdd = strings::StringAdd, - ImplicitReturn: implicit_return::ImplicitReturn = implicit_return::ImplicitReturn, - ImplicitSaturatingSub: implicit_saturating_sub::ImplicitSaturatingSub = implicit_saturating_sub::ImplicitSaturatingSub::new(conf), - DefaultNumericFallback: default_numeric_fallback::DefaultNumericFallback = default_numeric_fallback::DefaultNumericFallback, - NonOctalUnixPermissions: non_octal_unix_permissions::NonOctalUnixPermissions = non_octal_unix_permissions::NonOctalUnixPermissions, - ApproxConstant: approx_const::ApproxConstant = approx_const::ApproxConstant::new(conf), - Matches: matches::Matches = matches::Matches::new(conf), - ManualNonExhaustive: manual_non_exhaustive::ManualNonExhaustive = manual_non_exhaustive::ManualNonExhaustive::new(conf), - ManualStrip: manual_strip::ManualStrip = manual_strip::ManualStrip::new(conf), - CheckedConversions: checked_conversions::CheckedConversions = checked_conversions::CheckedConversions::new(conf), - MemReplace: mem_replace::MemReplace = mem_replace::MemReplace::new(conf), - Ranges: ranges::Ranges = ranges::Ranges::new(conf), - FromOverInto: from_over_into::FromOverInto = from_over_into::FromOverInto::new(conf), - UseSelf: use_self::UseSelf = use_self::UseSelf::new(conf), - MissingConstForFn: missing_const_for_fn::MissingConstForFn = missing_const_for_fn::MissingConstForFn::new(conf), - NeedlessQuestionMark: needless_question_mark::NeedlessQuestionMark = needless_question_mark::NeedlessQuestionMark, - Casts: casts::Casts = casts::Casts::new(conf), - SizeOfInElementCount: size_of_in_element_count::SizeOfInElementCount = size_of_in_element_count::SizeOfInElementCount, - SameNameMethod: same_name_method::SameNameMethod = same_name_method::SameNameMethod, - IndexRefutableSlice: index_refutable_slice::IndexRefutableSlice = index_refutable_slice::IndexRefutableSlice::new(conf), - Shadow: shadow::Shadow = ::default(), - InconsistentStructConstructor: inconsistent_struct_constructor::InconsistentStructConstructor = inconsistent_struct_constructor::InconsistentStructConstructor::new( conf, ), - Methods: methods::Methods = methods::Methods::new(conf, format_args.clone()), - UnitTypes: unit_types::UnitTypes = unit_types::UnitTypes::new(format_args.clone()), - Loops: loops::Loops = loops::Loops::new(conf), - MainRecursion: main_recursion::MainRecursion = ::default(), - Lifetimes: lifetimes::Lifetimes = lifetimes::Lifetimes::new(conf), - HashMapPass: entry::HashMapPass = entry::HashMapPass, - MinMaxPass: minmax::MinMaxPass = minmax::MinMaxPass, - ZeroDiv: zero_div_zero::ZeroDiv = zero_div_zero::ZeroDiv, - Mutex: mutex_atomic::Mutex = mutex_atomic::Mutex, - NeedlessUpdate: needless_update::NeedlessUpdate = needless_update::NeedlessUpdate, - NeedlessBorrowedRef: needless_borrowed_ref::NeedlessBorrowedRef = needless_borrowed_ref::NeedlessBorrowedRef, - BorrowDerefRef: borrow_deref_ref::BorrowDerefRef = borrow_deref_ref::BorrowDerefRef, - NoEffect: no_effect::NoEffect = ::default(), - TemporaryAssignment: temporary_assignment::TemporaryAssignment = temporary_assignment::TemporaryAssignment, - Transmute: transmute::Transmute = transmute::Transmute::new(conf), - CognitiveComplexity: cognitive_complexity::CognitiveComplexity = cognitive_complexity::CognitiveComplexity::new(conf), - BoxedLocal: escape::BoxedLocal = escape::BoxedLocal::new(conf), - UselessVec: useless_vec::UselessVec = useless_vec::UselessVec::new(conf), - PanicUnimplemented: panic_unimplemented::PanicUnimplemented = panic_unimplemented::PanicUnimplemented::new(conf), - StringLitAsBytes: strings::StringLitAsBytes = strings::StringLitAsBytes, - Derive: derive::Derive = derive::Derive, - DerivableImpls: derivable_impls::DerivableImpls = derivable_impls::DerivableImpls::new(conf), - DropForgetRef: drop_forget_ref::DropForgetRef = drop_forget_ref::DropForgetRef, - EmptyEnums: empty_enums::EmptyEnums = empty_enums::EmptyEnums, - Regex: regex::Regex = ::default(), - CopyAndPaste: ifs::CopyAndPaste<'tcx> = ifs::CopyAndPaste::new(tcx, conf), - CopyIterator: copy_iterator::CopyIterator = copy_iterator::CopyIterator, - UselessFormat: format::UselessFormat = format::UselessFormat::new(format_args.clone()), - Swap: swap::Swap = swap::Swap, - PanickingOverflowChecks: panicking_overflow_checks::PanickingOverflowChecks = panicking_overflow_checks::PanickingOverflowChecks, - NewWithoutDefault: new_without_default::NewWithoutDefault = ::default(), - DisallowedNames: disallowed_names::DisallowedNames = disallowed_names::DisallowedNames::new(conf), - Functions: functions::Functions = functions::Functions::new(tcx, conf), - Documentation: doc::Documentation = doc::Documentation::new(conf), - NegMultiply: neg_multiply::NegMultiply = neg_multiply::NegMultiply, - LetIfSeq: let_if_seq::LetIfSeq = let_if_seq::LetIfSeq, - EvalOrderDependence: mixed_read_write_in_expression::EvalOrderDependence = mixed_read_write_in_expression::EvalOrderDependence, - MissingDoc: missing_doc::MissingDoc = missing_doc::MissingDoc::new(conf), - MissingInline: missing_inline::MissingInline = missing_inline::MissingInline, - ExhaustiveItems: exhaustive_items::ExhaustiveItems = exhaustive_items::ExhaustiveItems, - UnusedResultOk: unused_result_ok::UnusedResultOk = unused_result_ok::UnusedResultOk, - MatchResultOk: match_result_ok::MatchResultOk = match_result_ok::MatchResultOk, - PartialEqNeImpl: partialeq_ne_impl::PartialEqNeImpl = partialeq_ne_impl::PartialEqNeImpl, - UnusedIoAmount: unused_io_amount::UnusedIoAmount = unused_io_amount::UnusedIoAmount, - LargeEnumVariant: large_enum_variant::LargeEnumVariant = large_enum_variant::LargeEnumVariant::new(conf), - ExplicitWrite: explicit_write::ExplicitWrite = explicit_write::ExplicitWrite::new(format_args.clone()), - NeedlessPassByValue: needless_pass_by_value::NeedlessPassByValue = needless_pass_by_value::NeedlessPassByValue, - PassByRefOrValue: pass_by_ref_or_value::PassByRefOrValue = pass_by_ref_or_value::PassByRefOrValue::new(tcx, conf), - RefOptionRef: ref_option_ref::RefOptionRef = ref_option_ref::RefOptionRef, - InfiniteIter: infinite_iter::InfiniteIter = infinite_iter::InfiniteIter, - InlineFnWithoutBody: inline_fn_without_body::InlineFnWithoutBody = inline_fn_without_body::InlineFnWithoutBody, - UselessConversion: useless_conversion::UselessConversion = ::default(), - ImplicitHasher: implicit_hasher::ImplicitHasher = implicit_hasher::ImplicitHasher, - FallibleImplFrom: fallible_impl_from::FallibleImplFrom = fallible_impl_from::FallibleImplFrom, - QuestionMark: question_mark::QuestionMark = question_mark::QuestionMark::new(conf), - QuestionMarkUsed: question_mark_used::QuestionMarkUsed = question_mark_used::QuestionMarkUsed, - SuspiciousImpl: suspicious_trait_impl::SuspiciousImpl = suspicious_trait_impl::SuspiciousImpl, - MapUnit: map_unit_fn::MapUnit = map_unit_fn::MapUnit, - MultipleInherentImpl: inherent_impl::MultipleInherentImpl = inherent_impl::MultipleInherentImpl::new(conf), - NoNegCompOpForPartialOrd: neg_cmp_op_on_partial_ord::NoNegCompOpForPartialOrd = neg_cmp_op_on_partial_ord::NoNegCompOpForPartialOrd, - Unwrap: unwrap::Unwrap = unwrap::Unwrap::new(conf), - IndexingSlicing: indexing_slicing::IndexingSlicing = indexing_slicing::IndexingSlicing::new(conf), - NonCopyConst: non_copy_const::NonCopyConst<'tcx> = non_copy_const::NonCopyConst::new(tcx, conf), - RedundantClone: redundant_clone::RedundantClone = redundant_clone::RedundantClone, - SlowVectorInit: slow_vector_initialization::SlowVectorInit = slow_vector_initialization::SlowVectorInit, - UnnecessaryWraps: unnecessary_wraps::UnnecessaryWraps = unnecessary_wraps::UnnecessaryWraps::new(conf), - AssertionsOnConstants: assertions_on_constants::AssertionsOnConstants = assertions_on_constants::AssertionsOnConstants::new(conf), - AssertionsOnResultStates: assertions_on_result_states::AssertionsOnResultStates = assertions_on_result_states::AssertionsOnResultStates, - InherentToString: inherent_to_string::InherentToString = inherent_to_string::InherentToString, - TraitBounds: trait_bounds::TraitBounds = trait_bounds::TraitBounds::new(conf), - ComparisonChain: comparison_chain::ComparisonChain = comparison_chain::ComparisonChain, - MutableKeyType: mut_key::MutableKeyType<'tcx> = mut_key::MutableKeyType::new(tcx, conf), - DerefAddrOf: reference::DerefAddrOf = reference::DerefAddrOf, - FormatImpl: format_impl::FormatImpl = format_impl::FormatImpl::new(format_args.clone()), - RedundantClosureCall: redundant_closure_call::RedundantClosureCall = redundant_closure_call::RedundantClosureCall, - UnusedUnit: unused_unit::UnusedUnit = unused_unit::UnusedUnit, - Return: returns::Return = returns::Return, - CollapsibleIf: collapsible_if::CollapsibleIf = collapsible_if::CollapsibleIf::new(conf), - ItemsAfterStatements: items_after_statements::ItemsAfterStatements = items_after_statements::ItemsAfterStatements, - NeedlessParensOnRangeLiterals: needless_parens_on_range_literals::NeedlessParensOnRangeLiterals = needless_parens_on_range_literals::NeedlessParensOnRangeLiterals, - NeedlessContinue: needless_continue::NeedlessContinue = needless_continue::NeedlessContinue, - CreateDir: create_dir::CreateDir = create_dir::CreateDir, - ItemNameRepetitions: item_name_repetitions::ItemNameRepetitions = item_name_repetitions::ItemNameRepetitions::new(conf), - UpperCaseAcronyms: upper_case_acronyms::UpperCaseAcronyms = upper_case_acronyms::UpperCaseAcronyms::new(conf), - Default: default::Default = ::default(), - UnusedSelf: unused_self::UnusedSelf = unused_self::UnusedSelf::new(conf), - DebugAssertWithMutCall: mutable_debug_assertion::DebugAssertWithMutCall = mutable_debug_assertion::DebugAssertWithMutCall, - Exit: exit::Exit = exit::Exit, - ToDigitIsSome: to_digit_is_some::ToDigitIsSome = to_digit_is_some::ToDigitIsSome::new(conf), - LargeStackArrays: large_stack_arrays::LargeStackArrays = large_stack_arrays::LargeStackArrays::new(conf), - LargeConstArrays: large_const_arrays::LargeConstArrays = large_const_arrays::LargeConstArrays::new(conf), - FloatingPointArithmetic: floating_point_arithmetic::FloatingPointArithmetic = floating_point_arithmetic::FloatingPointArithmetic, - AsConversions: as_conversions::AsConversions = as_conversions::AsConversions, - LetUnderscore: let_underscore::LetUnderscore = let_underscore::LetUnderscore, - ExcessiveBools: excessive_bools::ExcessiveBools = excessive_bools::ExcessiveBools::new(conf), - WildcardImports: wildcard_imports::WildcardImports = wildcard_imports::WildcardImports::new(conf), - RedundantPubCrate: redundant_pub_crate::RedundantPubCrate = ::default(), - Dereferencing: dereference::Dereferencing<'tcx> = >::default(), - OptionIfLetElse: option_if_let_else::OptionIfLetElse = option_if_let_else::OptionIfLetElse, - FutureNotSend: future_not_send::FutureNotSend = future_not_send::FutureNotSend, - LargeFuture: large_futures::LargeFuture = large_futures::LargeFuture::new(conf), - IfLetMutex: if_let_mutex::IfLetMutex = if_let_mutex::IfLetMutex, - IfNotElse: if_not_else::IfNotElse = if_not_else::IfNotElse, - PatternEquality: equatable_if_let::PatternEquality = equatable_if_let::PatternEquality, - ManualAsyncFn: manual_async_fn::ManualAsyncFn = manual_async_fn::ManualAsyncFn, - PanicInResultFn: panic_in_result_fn::PanicInResultFn = panic_in_result_fn::PanicInResultFn, - MacroUseImports: macro_use::MacroUseImports = ::default(), - PatternTypeMismatch: pattern_type_mismatch::PatternTypeMismatch = pattern_type_mismatch::PatternTypeMismatch, - UnwrapInResult: unwrap_in_result::UnwrapInResult = ::default(), - SemicolonIfNothingReturned: semicolon_if_nothing_returned::SemicolonIfNothingReturned = semicolon_if_nothing_returned::SemicolonIfNothingReturned, - AsyncYieldsAsync: async_yields_async::AsyncYieldsAsync = async_yields_async::AsyncYieldsAsync, - DisallowedMacros: disallowed_macros::DisallowedMacros = disallowed_macros::DisallowedMacros::new(tcx, conf, attrs.clone()), - DisallowedMethods: disallowed_methods::DisallowedMethods = disallowed_methods::DisallowedMethods::new(tcx, conf), - EmptyDrop: empty_drop::EmptyDrop = empty_drop::EmptyDrop, - StrToString: strings::StrToString = strings::StrToString, - ZeroSizedMapValues: zero_sized_map_values::ZeroSizedMapValues = zero_sized_map_values::ZeroSizedMapValues, - VecInitThenPush: vec_init_then_push::VecInitThenPush = ::default(), - RedundantSlicing: redundant_slicing::RedundantSlicing = redundant_slicing::RedundantSlicing, - FromStrRadix10: from_str_radix_10::FromStrRadix10 = from_str_radix_10::FromStrRadix10, - IfThenSomeElseNone: if_then_some_else_none::IfThenSomeElseNone = if_then_some_else_none::IfThenSomeElseNone::new(conf), - BoolAssertComparison: bool_assert_comparison::BoolAssertComparison = bool_assert_comparison::BoolAssertComparison, - UnusedAsync: unused_async::UnusedAsync = ::default(), - DisallowedTypes: disallowed_types::DisallowedTypes = disallowed_types::DisallowedTypes::new(tcx, conf), - ImportRename: missing_enforced_import_rename::ImportRename = missing_enforced_import_rename::ImportRename::new(tcx, conf), - StrlenOnCStrings: strlen_on_c_strings::StrlenOnCStrings = strlen_on_c_strings::StrlenOnCStrings::new(conf), - SelfNamedConstructors: self_named_constructors::SelfNamedConstructors = self_named_constructors::SelfNamedConstructors, - IterNotReturningIterator: iter_not_returning_iterator::IterNotReturningIterator = iter_not_returning_iterator::IterNotReturningIterator, - ManualAssert: manual_assert::ManualAssert = manual_assert::ManualAssert, - NonSendFieldInSendTy: non_send_fields_in_send_ty::NonSendFieldInSendTy = non_send_fields_in_send_ty::NonSendFieldInSendTy::new(conf), - UndocumentedUnsafeBlocks: undocumented_unsafe_blocks::UndocumentedUnsafeBlocks = undocumented_unsafe_blocks::UndocumentedUnsafeBlocks::new(conf), - FormatArgs: format_args::FormatArgs<'tcx> = format_args::FormatArgs::new(tcx, conf, format_args.clone()), - TrailingEmptyArray: trailing_empty_array::TrailingEmptyArray = trailing_empty_array::TrailingEmptyArray, - NeedlessLateInit: needless_late_init::NeedlessLateInit<'tcx> = needless_late_init::NeedlessLateInit::new(conf), - ReturnSelfNotMustUse: return_self_not_must_use::ReturnSelfNotMustUse = return_self_not_must_use::ReturnSelfNotMustUse, - NumberedFields: init_numbered_fields::NumberedFields = init_numbered_fields::NumberedFields, - ManualBitWidth: bit_width::ManualBitWidth = bit_width::ManualBitWidth::new(conf), - ManualBits: manual_bits::ManualBits = manual_bits::ManualBits::new(conf), - DefaultUnionRepresentation: default_union_representation::DefaultUnionRepresentation = default_union_representation::DefaultUnionRepresentation, - OnlyUsedInRecursion: only_used_in_recursion::OnlyUsedInRecursion = ::default(), - DbgMacro: dbg_macro::DbgMacro = dbg_macro::DbgMacro::new(conf), - Write: write::Write = write::Write::new(conf, format_args.clone()), - Cargo: cargo::Cargo = cargo::Cargo::new(conf), - EmptyWithBrackets: empty_with_brackets::EmptyWithBrackets = empty_with_brackets::EmptyWithBrackets::default(), - UnnecessaryOwnedEmptyStrings: unnecessary_owned_empty_strings::UnnecessaryOwnedEmptyStrings = unnecessary_owned_empty_strings::UnnecessaryOwnedEmptyStrings, - FormatPushString: format_push_string::FormatPushString = format_push_string::FormatPushString::new(format_args.clone()), - LargeIncludeFile: large_include_file::LargeIncludeFile = large_include_file::LargeIncludeFile::new(conf), - TrimSplitWhitespace: strings::TrimSplitWhitespace = strings::TrimSplitWhitespace, - RcCloneInVecInit: rc_clone_in_vec_init::RcCloneInVecInit = rc_clone_in_vec_init::RcCloneInVecInit, - SwapPtrToRef: swap_ptr_to_ref::SwapPtrToRef = swap_ptr_to_ref::SwapPtrToRef, - TypeParamMismatch: mismatching_type_param_order::TypeParamMismatch = mismatching_type_param_order::TypeParamMismatch, - ReadZeroByteVec: read_zero_byte_vec::ReadZeroByteVec = read_zero_byte_vec::ReadZeroByteVec, - DefaultIterEmpty: default_instead_of_iter_empty::DefaultIterEmpty = default_instead_of_iter_empty::DefaultIterEmpty, - ManualRemEuclid: manual_rem_euclid::ManualRemEuclid = manual_rem_euclid::ManualRemEuclid::new(conf), - ManualRetain: manual_retain::ManualRetain = manual_retain::ManualRetain::new(conf), - ManualRotate: manual_rotate::ManualRotate = manual_rotate::ManualRotate, - Operators: operators::Operators = operators::Operators::new(conf), - StdReexports: std_instead_of_core::StdReexports = std_instead_of_core::StdReexports::new(conf), - UncheckedTimeSubtraction: time_subtraction::UncheckedTimeSubtraction = time_subtraction::UncheckedTimeSubtraction::new(conf), - PartialeqToNone: partialeq_to_none::PartialeqToNone = partialeq_to_none::PartialeqToNone, - ManualAbsDiff: manual_abs_diff::ManualAbsDiff = manual_abs_diff::ManualAbsDiff::new(conf), - ManualClamp: manual_clamp::ManualClamp = manual_clamp::ManualClamp::new(conf), - ManualStringNew: manual_string_new::ManualStringNew = manual_string_new::ManualStringNew, - UnusedPeekable: unused_peekable::UnusedPeekable = unused_peekable::UnusedPeekable, - BoolToIntWithIf: bool_to_int_with_if::BoolToIntWithIf = bool_to_int_with_if::BoolToIntWithIf, - BoxDefault: box_default::BoxDefault = box_default::BoxDefault, - ImplicitSaturatingAdd: implicit_saturating_add::ImplicitSaturatingAdd = implicit_saturating_add::ImplicitSaturatingAdd, - MissingTraitMethods: missing_trait_methods::MissingTraitMethods = missing_trait_methods::MissingTraitMethods::new(conf), - FromRawWithVoidPtr: from_raw_with_void_ptr::FromRawWithVoidPtr = from_raw_with_void_ptr::FromRawWithVoidPtr, - ConfusingXorAndPow: suspicious_xor_used_as_pow::ConfusingXorAndPow = suspicious_xor_used_as_pow::ConfusingXorAndPow, - ManualIsAsciiCheck: manual_is_ascii_check::ManualIsAsciiCheck = manual_is_ascii_check::ManualIsAsciiCheck::new(conf), - SemicolonBlock: semicolon_block::SemicolonBlock = semicolon_block::SemicolonBlock::new(conf), - PermissionsSetReadonlyFalse: permissions_set_readonly_false::PermissionsSetReadonlyFalse = permissions_set_readonly_false::PermissionsSetReadonlyFalse, - SizeOfRef: size_of_ref::SizeOfRef = size_of_ref::SizeOfRef, - MultipleUnsafeOpsPerBlock: multiple_unsafe_ops_per_block::MultipleUnsafeOpsPerBlock = multiple_unsafe_ops_per_block::MultipleUnsafeOpsPerBlock, - ExtraUnusedTypeParameters: extra_unused_type_parameters::ExtraUnusedTypeParameters = extra_unused_type_parameters::ExtraUnusedTypeParameters::new(conf), - NoMangleWithRustAbi: no_mangle_with_rust_abi::NoMangleWithRustAbi = no_mangle_with_rust_abi::NoMangleWithRustAbi, - CollectionIsNeverRead: collection_is_never_read::CollectionIsNeverRead = collection_is_never_read::CollectionIsNeverRead, - MissingAssertMessage: missing_assert_message::MissingAssertMessage = missing_assert_message::MissingAssertMessage, - NeedlessMaybeSized: needless_maybe_sized::NeedlessMaybeSized = needless_maybe_sized::NeedlessMaybeSized, - RedundantAsyncBlock: redundant_async_block::RedundantAsyncBlock = redundant_async_block::RedundantAsyncBlock, - ManualMainSeparatorStr: manual_main_separator_str::ManualMainSeparatorStr = manual_main_separator_str::ManualMainSeparatorStr::new(conf), - UnnecessaryStruct: unnecessary_struct_initialization::UnnecessaryStruct = unnecessary_struct_initialization::UnnecessaryStruct, - UnnecessaryBoxReturns: unnecessary_box_returns::UnnecessaryBoxReturns = unnecessary_box_returns::UnnecessaryBoxReturns::new(conf), - TestsOutsideTestModule: tests_outside_test_module::TestsOutsideTestModule = tests_outside_test_module::TestsOutsideTestModule, - ManualSliceSizeCalculation: manual_slice_size_calculation::ManualSliceSizeCalculation = manual_slice_size_calculation::ManualSliceSizeCalculation::new(conf), - ItemsAfterTestModule: items_after_test_module::ItemsAfterTestModule = items_after_test_module::ItemsAfterTestModule, - DefaultConstructedUnitStructs: default_constructed_unit_structs::DefaultConstructedUnitStructs = default_constructed_unit_structs::DefaultConstructedUnitStructs, - MissingFieldsInDebug: missing_fields_in_debug::MissingFieldsInDebug = missing_fields_in_debug::MissingFieldsInDebug, - EndianBytes: endian_bytes::EndianBytes = endian_bytes::EndianBytes, - RedundantTypeAnnotations: redundant_type_annotations::RedundantTypeAnnotations = redundant_type_annotations::RedundantTypeAnnotations, - ArcWithNonSendSync: arc_with_non_send_sync::ArcWithNonSendSync = arc_with_non_send_sync::ArcWithNonSendSync, - NeedlessIfs: needless_ifs::NeedlessIfs = needless_ifs::NeedlessIfs, - MinIdentChars: min_ident_chars::MinIdentChars = min_ident_chars::MinIdentChars::new(conf), - LargeStackFrames: large_stack_frames::LargeStackFrames = large_stack_frames::LargeStackFrames::new(conf), - SingleRangeInVecInit: single_range_in_vec_init::SingleRangeInVecInit = single_range_in_vec_init::SingleRangeInVecInit, - NeedlessPassByRefMut: needless_pass_by_ref_mut::NeedlessPassByRefMut<'tcx> = needless_pass_by_ref_mut::NeedlessPassByRefMut::new(conf), - NonCanonicalImpls: non_canonical_impls::NonCanonicalImpls = non_canonical_impls::NonCanonicalImpls::new(tcx), - SingleCallFn: single_call_fn::SingleCallFn = single_call_fn::SingleCallFn::new(conf), - LegacyNumericConstants: legacy_numeric_constants::LegacyNumericConstants = legacy_numeric_constants::LegacyNumericConstants::new(conf), - ManualRangePatterns: manual_range_patterns::ManualRangePatterns = manual_range_patterns::ManualRangePatterns, - TupleArrayConversions: tuple_array_conversions::TupleArrayConversions = tuple_array_conversions::TupleArrayConversions::new(conf), - ManualFloatMethods: manual_float_methods::ManualFloatMethods = manual_float_methods::ManualFloatMethods::new(conf), - FourForwardSlashes: four_forward_slashes::FourForwardSlashes = four_forward_slashes::FourForwardSlashes, - ErrorImplError: error_impl_error::ErrorImplError = error_impl_error::ErrorImplError, - AbsolutePaths: absolute_paths::AbsolutePaths = absolute_paths::AbsolutePaths::new(conf), - RedundantLocals: redundant_locals::RedundantLocals = redundant_locals::RedundantLocals, - IgnoredUnitPatterns: ignored_unit_patterns::IgnoredUnitPatterns = ignored_unit_patterns::IgnoredUnitPatterns, - ReserveAfterInitialization: reserve_after_initialization::ReserveAfterInitialization = ::default(), - ImpliedBoundsInImpls: implied_bounds_in_impls::ImpliedBoundsInImpls = implied_bounds_in_impls::ImpliedBoundsInImpls, - MissingAssertsForIndexing: missing_asserts_for_indexing::MissingAssertsForIndexing = missing_asserts_for_indexing::MissingAssertsForIndexing, - UnnecessaryMapOnConstructor: unnecessary_map_on_constructor::UnnecessaryMapOnConstructor = unnecessary_map_on_constructor::UnnecessaryMapOnConstructor, - NeedlessBorrowsForGenericArgs: needless_borrows_for_generic_args::NeedlessBorrowsForGenericArgs<'tcx> = needless_borrows_for_generic_args::NeedlessBorrowsForGenericArgs::new( conf, ), - ManualHashOne: manual_hash_one::ManualHashOne = manual_hash_one::ManualHashOne::new(conf), - IterWithoutIntoIter: iter_without_into_iter::IterWithoutIntoIter = iter_without_into_iter::IterWithoutIntoIter, - PathbufThenPush: pathbuf_init_then_push::PathbufThenPush<'tcx> = >::default(), - IterOverHashType: iter_over_hash_type::IterOverHashType = iter_over_hash_type::IterOverHashType, - ImplHashWithBorrowStrBytes: impl_hash_with_borrow_str_and_bytes::ImplHashWithBorrowStrBytes = impl_hash_with_borrow_str_and_bytes::ImplHashWithBorrowStrBytes, - RepeatVecWithCapacity: repeat_vec_with_capacity::RepeatVecWithCapacity = repeat_vec_with_capacity::RepeatVecWithCapacity::new(conf), - UninhabitedReferences: uninhabited_references::UninhabitedReferences = uninhabited_references::UninhabitedReferences, - IneffectiveOpenOptions: ineffective_open_options::IneffectiveOpenOptions = ineffective_open_options::IneffectiveOpenOptions, - UnconditionalRecursion: unconditional_recursion::UnconditionalRecursion = ::default(), - PubUnderscoreFields: pub_underscore_fields::PubUnderscoreFields = pub_underscore_fields::PubUnderscoreFields::new(conf), - MissingConstForThreadLocal: missing_const_for_thread_local::MissingConstForThreadLocal = missing_const_for_thread_local::MissingConstForThreadLocal::new(conf), - IncompatibleMsrv: incompatible_msrv::IncompatibleMsrv = incompatible_msrv::IncompatibleMsrv::new(tcx, conf), - ToStringTraitImpl: to_string_trait_impl::ToStringTraitImpl = to_string_trait_impl::ToStringTraitImpl, - AssigningClones: assigning_clones::AssigningClones = assigning_clones::AssigningClones::new(conf), - ZeroRepeatSideEffects: zero_repeat_side_effects::ZeroRepeatSideEffects = zero_repeat_side_effects::ZeroRepeatSideEffects, - ExprMetavarsInUnsafe: macro_metavars_in_unsafe::ExprMetavarsInUnsafe = macro_metavars_in_unsafe::ExprMetavarsInUnsafe::new(conf), - StringPatterns: string_patterns::StringPatterns = string_patterns::StringPatterns::new(conf), - SetContainsOrInsert: set_contains_or_insert::SetContainsOrInsert = set_contains_or_insert::SetContainsOrInsert, - ZombieProcesses: zombie_processes::ZombieProcesses = zombie_processes::ZombieProcesses, - PointersInNomemAsmBlock: pointers_in_nomem_asm_block::PointersInNomemAsmBlock = pointers_in_nomem_asm_block::PointersInNomemAsmBlock, - ManualIsPowerOfTwo: manual_is_power_of_two::ManualIsPowerOfTwo = manual_is_power_of_two::ManualIsPowerOfTwo::new(conf), - NonZeroSuggestions: non_zero_suggestions::NonZeroSuggestions = non_zero_suggestions::NonZeroSuggestions, - LiteralStringWithFormattingArg: literal_string_with_formatting_args::LiteralStringWithFormattingArg = literal_string_with_formatting_args::LiteralStringWithFormattingArg, - UnusedTraitNames: unused_trait_names::UnusedTraitNames = unused_trait_names::UnusedTraitNames::new(conf), - ManualIgnoreCaseCmp: manual_ignore_case_cmp::ManualIgnoreCaseCmp = manual_ignore_case_cmp::ManualIgnoreCaseCmp, - UnnecessaryLiteralBound: unnecessary_literal_bound::UnnecessaryLiteralBound = unnecessary_literal_bound::UnnecessaryLiteralBound, - ArbitrarySourceItemOrdering: arbitrary_source_item_ordering::ArbitrarySourceItemOrdering = arbitrary_source_item_ordering::ArbitrarySourceItemOrdering::new(tcx, conf), - UselessConcat: useless_concat::UselessConcat = useless_concat::UselessConcat, - UnneededStructPattern: unneeded_struct_pattern::UnneededStructPattern = unneeded_struct_pattern::UnneededStructPattern, - UnnecessarySemicolon: unnecessary_semicolon::UnnecessarySemicolon = ::default(), - NonStdLazyStatic: non_std_lazy_statics::NonStdLazyStatic = non_std_lazy_statics::NonStdLazyStatic::new(conf), - ManualOptionAsSlice: manual_option_as_slice::ManualOptionAsSlice = manual_option_as_slice::ManualOptionAsSlice::new(conf), - SingleOptionMap: single_option_map::SingleOptionMap = single_option_map::SingleOptionMap, - RedundantTestPrefix: redundant_test_prefix::RedundantTestPrefix = redundant_test_prefix::RedundantTestPrefix, - ClonedRefToSliceRefs: cloned_ref_to_slice_refs::ClonedRefToSliceRefs = cloned_ref_to_slice_refs::ClonedRefToSliceRefs::new(conf), - InfallibleTryFrom: infallible_try_from::InfallibleTryFrom = infallible_try_from::InfallibleTryFrom, - CoerceContainerToAny: coerce_container_to_any::CoerceContainerToAny = coerce_container_to_any::CoerceContainerToAny, - ToplevelRefArg: toplevel_ref_arg::ToplevelRefArg = toplevel_ref_arg::ToplevelRefArg, - VolatileComposites: volatile_composites::VolatileComposites = volatile_composites::VolatileComposites, - ReplaceBox: replace_box::ReplaceBox = ::default(), - DisallowedFields: disallowed_fields::DisallowedFields = disallowed_fields::DisallowedFields::new(tcx, conf), - ManualIlog2: manual_ilog2::ManualIlog2 = manual_ilog2::ManualIlog2::new(conf), - SameLengthAndCapacity: same_length_and_capacity::SameLengthAndCapacity = same_length_and_capacity::SameLengthAndCapacity, - DurationSuboptimalUnits: duration_suboptimal_units::DurationSuboptimalUnits = duration_suboptimal_units::DurationSuboptimalUnits::new(tcx, conf), - ManualTake: manual_take::ManualTake = manual_take::ManualTake::new(conf), - ManualCheckedOps: manual_checked_ops::ManualCheckedOps = manual_checked_ops::ManualCheckedOps, - ManualPopIf: manual_pop_if::ManualPopIf = manual_pop_if::ManualPopIf::new(tcx, conf), - ManualNoopWaker: manual_noop_waker::ManualNoopWaker = manual_noop_waker::ManualNoopWaker::new(conf), - ByteCharSlice: byte_char_slices::ByteCharSlice = byte_char_slices::ByteCharSlice, - ManualAssertEq: manual_assert_eq::ManualAssertEq = manual_assert_eq::ManualAssertEq, - WithCapacityZero: with_capacity_zero::WithCapacityZero = with_capacity_zero::WithCapacityZero, - RefPatterns: ref_patterns::RefPatterns = ref_patterns::RefPatterns, - RedundantElse: redundant_else::RedundantElse = redundant_else::RedundantElse, - RestWhenDestructuringStruct: rest_when_destructuring_struct::RestWhenDestructuringStruct = rest_when_destructuring_struct::RestWhenDestructuringStruct, - BlockScrutinee: block_scrutinee::BlockScrutinee = block_scrutinee::BlockScrutinee, - NonnullUncheckedOnBoxPtr: nonnull_unchecked_on_box_ptr::NonnullUncheckedOnBoxPtr = nonnull_unchecked_on_box_ptr::NonnullUncheckedOnBoxPtr::new(conf), - NeedlessNonzeroGet: needless_nonzero_get::NeedlessNonzeroGet = needless_nonzero_get::NeedlessNonzeroGet::new(conf), - // add late passes here, used by `cargo dev new_lint` - ]] -); diff --git a/clippy_lints/src/matches/significant_drop_in_scrutinee.rs b/clippy_lints/src/matches/significant_drop_in_scrutinee.rs index db1e4f2717bd..49531116d80a 100644 --- a/clippy_lints/src/matches/significant_drop_in_scrutinee.rs +++ b/clippy_lints/src/matches/significant_drop_in_scrutinee.rs @@ -1,13 +1,12 @@ use std::ops::ControlFlow; -use crate::FxHashSet; use clippy_utils::diagnostics::span_lint_and_then; use clippy_utils::source::{first_line_of_span, indent_of, snippet}; use clippy_utils::ty::{for_each_top_level_late_bound_region, is_copy}; use clippy_utils::{get_builtin_attr, is_lint_allowed, sym}; use itertools::Itertools as _; use rustc_ast::Mutability; -use rustc_data_structures::fx::FxIndexSet; +use rustc_data_structures::fx::{FxHashSet, FxIndexSet}; use rustc_errors::{Applicability, Diag}; use rustc_hir::intravisit::{Visitor, walk_expr}; use rustc_hir::{Arm, Expr, ExprKind, MatchSource}; diff --git a/src/combined_passes.rs b/src/combined_passes.rs new file mode 100644 index 000000000000..e3f44e59be8c --- /dev/null +++ b/src/combined_passes.rs @@ -0,0 +1,3416 @@ +// This file was generated by `cargo dev update_lints`. +// Use that command to update this file and do not edit by hand. +// Manual edits will be overwritten. + +#![rustfmt::skip] +#![expect( + non_snake_case, + non_upper_case_globals, + clippy::too_many_lines, + rustc::lint_pass_impl_without_macro, +)] + +use clippy_config::Conf; +use clippy_utils::macros::FormatArgsStorage; +use clippy_lints::utils::attr_collector::AttrStorage; +use rustc_data_structures::unord::UnordSet; +use rustc_lint::{ + EarlyContext, EarlyLintPass, LateContext, LateLintPass, Lint, LintId, LintPass, LintVec, early_lint_methods, + late_lint_methods, +}; +use rustc_middle::ty::TyCtxt; + +fn is_lint_pass_required(skippable: &UnordSet, lints: &[&'static Lint]) -> bool { + let skippable = !lints.is_empty() && lints.iter().all(|lint| skippable.contains(&LintId::of(lint))); + !skippable +} + +static AbsolutePaths_LINTS: &[&Lint] = &[ + ::clippy_lints::absolute_paths::ABSOLUTE_PATHS, +]; +static ApproxConstant_LINTS: &[&Lint] = &[ + ::clippy_lints::approx_const::APPROX_CONSTANT, +]; +static ArbitrarySourceItemOrdering_LINTS: &[&Lint] = &[ + ::clippy_lints::arbitrary_source_item_ordering::ARBITRARY_SOURCE_ITEM_ORDERING, +]; +static ArcWithNonSendSync_LINTS: &[&Lint] = &[ + ::clippy_lints::arc_with_non_send_sync::ARC_WITH_NON_SEND_SYNC, +]; +static AsConversions_LINTS: &[&Lint] = &[ + ::clippy_lints::as_conversions::AS_CONVERSIONS, +]; +static AssertIsEmpty_LINTS: &[&Lint] = &[ + ::clippy_lints::assert_is_empty::ASSERT_IS_EMPTY, +]; +static AssertionsOnConstants_LINTS: &[&Lint] = &[ + ::clippy_lints::assertions_on_constants::ASSERTIONS_ON_CONSTANTS, +]; +static AssertionsOnResultStates_LINTS: &[&Lint] = &[ + ::clippy_lints::assertions_on_result_states::ASSERTIONS_ON_RESULT_STATES, +]; +static AssigningClones_LINTS: &[&Lint] = &[ + ::clippy_lints::assigning_clones::ASSIGNING_CLONES, +]; +static AsyncYieldsAsync_LINTS: &[&Lint] = &[ + ::clippy_lints::async_yields_async::ASYNC_YIELDS_ASYNC, +]; +static Attributes_LINTS: &[&Lint] = &[ + ::clippy_lints::attrs::INLINE_ALWAYS, + ::clippy_lints::attrs::REPR_PACKED_WITHOUT_ABI, +]; +static AwaitHolding_LINTS: &[&Lint] = &[ + ::clippy_lints::await_holding_invalid::AWAIT_HOLDING_INVALID_TYPE, + ::clippy_lints::await_holding_invalid::AWAIT_HOLDING_LOCK, + ::clippy_lints::await_holding_invalid::AWAIT_HOLDING_REFCELL_REF, +]; +static ManualBitWidth_LINTS: &[&Lint] = &[ + ::clippy_lints::bit_width::MANUAL_BIT_WIDTH, + ::clippy_lints::bit_width::MISMATCHED_BIT_WIDTH_TYPE, +]; +static BlockScrutinee_LINTS: &[&Lint] = &[ + ::clippy_lints::block_scrutinee::BLOCK_SCRUTINEE, +]; +static BlocksInConditions_LINTS: &[&Lint] = &[ + ::clippy_lints::blocks_in_conditions::BLOCKS_IN_CONDITIONS, +]; +static BoolAssertComparison_LINTS: &[&Lint] = &[ + ::clippy_lints::bool_assert_comparison::BOOL_ASSERT_COMPARISON, +]; +static BoolComparison_LINTS: &[&Lint] = &[ + ::clippy_lints::bool_comparison::BOOL_COMPARISON, +]; +static BoolToIntWithIf_LINTS: &[&Lint] = &[ + ::clippy_lints::bool_to_int_with_if::BOOL_TO_INT_WITH_IF, +]; +static NonminimalBool_LINTS: &[&Lint] = &[ + ::clippy_lints::booleans::NONMINIMAL_BOOL, + ::clippy_lints::booleans::OVERLY_COMPLEX_BOOL_EXPR, +]; +static BorrowDerefRef_LINTS: &[&Lint] = &[ + ::clippy_lints::borrow_deref_ref::BORROW_DEREF_REF, +]; +static BoxDefault_LINTS: &[&Lint] = &[ + ::clippy_lints::box_default::BOX_DEFAULT, +]; +static ByteCharSlice_LINTS: &[&Lint] = &[ + ::clippy_lints::byte_char_slices::BYTE_CHAR_SLICES, +]; +static Cargo_LINTS: &[&Lint] = &[ + ::clippy_lints::cargo::CARGO_COMMON_METADATA, + ::clippy_lints::cargo::LINT_GROUPS_PRIORITY, + ::clippy_lints::cargo::MULTIPLE_CRATE_VERSIONS, + ::clippy_lints::cargo::NEGATIVE_FEATURE_NAMES, + ::clippy_lints::cargo::REDUNDANT_FEATURE_NAMES, + ::clippy_lints::cargo::WILDCARD_DEPENDENCIES, +]; +static Casts_LINTS: &[&Lint] = &[ + ::clippy_lints::casts::AS_POINTER_UNDERSCORE, + ::clippy_lints::casts::AS_PTR_CAST_MUT, + ::clippy_lints::casts::AS_UNDERSCORE, + ::clippy_lints::casts::BORROW_AS_PTR, + ::clippy_lints::casts::CAST_ABS_TO_UNSIGNED, + ::clippy_lints::casts::CAST_ENUM_CONSTRUCTOR, + ::clippy_lints::casts::CAST_ENUM_TRUNCATION, + ::clippy_lints::casts::CAST_LOSSLESS, + ::clippy_lints::casts::CAST_NAN_TO_INT, + ::clippy_lints::casts::CAST_POSSIBLE_TRUNCATION, + ::clippy_lints::casts::CAST_POSSIBLE_WRAP, + ::clippy_lints::casts::CAST_PRECISION_LOSS, + ::clippy_lints::casts::CAST_PTR_ALIGNMENT, + ::clippy_lints::casts::CAST_SIGN_LOSS, + ::clippy_lints::casts::CAST_SLICE_DIFFERENT_SIZES, + ::clippy_lints::casts::CAST_SLICE_FROM_RAW_PARTS, + ::clippy_lints::casts::CHAR_LIT_AS_U8, + ::clippy_lints::casts::CONFUSING_METHOD_TO_NUMERIC_CAST, + ::clippy_lints::casts::FN_TO_NUMERIC_CAST, + ::clippy_lints::casts::FN_TO_NUMERIC_CAST_ANY, + ::clippy_lints::casts::FN_TO_NUMERIC_CAST_WITH_TRUNCATION, + ::clippy_lints::casts::MANUAL_DANGLING_PTR, + ::clippy_lints::casts::NEEDLESS_TYPE_CAST, + ::clippy_lints::casts::PTR_AS_PTR, + ::clippy_lints::casts::PTR_CAST_CONSTNESS, + ::clippy_lints::casts::REF_AS_PTR, + ::clippy_lints::casts::UNNECESSARY_CAST, + ::clippy_lints::casts::ZERO_PTR, +]; +static CheckedConversions_LINTS: &[&Lint] = &[ + ::clippy_lints::checked_conversions::CHECKED_CONVERSIONS, +]; +static ClonedRefToSliceRefs_LINTS: &[&Lint] = &[ + ::clippy_lints::cloned_ref_to_slice_refs::CLONED_REF_TO_SLICE_REFS, +]; +static CoerceContainerToAny_LINTS: &[&Lint] = &[ + ::clippy_lints::coerce_container_to_any::COERCE_CONTAINER_TO_ANY, +]; +static CognitiveComplexity_LINTS: &[&Lint] = &[ + ::clippy_lints::cognitive_complexity::COGNITIVE_COMPLEXITY, +]; +static CollapsibleIf_LINTS: &[&Lint] = &[ + ::clippy_lints::collapsible_if::COLLAPSIBLE_ELSE_IF, + ::clippy_lints::collapsible_if::COLLAPSIBLE_IF, +]; +static CollectionIsNeverRead_LINTS: &[&Lint] = &[ + ::clippy_lints::collection_is_never_read::COLLECTION_IS_NEVER_READ, +]; +static ComparisonChain_LINTS: &[&Lint] = &[ + ::clippy_lints::comparison_chain::COMPARISON_CHAIN, +]; +static CopyIterator_LINTS: &[&Lint] = &[ + ::clippy_lints::copy_iterator::COPY_ITERATOR, +]; +static CreateDir_LINTS: &[&Lint] = &[ + ::clippy_lints::create_dir::CREATE_DIR, +]; +static DbgMacro_LINTS: &[&Lint] = &[ + ::clippy_lints::dbg_macro::DBG_MACRO, +]; +static Default_LINTS: &[&Lint] = &[ + ::clippy_lints::default::DEFAULT_TRAIT_ACCESS, + ::clippy_lints::default::FIELD_REASSIGN_WITH_DEFAULT, +]; +static DefaultConstructedUnitStructs_LINTS: &[&Lint] = &[ + ::clippy_lints::default_constructed_unit_structs::DEFAULT_CONSTRUCTED_UNIT_STRUCTS, +]; +static DefaultIterEmpty_LINTS: &[&Lint] = &[ + ::clippy_lints::default_instead_of_iter_empty::DEFAULT_INSTEAD_OF_ITER_EMPTY, +]; +static DefaultNumericFallback_LINTS: &[&Lint] = &[ + ::clippy_lints::default_numeric_fallback::DEFAULT_NUMERIC_FALLBACK, +]; +static DefaultUnionRepresentation_LINTS: &[&Lint] = &[ + ::clippy_lints::default_union_representation::DEFAULT_UNION_REPRESENTATION, +]; +static Dereferencing_LINTS: &[&Lint] = &[ + ::clippy_lints::dereference::EXPLICIT_AUTO_DEREF, + ::clippy_lints::dereference::EXPLICIT_DEREF_METHODS, + ::clippy_lints::dereference::NEEDLESS_BORROW, + ::clippy_lints::dereference::REF_BINDING_TO_REFERENCE, +]; +static DerivableImpls_LINTS: &[&Lint] = &[ + ::clippy_lints::derivable_impls::DERIVABLE_IMPLS, +]; +static Derive_LINTS: &[&Lint] = &[ + ::clippy_lints::derive::DERIVED_HASH_WITH_MANUAL_EQ, + ::clippy_lints::derive::DERIVE_ORD_XOR_PARTIAL_ORD, + ::clippy_lints::derive::DERIVE_PARTIAL_EQ_WITHOUT_EQ, + ::clippy_lints::derive::EXPL_IMPL_CLONE_ON_COPY, + ::clippy_lints::derive::UNSAFE_DERIVE_DESERIALIZE, +]; +static DisallowedFields_LINTS: &[&Lint] = &[ + ::clippy_lints::disallowed_fields::DISALLOWED_FIELDS, +]; +static DisallowedMacros_LINTS: &[&Lint] = &[ + ::clippy_lints::disallowed_macros::DISALLOWED_MACROS, +]; +static DisallowedMethods_LINTS: &[&Lint] = &[ + ::clippy_lints::disallowed_methods::DISALLOWED_METHODS, +]; +static DisallowedNames_LINTS: &[&Lint] = &[ + ::clippy_lints::disallowed_names::DISALLOWED_NAMES, +]; +static DisallowedTypes_LINTS: &[&Lint] = &[ + ::clippy_lints::disallowed_types::DISALLOWED_TYPES, +]; +static Documentation_LINTS: &[&Lint] = &[ + ::clippy_lints::doc::DOC_BROKEN_LINK, + ::clippy_lints::doc::DOC_COMMENT_DOUBLE_SPACE_LINEBREAKS, + ::clippy_lints::doc::DOC_INCLUDE_WITHOUT_CFG, + ::clippy_lints::doc::DOC_LAZY_CONTINUATION, + ::clippy_lints::doc::DOC_LINK_CODE, + ::clippy_lints::doc::DOC_LINK_WITH_QUOTES, + ::clippy_lints::doc::DOC_MARKDOWN, + ::clippy_lints::doc::DOC_NESTED_REFDEFS, + ::clippy_lints::doc::DOC_OVERINDENTED_LIST_ITEMS, + ::clippy_lints::doc::DOC_PARAGRAPHS_MISSING_PUNCTUATION, + ::clippy_lints::doc::DOC_SUSPICIOUS_FOOTNOTES, + ::clippy_lints::doc::EMPTY_DOCS, + ::clippy_lints::doc::MISSING_ERRORS_DOC, + ::clippy_lints::doc::MISSING_PANICS_DOC, + ::clippy_lints::doc::MISSING_SAFETY_DOC, + ::clippy_lints::doc::NEEDLESS_DOCTEST_MAIN, + ::clippy_lints::doc::SUSPICIOUS_DOC_COMMENTS, + ::clippy_lints::doc::TEST_ATTR_IN_DOCTEST, + ::clippy_lints::doc::TOO_LONG_FIRST_DOC_PARAGRAPH, + ::clippy_lints::doc::UNNECESSARY_SAFETY_DOC, +]; +static DropForgetRef_LINTS: &[&Lint] = &[ + ::clippy_lints::drop_forget_ref::DROP_NON_DROP, + ::clippy_lints::drop_forget_ref::FORGET_NON_DROP, + ::clippy_lints::drop_forget_ref::MEM_FORGET, +]; +static DurationSuboptimalUnits_LINTS: &[&Lint] = &[ + ::clippy_lints::duration_suboptimal_units::DURATION_SUBOPTIMAL_UNITS, +]; +static EmptyDrop_LINTS: &[&Lint] = &[ + ::clippy_lints::empty_drop::EMPTY_DROP, +]; +static EmptyEnums_LINTS: &[&Lint] = &[ + ::clippy_lints::empty_enums::EMPTY_ENUMS, +]; +static EmptyWithBrackets_LINTS: &[&Lint] = &[ + ::clippy_lints::empty_with_brackets::EMPTY_ENUM_VARIANTS_WITH_BRACKETS, + ::clippy_lints::empty_with_brackets::EMPTY_STRUCTS_WITH_BRACKETS, +]; +static EndianBytes_LINTS: &[&Lint] = &[ + ::clippy_lints::endian_bytes::BIG_ENDIAN_BYTES, + ::clippy_lints::endian_bytes::HOST_ENDIAN_BYTES, + ::clippy_lints::endian_bytes::LITTLE_ENDIAN_BYTES, +]; +static HashMapPass_LINTS: &[&Lint] = &[ + ::clippy_lints::entry::MAP_ENTRY, +]; +static UnportableVariant_LINTS: &[&Lint] = &[ + ::clippy_lints::enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT, +]; +static PatternEquality_LINTS: &[&Lint] = &[ + ::clippy_lints::equatable_if_let::EQUATABLE_IF_LET, +]; +static ErrorImplError_LINTS: &[&Lint] = &[ + ::clippy_lints::error_impl_error::ERROR_IMPL_ERROR, +]; +static BoxedLocal_LINTS: &[&Lint] = &[ + ::clippy_lints::escape::BOXED_LOCAL, +]; +static EtaReduction_LINTS: &[&Lint] = &[ + ::clippy_lints::eta_reduction::REDUNDANT_CLOSURE, + ::clippy_lints::eta_reduction::REDUNDANT_CLOSURE_FOR_METHOD_CALLS, +]; +static ExcessiveBools_LINTS: &[&Lint] = &[ + ::clippy_lints::excessive_bools::FN_PARAMS_EXCESSIVE_BOOLS, + ::clippy_lints::excessive_bools::STRUCT_EXCESSIVE_BOOLS, +]; +static ExhaustiveItems_LINTS: &[&Lint] = &[ + ::clippy_lints::exhaustive_items::EXHAUSTIVE_ENUMS, + ::clippy_lints::exhaustive_items::EXHAUSTIVE_STRUCTS, +]; +static Exit_LINTS: &[&Lint] = &[ + ::clippy_lints::exit::EXIT, +]; +static ExplicitWrite_LINTS: &[&Lint] = &[ + ::clippy_lints::explicit_write::EXPLICIT_WRITE, +]; +static ExtraUnusedTypeParameters_LINTS: &[&Lint] = &[ + ::clippy_lints::extra_unused_type_parameters::EXTRA_UNUSED_TYPE_PARAMETERS, +]; +static FallibleImplFrom_LINTS: &[&Lint] = &[ + ::clippy_lints::fallible_impl_from::FALLIBLE_IMPL_FROM, +]; +static FloatLiteral_LINTS: &[&Lint] = &[ + ::clippy_lints::float_literal::EXCESSIVE_PRECISION, + ::clippy_lints::float_literal::LOSSY_FLOAT_LITERAL, +]; +static FloatingPointArithmetic_LINTS: &[&Lint] = &[ + ::clippy_lints::floating_point_arithmetic::IMPRECISE_FLOPS, + ::clippy_lints::floating_point_arithmetic::SUBOPTIMAL_FLOPS, +]; +static UselessFormat_LINTS: &[&Lint] = &[ + ::clippy_lints::format::USELESS_FORMAT, +]; +static FormatArgs_LINTS: &[&Lint] = &[ + ::clippy_lints::format_args::FORMAT_IN_FORMAT_ARGS, + ::clippy_lints::format_args::POINTER_FORMAT, + ::clippy_lints::format_args::TO_STRING_IN_FORMAT_ARGS, + ::clippy_lints::format_args::UNINLINED_FORMAT_ARGS, + ::clippy_lints::format_args::UNNECESSARY_DEBUG_FORMATTING, + ::clippy_lints::format_args::UNNECESSARY_TRAILING_COMMA, + ::clippy_lints::format_args::UNUSED_FORMAT_SPECS, + ::clippy_lints::format_args::USELESS_BORROWS_IN_FORMATTING, +]; +static FormatImpl_LINTS: &[&Lint] = &[ + ::clippy_lints::format_impl::PRINT_IN_FORMAT_IMPL, + ::clippy_lints::format_impl::RECURSIVE_FORMAT_IMPL, +]; +static FormatPushString_LINTS: &[&Lint] = &[ + ::clippy_lints::format_push_string::FORMAT_PUSH_STRING, +]; +static FourForwardSlashes_LINTS: &[&Lint] = &[ + ::clippy_lints::four_forward_slashes::FOUR_FORWARD_SLASHES, +]; +static FromOverInto_LINTS: &[&Lint] = &[ + ::clippy_lints::from_over_into::FROM_OVER_INTO, +]; +static FromRawWithVoidPtr_LINTS: &[&Lint] = &[ + ::clippy_lints::from_raw_with_void_ptr::FROM_RAW_WITH_VOID_PTR, +]; +static FromStrRadix10_LINTS: &[&Lint] = &[ + ::clippy_lints::from_str_radix_10::FROM_STR_RADIX_10, +]; +static Functions_LINTS: &[&Lint] = &[ + ::clippy_lints::functions::DOUBLE_MUST_USE, + ::clippy_lints::functions::IMPL_TRAIT_IN_PARAMS, + ::clippy_lints::functions::MISNAMED_GETTERS, + ::clippy_lints::functions::MUST_USE_CANDIDATE, + ::clippy_lints::functions::MUST_USE_UNIT, + ::clippy_lints::functions::NOT_UNSAFE_PTR_ARG_DEREF, + ::clippy_lints::functions::REF_OPTION, + ::clippy_lints::functions::RENAMED_FUNCTION_PARAMS, + ::clippy_lints::functions::RESULT_LARGE_ERR, + ::clippy_lints::functions::RESULT_UNIT_ERR, + ::clippy_lints::functions::TOO_MANY_ARGUMENTS, + ::clippy_lints::functions::TOO_MANY_LINES, +]; +static FutureNotSend_LINTS: &[&Lint] = &[ + ::clippy_lints::future_not_send::FUTURE_NOT_SEND, +]; +static IfLetMutex_LINTS: &[&Lint] = &[ + ::clippy_lints::if_let_mutex::IF_LET_MUTEX, +]; +static IfNotElse_LINTS: &[&Lint] = &[ + ::clippy_lints::if_not_else::IF_NOT_ELSE, +]; +static IfThenSomeElseNone_LINTS: &[&Lint] = &[ + ::clippy_lints::if_then_some_else_none::IF_THEN_SOME_ELSE_NONE, +]; +static CopyAndPaste_LINTS: &[&Lint] = &[ + ::clippy_lints::ifs::BRANCHES_SHARING_CODE, + ::clippy_lints::ifs::IFS_SAME_COND, + ::clippy_lints::ifs::IF_SAME_THEN_ELSE, + ::clippy_lints::ifs::SAME_FUNCTIONS_IN_IF_CONDITION, +]; +static IgnoredUnitPatterns_LINTS: &[&Lint] = &[ + ::clippy_lints::ignored_unit_patterns::IGNORED_UNIT_PATTERNS, +]; +static ImplHashWithBorrowStrBytes_LINTS: &[&Lint] = &[ + ::clippy_lints::impl_hash_with_borrow_str_and_bytes::IMPL_HASH_BORROW_WITH_STR_AND_BYTES, +]; +static ImplicitHasher_LINTS: &[&Lint] = &[ + ::clippy_lints::implicit_hasher::IMPLICIT_HASHER, +]; +static ImplicitReturn_LINTS: &[&Lint] = &[ + ::clippy_lints::implicit_return::IMPLICIT_RETURN, +]; +static ImplicitSaturatingAdd_LINTS: &[&Lint] = &[ + ::clippy_lints::implicit_saturating_add::IMPLICIT_SATURATING_ADD, +]; +static ImplicitSaturatingSub_LINTS: &[&Lint] = &[ + ::clippy_lints::implicit_saturating_sub::IMPLICIT_SATURATING_SUB, + ::clippy_lints::implicit_saturating_sub::INVERTED_SATURATING_SUB, +]; +static ImpliedBoundsInImpls_LINTS: &[&Lint] = &[ + ::clippy_lints::implied_bounds_in_impls::IMPLIED_BOUNDS_IN_IMPLS, +]; +static IncompatibleMsrv_LINTS: &[&Lint] = &[ + ::clippy_lints::incompatible_msrv::INCOMPATIBLE_MSRV, +]; +static InconsistentStructConstructor_LINTS: &[&Lint] = &[ + ::clippy_lints::inconsistent_struct_constructor::INCONSISTENT_STRUCT_CONSTRUCTOR, +]; +static IndexRefutableSlice_LINTS: &[&Lint] = &[ + ::clippy_lints::index_refutable_slice::INDEX_REFUTABLE_SLICE, +]; +static IndexingSlicing_LINTS: &[&Lint] = &[ + ::clippy_lints::indexing_slicing::INDEXING_SLICING, + ::clippy_lints::indexing_slicing::OUT_OF_BOUNDS_INDEXING, +]; +static IneffectiveOpenOptions_LINTS: &[&Lint] = &[ + ::clippy_lints::ineffective_open_options::INEFFECTIVE_OPEN_OPTIONS, +]; +static InfallibleTryFrom_LINTS: &[&Lint] = &[ + ::clippy_lints::infallible_try_from::INFALLIBLE_TRY_FROM, +]; +static InfiniteIter_LINTS: &[&Lint] = &[ + ::clippy_lints::infinite_iter::INFINITE_ITER, + ::clippy_lints::infinite_iter::MAYBE_INFINITE_ITER, +]; +static MultipleInherentImpl_LINTS: &[&Lint] = &[ + ::clippy_lints::inherent_impl::MULTIPLE_INHERENT_IMPL, +]; +static InherentToString_LINTS: &[&Lint] = &[ + ::clippy_lints::inherent_to_string::INHERENT_TO_STRING, + ::clippy_lints::inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY, +]; +static NumberedFields_LINTS: &[&Lint] = &[ + ::clippy_lints::init_numbered_fields::INIT_NUMBERED_FIELDS, +]; +static InlineFnWithoutBody_LINTS: &[&Lint] = &[ + ::clippy_lints::inline_fn_without_body::INLINE_FN_WITHOUT_BODY, +]; +static ItemNameRepetitions_LINTS: &[&Lint] = &[ + ::clippy_lints::item_name_repetitions::ENUM_VARIANT_NAMES, + ::clippy_lints::item_name_repetitions::MODULE_INCEPTION, + ::clippy_lints::item_name_repetitions::MODULE_NAME_REPETITIONS, + ::clippy_lints::item_name_repetitions::STRUCT_FIELD_NAMES, +]; +static ItemsAfterStatements_LINTS: &[&Lint] = &[ + ::clippy_lints::items_after_statements::ITEMS_AFTER_STATEMENTS, +]; +static ItemsAfterTestModule_LINTS: &[&Lint] = &[ + ::clippy_lints::items_after_test_module::ITEMS_AFTER_TEST_MODULE, +]; +static IterNotReturningIterator_LINTS: &[&Lint] = &[ + ::clippy_lints::iter_not_returning_iterator::ITER_NOT_RETURNING_ITERATOR, +]; +static IterOverHashType_LINTS: &[&Lint] = &[ + ::clippy_lints::iter_over_hash_type::ITER_OVER_HASH_TYPE, +]; +static IterWithoutIntoIter_LINTS: &[&Lint] = &[ + ::clippy_lints::iter_without_into_iter::INTO_ITER_WITHOUT_ITER, + ::clippy_lints::iter_without_into_iter::ITER_WITHOUT_INTO_ITER, +]; +static LargeConstArrays_LINTS: &[&Lint] = &[ + ::clippy_lints::large_const_arrays::LARGE_CONST_ARRAYS, +]; +static LargeEnumVariant_LINTS: &[&Lint] = &[ + ::clippy_lints::large_enum_variant::LARGE_ENUM_VARIANT, +]; +static LargeFuture_LINTS: &[&Lint] = &[ + ::clippy_lints::large_futures::LARGE_FUTURES, +]; +static LargeIncludeFile_LINTS: &[&Lint] = &[ + ::clippy_lints::large_include_file::LARGE_INCLUDE_FILE, +]; +static LargeStackArrays_LINTS: &[&Lint] = &[ + ::clippy_lints::large_stack_arrays::LARGE_STACK_ARRAYS, +]; +static LargeStackFrames_LINTS: &[&Lint] = &[ + ::clippy_lints::large_stack_frames::LARGE_STACK_FRAMES, +]; +static LegacyNumericConstants_LINTS: &[&Lint] = &[ + ::clippy_lints::legacy_numeric_constants::LEGACY_NUMERIC_CONSTANTS, +]; +static LenWithoutIsEmpty_LINTS: &[&Lint] = &[ + ::clippy_lints::len_without_is_empty::LEN_WITHOUT_IS_EMPTY, +]; +static LenZero_LINTS: &[&Lint] = &[ + ::clippy_lints::len_zero::COMPARISON_TO_EMPTY, + ::clippy_lints::len_zero::LEN_ZERO, +]; +static LetIfSeq_LINTS: &[&Lint] = &[ + ::clippy_lints::let_if_seq::USELESS_LET_IF_SEQ, +]; +static LetUnderscore_LINTS: &[&Lint] = &[ + ::clippy_lints::let_underscore::LET_UNDERSCORE_FUTURE, + ::clippy_lints::let_underscore::LET_UNDERSCORE_LOCK, + ::clippy_lints::let_underscore::LET_UNDERSCORE_MUST_USE, + ::clippy_lints::let_underscore::LET_UNDERSCORE_UNTYPED, +]; +static Lifetimes_LINTS: &[&Lint] = &[ + ::clippy_lints::lifetimes::ELIDABLE_LIFETIME_NAMES, + ::clippy_lints::lifetimes::EXTRA_UNUSED_LIFETIMES, + ::clippy_lints::lifetimes::NEEDLESS_LIFETIMES, +]; +static LiteralStringWithFormattingArg_LINTS: &[&Lint] = &[ + ::clippy_lints::literal_string_with_formatting_args::LITERAL_STRING_WITH_FORMATTING_ARGS, +]; +static Loops_LINTS: &[&Lint] = &[ + ::clippy_lints::loops::CHAR_INDICES_AS_BYTE_INDICES, + ::clippy_lints::loops::EMPTY_LOOP, + ::clippy_lints::loops::EXPLICIT_COUNTER_LOOP, + ::clippy_lints::loops::EXPLICIT_INTO_ITER_LOOP, + ::clippy_lints::loops::EXPLICIT_ITER_LOOP, + ::clippy_lints::loops::FOR_KV_MAP, + ::clippy_lints::loops::FOR_UNBOUNDED_RANGE, + ::clippy_lints::loops::INFINITE_LOOP, + ::clippy_lints::loops::ITER_NEXT_LOOP, + ::clippy_lints::loops::MANUAL_FIND, + ::clippy_lints::loops::MANUAL_FLATTEN, + ::clippy_lints::loops::MANUAL_MEMCPY, + ::clippy_lints::loops::MANUAL_SLICE_FILL, + ::clippy_lints::loops::MANUAL_WHILE_LET_SOME, + ::clippy_lints::loops::MISSING_SPIN_LOOP, + ::clippy_lints::loops::MUT_RANGE_BOUND, + ::clippy_lints::loops::NEEDLESS_RANGE_LOOP, + ::clippy_lints::loops::NEVER_LOOP, + ::clippy_lints::loops::SAME_ITEM_PUSH, + ::clippy_lints::loops::SINGLE_ELEMENT_LOOP, + ::clippy_lints::loops::UNUSED_ENUMERATE_INDEX, + ::clippy_lints::loops::WHILE_FLOAT, + ::clippy_lints::loops::WHILE_IMMUTABLE_CONDITION, + ::clippy_lints::loops::WHILE_LET_LOOP, + ::clippy_lints::loops::WHILE_LET_ON_ITERATOR, +]; +static ExprMetavarsInUnsafe_LINTS: &[&Lint] = &[ + ::clippy_lints::macro_metavars_in_unsafe::MACRO_METAVARS_IN_UNSAFE, +]; +static MacroUseImports_LINTS: &[&Lint] = &[ + ::clippy_lints::macro_use::MACRO_USE_IMPORTS, +]; +static MainRecursion_LINTS: &[&Lint] = &[ + ::clippy_lints::main_recursion::MAIN_RECURSION, +]; +static ManualAbsDiff_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_abs_diff::MANUAL_ABS_DIFF, +]; +static ManualAssert_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_assert::MANUAL_ASSERT, +]; +static ManualAssertEq_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_assert_eq::MANUAL_ASSERT_EQ, +]; +static ManualAsyncFn_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_async_fn::MANUAL_ASYNC_FN, +]; +static ManualBits_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_bits::MANUAL_BITS, +]; +static ManualCheckedOps_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_checked_ops::MANUAL_CHECKED_OPS, +]; +static ManualClamp_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_clamp::MANUAL_CLAMP, +]; +static ManualFloatMethods_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_float_methods::MANUAL_IS_FINITE, + ::clippy_lints::manual_float_methods::MANUAL_IS_INFINITE, +]; +static ManualHashOne_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_hash_one::MANUAL_HASH_ONE, +]; +static ManualIgnoreCaseCmp_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_ignore_case_cmp::MANUAL_IGNORE_CASE_CMP, +]; +static ManualIlog2_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_ilog2::MANUAL_ILOG2, +]; +static ManualIsAsciiCheck_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_is_ascii_check::MANUAL_IS_ASCII_CHECK, +]; +static ManualIsPowerOfTwo_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_is_power_of_two::MANUAL_IS_POWER_OF_TWO, +]; +static ManualMainSeparatorStr_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_main_separator_str::MANUAL_MAIN_SEPARATOR_STR, +]; +static ManualNonExhaustive_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE, +]; +static ManualNoopWaker_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_noop_waker::MANUAL_NOOP_WAKER, +]; +static ManualOptionAsSlice_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_option_as_slice::MANUAL_OPTION_AS_SLICE, +]; +static ManualPopIf_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_pop_if::MANUAL_POP_IF, +]; +static ManualRangePatterns_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_range_patterns::MANUAL_RANGE_PATTERNS, +]; +static ManualRemEuclid_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_rem_euclid::MANUAL_REM_EUCLID, +]; +static ManualRetain_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_retain::MANUAL_RETAIN, +]; +static ManualRotate_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_rotate::MANUAL_ROTATE, +]; +static ManualSliceSizeCalculation_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_slice_size_calculation::MANUAL_SLICE_SIZE_CALCULATION, +]; +static ManualStringNew_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_string_new::MANUAL_STRING_NEW, +]; +static ManualStrip_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_strip::MANUAL_STRIP, +]; +static ManualTake_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_take::MANUAL_TAKE, +]; +static MapUnit_LINTS: &[&Lint] = &[ + ::clippy_lints::map_unit_fn::OPTION_MAP_UNIT_FN, + ::clippy_lints::map_unit_fn::RESULT_MAP_UNIT_FN, +]; +static MatchResultOk_LINTS: &[&Lint] = &[ + ::clippy_lints::match_result_ok::MATCH_RESULT_OK, +]; +static Matches_LINTS: &[&Lint] = &[ + ::clippy_lints::matches::COLLAPSIBLE_MATCH, + ::clippy_lints::matches::INFALLIBLE_DESTRUCTURING_MATCH, + ::clippy_lints::matches::MANUAL_FILTER, + ::clippy_lints::matches::MANUAL_MAP, + ::clippy_lints::matches::MANUAL_OK_ERR, + ::clippy_lints::matches::MANUAL_UNWRAP_OR, + ::clippy_lints::matches::MANUAL_UNWRAP_OR_DEFAULT, + ::clippy_lints::matches::MATCH_AS_REF, + ::clippy_lints::matches::MATCH_BOOL, + ::clippy_lints::matches::MATCH_LIKE_MATCHES_MACRO, + ::clippy_lints::matches::MATCH_OVERLAPPING_ARM, + ::clippy_lints::matches::MATCH_REF_PATS, + ::clippy_lints::matches::MATCH_SAME_ARMS, + ::clippy_lints::matches::MATCH_SINGLE_BINDING, + ::clippy_lints::matches::MATCH_STR_CASE_MISMATCH, + ::clippy_lints::matches::MATCH_WILDCARD_FOR_SINGLE_VARIANTS, + ::clippy_lints::matches::MATCH_WILD_ERR_ARM, + ::clippy_lints::matches::NEEDLESS_MATCH, + ::clippy_lints::matches::REDUNDANT_GUARDS, + ::clippy_lints::matches::REDUNDANT_PATTERN_MATCHING, + ::clippy_lints::matches::REST_PAT_IN_FULLY_BOUND_STRUCTS, + ::clippy_lints::matches::SIGNIFICANT_DROP_IN_SCRUTINEE, + ::clippy_lints::matches::SINGLE_MATCH, + ::clippy_lints::matches::SINGLE_MATCH_ELSE, + ::clippy_lints::matches::TRY_ERR, + ::clippy_lints::matches::WILDCARD_ENUM_MATCH_ARM, + ::clippy_lints::matches::WILDCARD_IN_OR_PATTERNS, +]; +static MemReplace_LINTS: &[&Lint] = &[ + ::clippy_lints::mem_replace::MEM_REPLACE_OPTION_WITH_NONE, + ::clippy_lints::mem_replace::MEM_REPLACE_OPTION_WITH_SOME, + ::clippy_lints::mem_replace::MEM_REPLACE_WITH_DEFAULT, + ::clippy_lints::mem_replace::MEM_REPLACE_WITH_UNINIT, +]; +static Methods_LINTS: &[&Lint] = &[ + ::clippy_lints::methods::BIND_INSTEAD_OF_MAP, + ::clippy_lints::methods::BYTES_COUNT_TO_LEN, + ::clippy_lints::methods::BYTES_NTH, + ::clippy_lints::methods::BY_REF_PEEKABLE_PEEK, + ::clippy_lints::methods::CASE_SENSITIVE_FILE_EXTENSION_COMPARISONS, + ::clippy_lints::methods::CHARS_LAST_CMP, + ::clippy_lints::methods::CHARS_NEXT_CMP, + ::clippy_lints::methods::CHUNKS_EXACT_TO_AS_CHUNKS, + ::clippy_lints::methods::CLEAR_WITH_DRAIN, + ::clippy_lints::methods::CLONED_INSTEAD_OF_COPIED, + ::clippy_lints::methods::CLONE_ON_COPY, + ::clippy_lints::methods::CLONE_ON_REF_PTR, + ::clippy_lints::methods::COLLAPSIBLE_STR_REPLACE, + ::clippy_lints::methods::CONST_IS_EMPTY, + ::clippy_lints::methods::DOUBLE_ENDED_ITERATOR_LAST, + ::clippy_lints::methods::DRAIN_COLLECT, + ::clippy_lints::methods::ERR_EXPECT, + ::clippy_lints::methods::EXPECT_FUN_CALL, + ::clippy_lints::methods::EXPECT_USED, + ::clippy_lints::methods::EXTEND_WITH_DRAIN, + ::clippy_lints::methods::FILETYPE_IS_FILE, + ::clippy_lints::methods::FILTER_MAP_BOOL_THEN, + ::clippy_lints::methods::FILTER_MAP_IDENTITY, + ::clippy_lints::methods::FILTER_MAP_NEXT, + ::clippy_lints::methods::FILTER_NEXT, + ::clippy_lints::methods::FLAT_MAP_IDENTITY, + ::clippy_lints::methods::FLAT_MAP_OPTION, + ::clippy_lints::methods::FORMAT_COLLECT, + ::clippy_lints::methods::GET_FIRST, + ::clippy_lints::methods::GET_LAST_WITH_LEN, + ::clippy_lints::methods::GET_UNWRAP, + ::clippy_lints::methods::IMPLICIT_CLONE, + ::clippy_lints::methods::INEFFICIENT_TO_STRING, + ::clippy_lints::methods::INSPECT_FOR_EACH, + ::clippy_lints::methods::INTO_ITER_ON_REF, + ::clippy_lints::methods::IO_OTHER_ERROR, + ::clippy_lints::methods::IP_CONSTANT, + ::clippy_lints::methods::IS_DIGIT_ASCII_RADIX, + ::clippy_lints::methods::ITERATOR_STEP_BY_ZERO, + ::clippy_lints::methods::ITER_CLONED_COLLECT, + ::clippy_lints::methods::ITER_COUNT, + ::clippy_lints::methods::ITER_FILTER_IS_OK, + ::clippy_lints::methods::ITER_FILTER_IS_SOME, + ::clippy_lints::methods::ITER_KV_MAP, + ::clippy_lints::methods::ITER_NEXT_SLICE, + ::clippy_lints::methods::ITER_NTH, + ::clippy_lints::methods::ITER_NTH_ZERO, + ::clippy_lints::methods::ITER_ON_EMPTY_COLLECTIONS, + ::clippy_lints::methods::ITER_ON_SINGLE_ITEMS, + ::clippy_lints::methods::ITER_OUT_OF_BOUNDS, + ::clippy_lints::methods::ITER_OVEREAGER_CLONED, + ::clippy_lints::methods::ITER_SKIP_NEXT, + ::clippy_lints::methods::ITER_SKIP_ZERO, + ::clippy_lints::methods::ITER_WITH_DRAIN, + ::clippy_lints::methods::JOIN_ABSOLUTE_PATHS, + ::clippy_lints::methods::LINES_FILTER_MAP_OK, + ::clippy_lints::methods::MANUAL_CLEAR, + ::clippy_lints::methods::MANUAL_CONTAINS, + ::clippy_lints::methods::MANUAL_C_STR_LITERALS, + ::clippy_lints::methods::MANUAL_FILTER_MAP, + ::clippy_lints::methods::MANUAL_FIND_MAP, + ::clippy_lints::methods::MANUAL_INSPECT, + ::clippy_lints::methods::MANUAL_IS_VARIANT_AND, + ::clippy_lints::methods::MANUAL_NEXT_BACK, + ::clippy_lints::methods::MANUAL_OK_OR, + ::clippy_lints::methods::MANUAL_OPTION_ZIP, + ::clippy_lints::methods::MANUAL_REPEAT_N, + ::clippy_lints::methods::MANUAL_SATURATING_ARITHMETIC, + ::clippy_lints::methods::MANUAL_SPLIT_ONCE, + ::clippy_lints::methods::MANUAL_STR_REPEAT, + ::clippy_lints::methods::MANUAL_TRY_FOLD, + ::clippy_lints::methods::MAP_ALL_ANY_IDENTITY, + ::clippy_lints::methods::MAP_CLONE, + ::clippy_lints::methods::MAP_COLLECT_RESULT_UNIT, + ::clippy_lints::methods::MAP_ERR_IGNORE, + ::clippy_lints::methods::MAP_FLATTEN, + ::clippy_lints::methods::MAP_IDENTITY, + ::clippy_lints::methods::MAP_OR_IDENTITY, + ::clippy_lints::methods::MAP_UNWRAP_OR, + ::clippy_lints::methods::MAP_WITH_UNUSED_ARGUMENT_OVER_RANGES, + ::clippy_lints::methods::MUT_MUTEX_LOCK, + ::clippy_lints::methods::NAIVE_BYTECOUNT, + ::clippy_lints::methods::NEEDLESS_AS_BYTES, + ::clippy_lints::methods::NEEDLESS_CHARACTER_ITERATION, + ::clippy_lints::methods::NEEDLESS_COLLECT, + ::clippy_lints::methods::NEEDLESS_OPTION_AS_DEREF, + ::clippy_lints::methods::NEEDLESS_OPTION_TAKE, + ::clippy_lints::methods::NEEDLESS_SPLITN, + ::clippy_lints::methods::NEW_RET_NO_SELF, + ::clippy_lints::methods::NONSENSICAL_OPEN_OPTIONS, + ::clippy_lints::methods::NO_EFFECT_REPLACE, + ::clippy_lints::methods::OBFUSCATED_IF_ELSE, + ::clippy_lints::methods::OK_EXPECT, + ::clippy_lints::methods::OPTION_AS_REF_CLONED, + ::clippy_lints::methods::OPTION_AS_REF_DEREF, + ::clippy_lints::methods::OPTION_FILTER_MAP, + ::clippy_lints::methods::OPTION_MAP_OR_NONE, + ::clippy_lints::methods::OPTION_ZIP_NONE, + ::clippy_lints::methods::OR_FUN_CALL, + ::clippy_lints::methods::OR_THEN_UNWRAP, + ::clippy_lints::methods::PATH_BUF_PUSH_OVERWRITE, + ::clippy_lints::methods::PATH_ENDS_WITH_EXT, + ::clippy_lints::methods::PTR_OFFSET_BY_LITERAL, + ::clippy_lints::methods::PTR_OFFSET_WITH_CAST, + ::clippy_lints::methods::RANGE_ZIP_WITH_LEN, + ::clippy_lints::methods::READONLY_WRITE_LOCK, + ::clippy_lints::methods::READ_LINE_WITHOUT_TRIM, + ::clippy_lints::methods::REDUNDANT_AS_STR, + ::clippy_lints::methods::REDUNDANT_ITER_CLONED, + ::clippy_lints::methods::REPEAT_ONCE, + ::clippy_lints::methods::RESULT_FILTER_MAP, + ::clippy_lints::methods::RESULT_MAP_OR_INTO_OPTION, + ::clippy_lints::methods::RETURN_AND_THEN, + ::clippy_lints::methods::SEARCH_IS_SOME, + ::clippy_lints::methods::SEEK_FROM_CURRENT, + ::clippy_lints::methods::SEEK_TO_START_INSTEAD_OF_REWIND, + ::clippy_lints::methods::SHOULD_IMPLEMENT_TRAIT, + ::clippy_lints::methods::SINGLE_CHAR_ADD_STR, + ::clippy_lints::methods::SKIP_WHILE_NEXT, + ::clippy_lints::methods::SLICED_STRING_AS_BYTES, + ::clippy_lints::methods::SOME_FILTER, + ::clippy_lints::methods::STABLE_SORT_PRIMITIVE, + ::clippy_lints::methods::STRING_EXTEND_CHARS, + ::clippy_lints::methods::STRING_LIT_CHARS_ANY, + ::clippy_lints::methods::STR_SPLIT_AT_NEWLINE, + ::clippy_lints::methods::SUSPICIOUS_COMMAND_ARG_SPACE, + ::clippy_lints::methods::SUSPICIOUS_MAP, + ::clippy_lints::methods::SUSPICIOUS_OPEN_OPTIONS, + ::clippy_lints::methods::SUSPICIOUS_SPLITN, + ::clippy_lints::methods::SUSPICIOUS_TO_OWNED, + ::clippy_lints::methods::SWAP_WITH_TEMPORARY, + ::clippy_lints::methods::TYPE_ID_ON_BOX, + ::clippy_lints::methods::UNBUFFERED_BYTES, + ::clippy_lints::methods::UNINIT_ASSUMED_INIT, + ::clippy_lints::methods::UNIT_HASH, + ::clippy_lints::methods::UNNECESSARY_FALLIBLE_CONVERSIONS, + ::clippy_lints::methods::UNNECESSARY_FILTER_MAP, + ::clippy_lints::methods::UNNECESSARY_FIND_MAP, + ::clippy_lints::methods::UNNECESSARY_FIRST_THEN_CHECK, + ::clippy_lints::methods::UNNECESSARY_FOLD, + ::clippy_lints::methods::UNNECESSARY_GET_THEN_CHECK, + ::clippy_lints::methods::UNNECESSARY_JOIN, + ::clippy_lints::methods::UNNECESSARY_LAZY_EVALUATIONS, + ::clippy_lints::methods::UNNECESSARY_LITERAL_UNWRAP, + ::clippy_lints::methods::UNNECESSARY_MAP_OR, + ::clippy_lints::methods::UNNECESSARY_MIN_OR_MAX, + ::clippy_lints::methods::UNNECESSARY_OPTION_MAP_OR_ELSE, + ::clippy_lints::methods::UNNECESSARY_RESULT_MAP_OR_ELSE, + ::clippy_lints::methods::UNNECESSARY_SORT_BY, + ::clippy_lints::methods::UNNECESSARY_TO_OWNED, + ::clippy_lints::methods::UNNECESSARY_UNWRAP_UNCHECKED, + ::clippy_lints::methods::UNWRAP_OR_DEFAULT, + ::clippy_lints::methods::UNWRAP_USED, + ::clippy_lints::methods::USELESS_ASREF, + ::clippy_lints::methods::USELESS_NONZERO_NEW_UNCHECKED, + ::clippy_lints::methods::VEC_RESIZE_TO_ZERO, + ::clippy_lints::methods::VERBOSE_FILE_READS, + ::clippy_lints::methods::WAKER_CLONE_WAKE, + ::clippy_lints::methods::WRONG_SELF_CONVENTION, + ::clippy_lints::methods::ZST_OFFSET, +]; +static MinIdentChars_LINTS: &[&Lint] = &[ + ::clippy_lints::min_ident_chars::MIN_IDENT_CHARS, +]; +static MinMaxPass_LINTS: &[&Lint] = &[ + ::clippy_lints::minmax::MIN_MAX, +]; +static LintPass_LINTS: &[&Lint] = &[ + ::clippy_lints::misc::SHORT_CIRCUIT_STATEMENT, + ::clippy_lints::misc::USED_UNDERSCORE_BINDING, + ::clippy_lints::misc::USED_UNDERSCORE_ITEMS, +]; +static TypeParamMismatch_LINTS: &[&Lint] = &[ + ::clippy_lints::mismatching_type_param_order::MISMATCHING_TYPE_PARAM_ORDER, +]; +static MissingAssertMessage_LINTS: &[&Lint] = &[ + ::clippy_lints::missing_assert_message::MISSING_ASSERT_MESSAGE, +]; +static MissingAssertsForIndexing_LINTS: &[&Lint] = &[ + ::clippy_lints::missing_asserts_for_indexing::MISSING_ASSERTS_FOR_INDEXING, +]; +static MissingConstForFn_LINTS: &[&Lint] = &[ + ::clippy_lints::missing_const_for_fn::MISSING_CONST_FOR_FN, +]; +static MissingConstForThreadLocal_LINTS: &[&Lint] = &[ + ::clippy_lints::missing_const_for_thread_local::MISSING_CONST_FOR_THREAD_LOCAL, +]; +static MissingDoc_LINTS: &[&Lint] = &[ + ::clippy_lints::missing_doc::MISSING_DOCS_IN_PRIVATE_ITEMS, +]; +static ImportRename_LINTS: &[&Lint] = &[ + ::clippy_lints::missing_enforced_import_rename::MISSING_ENFORCED_IMPORT_RENAMES, +]; +static MissingFieldsInDebug_LINTS: &[&Lint] = &[ + ::clippy_lints::missing_fields_in_debug::MISSING_FIELDS_IN_DEBUG, +]; +static MissingInline_LINTS: &[&Lint] = &[ + ::clippy_lints::missing_inline::MISSING_INLINE_IN_PUBLIC_ITEMS, +]; +static MissingTraitMethods_LINTS: &[&Lint] = &[ + ::clippy_lints::missing_trait_methods::MISSING_TRAIT_METHODS, +]; +static EvalOrderDependence_LINTS: &[&Lint] = &[ + ::clippy_lints::mixed_read_write_in_expression::DIVERGING_SUB_EXPRESSION, + ::clippy_lints::mixed_read_write_in_expression::MIXED_READ_WRITE_IN_EXPRESSION, +]; +static MultipleUnsafeOpsPerBlock_LINTS: &[&Lint] = &[ + ::clippy_lints::multiple_unsafe_ops_per_block::MULTIPLE_UNSAFE_OPS_PER_BLOCK, +]; +static MutableKeyType_LINTS: &[&Lint] = &[ + ::clippy_lints::mut_key::MUTABLE_KEY_TYPE, +]; +static MutMut_LINTS: &[&Lint] = &[ + ::clippy_lints::mut_mut::MUT_MUT, +]; +static DebugAssertWithMutCall_LINTS: &[&Lint] = &[ + ::clippy_lints::mutable_debug_assertion::DEBUG_ASSERT_WITH_MUT_CALL, +]; +static Mutex_LINTS: &[&Lint] = &[ + ::clippy_lints::mutex_atomic::MUTEX_ATOMIC, + ::clippy_lints::mutex_atomic::MUTEX_INTEGER, +]; +static NeedlessBool_LINTS: &[&Lint] = &[ + ::clippy_lints::needless_bool::NEEDLESS_BOOL, + ::clippy_lints::needless_bool::NEEDLESS_BOOL_ASSIGN, +]; +static NeedlessBorrowedRef_LINTS: &[&Lint] = &[ + ::clippy_lints::needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE, +]; +static NeedlessBorrowsForGenericArgs_LINTS: &[&Lint] = &[ + ::clippy_lints::needless_borrows_for_generic_args::NEEDLESS_BORROWS_FOR_GENERIC_ARGS, +]; +static NeedlessContinue_LINTS: &[&Lint] = &[ + ::clippy_lints::needless_continue::NEEDLESS_CONTINUE, +]; +static NeedlessForEach_LINTS: &[&Lint] = &[ + ::clippy_lints::needless_for_each::NEEDLESS_FOR_EACH, +]; +static NeedlessIfs_LINTS: &[&Lint] = &[ + ::clippy_lints::needless_ifs::NEEDLESS_IFS, +]; +static NeedlessLateInit_LINTS: &[&Lint] = &[ + ::clippy_lints::needless_late_init::NEEDLESS_LATE_INIT, +]; +static NeedlessMaybeSized_LINTS: &[&Lint] = &[ + ::clippy_lints::needless_maybe_sized::NEEDLESS_MAYBE_SIZED, +]; +static NeedlessNonzeroGet_LINTS: &[&Lint] = &[ + ::clippy_lints::needless_nonzero_get::NEEDLESS_NONZERO_GET, +]; +static NeedlessParensOnRangeLiterals_LINTS: &[&Lint] = &[ + ::clippy_lints::needless_parens_on_range_literals::NEEDLESS_PARENS_ON_RANGE_LITERALS, +]; +static NeedlessPassByRefMut_LINTS: &[&Lint] = &[ + ::clippy_lints::needless_pass_by_ref_mut::NEEDLESS_PASS_BY_REF_MUT, +]; +static NeedlessPassByValue_LINTS: &[&Lint] = &[ + ::clippy_lints::needless_pass_by_value::NEEDLESS_PASS_BY_VALUE, +]; +static NeedlessQuestionMark_LINTS: &[&Lint] = &[ + ::clippy_lints::needless_question_mark::NEEDLESS_QUESTION_MARK, +]; +static NeedlessUpdate_LINTS: &[&Lint] = &[ + ::clippy_lints::needless_update::NEEDLESS_UPDATE, +]; +static NoNegCompOpForPartialOrd_LINTS: &[&Lint] = &[ + ::clippy_lints::neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD, +]; +static NegMultiply_LINTS: &[&Lint] = &[ + ::clippy_lints::neg_multiply::NEG_MULTIPLY, +]; +static NewWithoutDefault_LINTS: &[&Lint] = &[ + ::clippy_lints::new_without_default::NEW_WITHOUT_DEFAULT, +]; +static NoEffect_LINTS: &[&Lint] = &[ + ::clippy_lints::no_effect::NO_EFFECT, + ::clippy_lints::no_effect::NO_EFFECT_UNDERSCORE_BINDING, + ::clippy_lints::no_effect::UNNECESSARY_OPERATION, +]; +static NoMangleWithRustAbi_LINTS: &[&Lint] = &[ + ::clippy_lints::no_mangle_with_rust_abi::NO_MANGLE_WITH_RUST_ABI, +]; +static NonCanonicalImpls_LINTS: &[&Lint] = &[ + ::clippy_lints::non_canonical_impls::NON_CANONICAL_CLONE_IMPL, + ::clippy_lints::non_canonical_impls::NON_CANONICAL_PARTIAL_ORD_IMPL, +]; +static NonCopyConst_LINTS: &[&Lint] = &[ + ::clippy_lints::non_copy_const::BORROW_INTERIOR_MUTABLE_CONST, + ::clippy_lints::non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST, +]; +static NonOctalUnixPermissions_LINTS: &[&Lint] = &[ + ::clippy_lints::non_octal_unix_permissions::NON_OCTAL_UNIX_PERMISSIONS, +]; +static NonSendFieldInSendTy_LINTS: &[&Lint] = &[ + ::clippy_lints::non_send_fields_in_send_ty::NON_SEND_FIELDS_IN_SEND_TY, +]; +static NonStdLazyStatic_LINTS: &[&Lint] = &[ + ::clippy_lints::non_std_lazy_statics::NON_STD_LAZY_STATICS, +]; +static NonZeroSuggestions_LINTS: &[&Lint] = &[ + ::clippy_lints::non_zero_suggestions::NON_ZERO_SUGGESTIONS, +]; +static NonnullUncheckedOnBoxPtr_LINTS: &[&Lint] = &[ + ::clippy_lints::nonnull_unchecked_on_box_ptr::NONNULL_UNCHECKED_ON_BOX_PTR, +]; +static OnlyUsedInRecursion_LINTS: &[&Lint] = &[ + ::clippy_lints::only_used_in_recursion::ONLY_USED_IN_RECURSION, + ::clippy_lints::only_used_in_recursion::SELF_ONLY_USED_IN_RECURSION, +]; +static Operators_LINTS: &[&Lint] = &[ + ::clippy_lints::operators::ABSURD_EXTREME_COMPARISONS, + ::clippy_lints::operators::ARITHMETIC_SIDE_EFFECTS, + ::clippy_lints::operators::ASSIGN_OP_PATTERN, + ::clippy_lints::operators::BAD_BIT_MASK, + ::clippy_lints::operators::CMP_OWNED, + ::clippy_lints::operators::DECIMAL_BITWISE_OPERANDS, + ::clippy_lints::operators::DOUBLE_COMPARISONS, + ::clippy_lints::operators::DURATION_SUBSEC, + ::clippy_lints::operators::EQ_OP, + ::clippy_lints::operators::ERASING_OP, + ::clippy_lints::operators::FLOAT_ARITHMETIC, + ::clippy_lints::operators::FLOAT_CMP, + ::clippy_lints::operators::FLOAT_CMP_CONST, + ::clippy_lints::operators::FLOAT_EQUALITY_WITHOUT_ABS, + ::clippy_lints::operators::IDENTITY_OP, + ::clippy_lints::operators::IMPOSSIBLE_COMPARISONS, + ::clippy_lints::operators::INEFFECTIVE_BIT_MASK, + ::clippy_lints::operators::INTEGER_DIVISION, + ::clippy_lints::operators::INTEGER_DIVISION_REMAINDER_USED, + ::clippy_lints::operators::INVALID_UPCAST_COMPARISONS, + ::clippy_lints::operators::MANUAL_DIV_CEIL, + ::clippy_lints::operators::MANUAL_ISOLATE_LOWEST_ONE, + ::clippy_lints::operators::MANUAL_IS_MULTIPLE_OF, + ::clippy_lints::operators::MANUAL_MIDPOINT, + ::clippy_lints::operators::MISREFACTORED_ASSIGN_OP, + ::clippy_lints::operators::MODULO_ARITHMETIC, + ::clippy_lints::operators::MODULO_ONE, + ::clippy_lints::operators::NEEDLESS_BITWISE_BOOL, + ::clippy_lints::operators::OP_REF, + ::clippy_lints::operators::REDUNDANT_COMPARISONS, + ::clippy_lints::operators::SELF_ASSIGNMENT, + ::clippy_lints::operators::VERBOSE_BIT_MASK, +]; +static ArithmeticSideEffects_LINTS: &[&Lint] = &[ + ::clippy_lints::operators::ARITHMETIC_SIDE_EFFECTS, +]; +static OptionIfLetElse_LINTS: &[&Lint] = &[ + ::clippy_lints::option_if_let_else::OPTION_IF_LET_ELSE, +]; +static PanicInResultFn_LINTS: &[&Lint] = &[ + ::clippy_lints::panic_in_result_fn::PANIC_IN_RESULT_FN, +]; +static PanicUnimplemented_LINTS: &[&Lint] = &[ + ::clippy_lints::panic_unimplemented::PANIC, + ::clippy_lints::panic_unimplemented::TODO, + ::clippy_lints::panic_unimplemented::UNIMPLEMENTED, + ::clippy_lints::panic_unimplemented::UNREACHABLE, +]; +static PanickingOverflowChecks_LINTS: &[&Lint] = &[ + ::clippy_lints::panicking_overflow_checks::PANICKING_OVERFLOW_CHECKS, +]; +static PartialEqNeImpl_LINTS: &[&Lint] = &[ + ::clippy_lints::partialeq_ne_impl::PARTIALEQ_NE_IMPL, +]; +static PartialeqToNone_LINTS: &[&Lint] = &[ + ::clippy_lints::partialeq_to_none::PARTIALEQ_TO_NONE, +]; +static PassByRefOrValue_LINTS: &[&Lint] = &[ + ::clippy_lints::pass_by_ref_or_value::LARGE_TYPES_PASSED_BY_VALUE, + ::clippy_lints::pass_by_ref_or_value::TRIVIALLY_COPY_PASS_BY_REF, +]; +static PathbufThenPush_LINTS: &[&Lint] = &[ + ::clippy_lints::pathbuf_init_then_push::PATHBUF_INIT_THEN_PUSH, +]; +static PatternTypeMismatch_LINTS: &[&Lint] = &[ + ::clippy_lints::pattern_type_mismatch::PATTERN_TYPE_MISMATCH, +]; +static PermissionsSetReadonlyFalse_LINTS: &[&Lint] = &[ + ::clippy_lints::permissions_set_readonly_false::PERMISSIONS_SET_READONLY_FALSE, +]; +static PointersInNomemAsmBlock_LINTS: &[&Lint] = &[ + ::clippy_lints::pointers_in_nomem_asm_block::POINTERS_IN_NOMEM_ASM_BLOCK, +]; +static Ptr_LINTS: &[&Lint] = &[ + ::clippy_lints::ptr::CMP_NULL, + ::clippy_lints::ptr::MUT_FROM_REF, + ::clippy_lints::ptr::PTR_ARG, + ::clippy_lints::ptr::PTR_EQ, +]; +static PubUnderscoreFields_LINTS: &[&Lint] = &[ + ::clippy_lints::pub_underscore_fields::PUB_UNDERSCORE_FIELDS, +]; +static QuestionMark_LINTS: &[&Lint] = &[ + ::clippy_lints::manual_let_else::MANUAL_LET_ELSE, + ::clippy_lints::question_mark::QUESTION_MARK, +]; +static QuestionMarkUsed_LINTS: &[&Lint] = &[ + ::clippy_lints::question_mark_used::QUESTION_MARK_USED, +]; +static Ranges_LINTS: &[&Lint] = &[ + ::clippy_lints::ranges::MANUAL_RANGE_CONTAINS, + ::clippy_lints::ranges::RANGE_MINUS_ONE, + ::clippy_lints::ranges::RANGE_PLUS_ONE, + ::clippy_lints::ranges::REVERSED_EMPTY_RANGES, +]; +static RcCloneInVecInit_LINTS: &[&Lint] = &[ + ::clippy_lints::rc_clone_in_vec_init::RC_CLONE_IN_VEC_INIT, +]; +static ReadZeroByteVec_LINTS: &[&Lint] = &[ + ::clippy_lints::read_zero_byte_vec::READ_ZERO_BYTE_VEC, +]; +static RedundantAsyncBlock_LINTS: &[&Lint] = &[ + ::clippy_lints::redundant_async_block::REDUNDANT_ASYNC_BLOCK, +]; +static RedundantClone_LINTS: &[&Lint] = &[ + ::clippy_lints::redundant_clone::REDUNDANT_CLONE, +]; +static RedundantClosureCall_LINTS: &[&Lint] = &[ + ::clippy_lints::redundant_closure_call::REDUNDANT_CLOSURE_CALL, +]; +static RedundantElse_LINTS: &[&Lint] = &[ + ::clippy_lints::redundant_else::REDUNDANT_ELSE, +]; +static RedundantLocals_LINTS: &[&Lint] = &[ + ::clippy_lints::redundant_locals::REDUNDANT_LOCALS, +]; +static RedundantPubCrate_LINTS: &[&Lint] = &[ + ::clippy_lints::redundant_pub_crate::REDUNDANT_PUB_CRATE, +]; +static RedundantSlicing_LINTS: &[&Lint] = &[ + ::clippy_lints::redundant_slicing::DEREF_BY_SLICING, + ::clippy_lints::redundant_slicing::REDUNDANT_SLICING, +]; +static RedundantTestPrefix_LINTS: &[&Lint] = &[ + ::clippy_lints::redundant_test_prefix::REDUNDANT_TEST_PREFIX, +]; +static RedundantTypeAnnotations_LINTS: &[&Lint] = &[ + ::clippy_lints::redundant_type_annotations::REDUNDANT_TYPE_ANNOTATIONS, +]; +static RefOptionRef_LINTS: &[&Lint] = &[ + ::clippy_lints::ref_option_ref::REF_OPTION_REF, +]; +static RefPatterns_LINTS: &[&Lint] = &[ + ::clippy_lints::ref_patterns::REF_PATTERNS, +]; +static DerefAddrOf_LINTS: &[&Lint] = &[ + ::clippy_lints::reference::DEREF_ADDROF, +]; +static Regex_LINTS: &[&Lint] = &[ + ::clippy_lints::regex::INVALID_REGEX, + ::clippy_lints::regex::REGEX_CREATION_IN_LOOPS, + ::clippy_lints::regex::TRIVIAL_REGEX, +]; +static RepeatVecWithCapacity_LINTS: &[&Lint] = &[ + ::clippy_lints::repeat_vec_with_capacity::REPEAT_VEC_WITH_CAPACITY, +]; +static ReplaceBox_LINTS: &[&Lint] = &[ + ::clippy_lints::replace_box::REPLACE_BOX, +]; +static ReserveAfterInitialization_LINTS: &[&Lint] = &[ + ::clippy_lints::reserve_after_initialization::RESERVE_AFTER_INITIALIZATION, +]; +static RestWhenDestructuringStruct_LINTS: &[&Lint] = &[ + ::clippy_lints::rest_when_destructuring_struct::REST_PATTERN_ACCESSIBLE_FIELD, + ::clippy_lints::rest_when_destructuring_struct::UNNECESSARY_REST_PATTERN, +]; +static ReturnSelfNotMustUse_LINTS: &[&Lint] = &[ + ::clippy_lints::return_self_not_must_use::RETURN_SELF_NOT_MUST_USE, +]; +static Return_LINTS: &[&Lint] = &[ + ::clippy_lints::returns::LET_AND_RETURN, + ::clippy_lints::returns::NEEDLESS_RETURN, + ::clippy_lints::returns::NEEDLESS_RETURN_WITH_QUESTION_MARK, +]; +static SameLengthAndCapacity_LINTS: &[&Lint] = &[ + ::clippy_lints::same_length_and_capacity::SAME_LENGTH_AND_CAPACITY, +]; +static SameNameMethod_LINTS: &[&Lint] = &[ + ::clippy_lints::same_name_method::SAME_NAME_METHOD, +]; +static SelfNamedConstructors_LINTS: &[&Lint] = &[ + ::clippy_lints::self_named_constructors::SELF_NAMED_CONSTRUCTORS, +]; +static SemicolonBlock_LINTS: &[&Lint] = &[ + ::clippy_lints::semicolon_block::SEMICOLON_INSIDE_BLOCK, + ::clippy_lints::semicolon_block::SEMICOLON_OUTSIDE_BLOCK, +]; +static SemicolonIfNothingReturned_LINTS: &[&Lint] = &[ + ::clippy_lints::semicolon_if_nothing_returned::SEMICOLON_IF_NOTHING_RETURNED, +]; +static SerdeApi_LINTS: &[&Lint] = &[ + ::clippy_lints::serde_api::SERDE_API_MISUSE, +]; +static SetContainsOrInsert_LINTS: &[&Lint] = &[ + ::clippy_lints::set_contains_or_insert::SET_CONTAINS_OR_INSERT, +]; +static Shadow_LINTS: &[&Lint] = &[ + ::clippy_lints::shadow::SHADOW_REUSE, + ::clippy_lints::shadow::SHADOW_SAME, + ::clippy_lints::shadow::SHADOW_UNRELATED, +]; +static SignificantDropTightening_LINTS: &[&Lint] = &[ + ::clippy_lints::significant_drop_tightening::SIGNIFICANT_DROP_TIGHTENING, +]; +static SingleCallFn_LINTS: &[&Lint] = &[ + ::clippy_lints::single_call_fn::SINGLE_CALL_FN, +]; +static SingleOptionMap_LINTS: &[&Lint] = &[ + ::clippy_lints::single_option_map::SINGLE_OPTION_MAP, +]; +static SingleRangeInVecInit_LINTS: &[&Lint] = &[ + ::clippy_lints::single_range_in_vec_init::SINGLE_RANGE_IN_VEC_INIT, +]; +static SizeOfInElementCount_LINTS: &[&Lint] = &[ + ::clippy_lints::size_of_in_element_count::SIZE_OF_IN_ELEMENT_COUNT, +]; +static SizeOfRef_LINTS: &[&Lint] = &[ + ::clippy_lints::size_of_ref::SIZE_OF_REF, +]; +static SlowVectorInit_LINTS: &[&Lint] = &[ + ::clippy_lints::slow_vector_initialization::SLOW_VECTOR_INITIALIZATION, +]; +static StdReexports_LINTS: &[&Lint] = &[ + ::clippy_lints::std_instead_of_core::ALLOC_INSTEAD_OF_CORE, + ::clippy_lints::std_instead_of_core::STD_INSTEAD_OF_ALLOC, + ::clippy_lints::std_instead_of_core::STD_INSTEAD_OF_CORE, +]; +static StringPatterns_LINTS: &[&Lint] = &[ + ::clippy_lints::string_patterns::MANUAL_PATTERN_CHAR_COMPARISON, + ::clippy_lints::string_patterns::SINGLE_CHAR_PATTERN, +]; +static StrToString_LINTS: &[&Lint] = &[ + ::clippy_lints::strings::STR_TO_STRING, +]; +static StringAdd_LINTS: &[&Lint] = &[ + ::clippy_lints::strings::STRING_ADD, + ::clippy_lints::strings::STRING_ADD_ASSIGN, + ::clippy_lints::strings::STRING_SLICE, +]; +static StringLitAsBytes_LINTS: &[&Lint] = &[ + ::clippy_lints::strings::STRING_FROM_UTF8_AS_BYTES, + ::clippy_lints::strings::STRING_LIT_AS_BYTES, +]; +static TrimSplitWhitespace_LINTS: &[&Lint] = &[ + ::clippy_lints::strings::TRIM_SPLIT_WHITESPACE, +]; +static StrlenOnCStrings_LINTS: &[&Lint] = &[ + ::clippy_lints::strlen_on_c_strings::STRLEN_ON_C_STRINGS, +]; +static SuspiciousImpl_LINTS: &[&Lint] = &[ + ::clippy_lints::suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL, + ::clippy_lints::suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL, +]; +static ConfusingXorAndPow_LINTS: &[&Lint] = &[ + ::clippy_lints::suspicious_xor_used_as_pow::SUSPICIOUS_XOR_USED_AS_POW, +]; +static Swap_LINTS: &[&Lint] = &[ + ::clippy_lints::swap::ALMOST_SWAPPED, + ::clippy_lints::swap::MANUAL_SWAP, +]; +static SwapPtrToRef_LINTS: &[&Lint] = &[ + ::clippy_lints::swap_ptr_to_ref::SWAP_PTR_TO_REF, +]; +static TemporaryAssignment_LINTS: &[&Lint] = &[ + ::clippy_lints::temporary_assignment::TEMPORARY_ASSIGNMENT, +]; +static TestsOutsideTestModule_LINTS: &[&Lint] = &[ + ::clippy_lints::tests_outside_test_module::TESTS_OUTSIDE_TEST_MODULE, +]; +static UncheckedTimeSubtraction_LINTS: &[&Lint] = &[ + ::clippy_lints::time_subtraction::MANUAL_INSTANT_ELAPSED, + ::clippy_lints::time_subtraction::UNCHECKED_TIME_SUBTRACTION, +]; +static ToDigitIsSome_LINTS: &[&Lint] = &[ + ::clippy_lints::to_digit_is_some::TO_DIGIT_IS_SOME, +]; +static ToStringTraitImpl_LINTS: &[&Lint] = &[ + ::clippy_lints::to_string_trait_impl::TO_STRING_TRAIT_IMPL, +]; +static ToplevelRefArg_LINTS: &[&Lint] = &[ + ::clippy_lints::toplevel_ref_arg::TOPLEVEL_REF_ARG, +]; +static TrailingEmptyArray_LINTS: &[&Lint] = &[ + ::clippy_lints::trailing_empty_array::TRAILING_EMPTY_ARRAY, +]; +static TraitBounds_LINTS: &[&Lint] = &[ + ::clippy_lints::trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS, + ::clippy_lints::trait_bounds::TYPE_REPETITION_IN_BOUNDS, +]; +static Transmute_LINTS: &[&Lint] = &[ + ::clippy_lints::transmute::CROSSPOINTER_TRANSMUTE, + ::clippy_lints::transmute::EAGER_TRANSMUTE, + ::clippy_lints::transmute::MISSING_TRANSMUTE_ANNOTATIONS, + ::clippy_lints::transmute::TRANSMUTES_EXPRESSIBLE_AS_PTR_CASTS, + ::clippy_lints::transmute::TRANSMUTE_BYTES_TO_STR, + ::clippy_lints::transmute::TRANSMUTE_INT_TO_BOOL, + ::clippy_lints::transmute::TRANSMUTE_INT_TO_NON_ZERO, + ::clippy_lints::transmute::TRANSMUTE_NULL_TO_FN, + ::clippy_lints::transmute::TRANSMUTE_PTR_TO_PTR, + ::clippy_lints::transmute::TRANSMUTE_PTR_TO_REF, + ::clippy_lints::transmute::TRANSMUTE_UNDEFINED_REPR, + ::clippy_lints::transmute::TRANSMUTING_NULL, + ::clippy_lints::transmute::UNSOUND_COLLECTION_TRANSMUTE, + ::clippy_lints::transmute::USELESS_TRANSMUTE, + ::clippy_lints::transmute::WRONG_TRANSMUTE, +]; +static TupleArrayConversions_LINTS: &[&Lint] = &[ + ::clippy_lints::tuple_array_conversions::TUPLE_ARRAY_CONVERSIONS, +]; +static Types_LINTS: &[&Lint] = &[ + ::clippy_lints::types::BORROWED_BOX, + ::clippy_lints::types::BOX_COLLECTION, + ::clippy_lints::types::LINKEDLIST, + ::clippy_lints::types::OPTION_OPTION, + ::clippy_lints::types::OWNED_COW, + ::clippy_lints::types::RC_BUFFER, + ::clippy_lints::types::RC_MUTEX, + ::clippy_lints::types::REDUNDANT_ALLOCATION, + ::clippy_lints::types::TYPE_COMPLEXITY, + ::clippy_lints::types::VEC_BOX, +]; +static UnconditionalRecursion_LINTS: &[&Lint] = &[ + ::clippy_lints::unconditional_recursion::UNCONDITIONAL_RECURSION, +]; +static UndocumentedUnsafeBlocks_LINTS: &[&Lint] = &[ + ::clippy_lints::undocumented_unsafe_blocks::UNDOCUMENTED_UNSAFE_BLOCKS, + ::clippy_lints::undocumented_unsafe_blocks::UNNECESSARY_SAFETY_COMMENT, +]; +static Unicode_LINTS: &[&Lint] = &[ + ::clippy_lints::unicode::INVISIBLE_CHARACTERS, + ::clippy_lints::unicode::NON_ASCII_LITERAL, + ::clippy_lints::unicode::UNICODE_NOT_NFC, +]; +static UninhabitedReferences_LINTS: &[&Lint] = &[ + ::clippy_lints::uninhabited_references::UNINHABITED_REFERENCES, +]; +static UninitVec_LINTS: &[&Lint] = &[ + ::clippy_lints::uninit_vec::UNINIT_VEC, +]; +static UnitReturnExpectingOrd_LINTS: &[&Lint] = &[ + ::clippy_lints::unit_return_expecting_ord::UNIT_RETURN_EXPECTING_ORD, +]; +static UnitTypes_LINTS: &[&Lint] = &[ + ::clippy_lints::unit_types::LET_UNIT_VALUE, + ::clippy_lints::unit_types::UNIT_ARG, + ::clippy_lints::unit_types::UNIT_CMP, +]; +static UnnecessaryBoxReturns_LINTS: &[&Lint] = &[ + ::clippy_lints::unnecessary_box_returns::UNNECESSARY_BOX_RETURNS, +]; +static UnnecessaryLiteralBound_LINTS: &[&Lint] = &[ + ::clippy_lints::unnecessary_literal_bound::UNNECESSARY_LITERAL_BOUND, +]; +static UnnecessaryMapOnConstructor_LINTS: &[&Lint] = &[ + ::clippy_lints::unnecessary_map_on_constructor::UNNECESSARY_MAP_ON_CONSTRUCTOR, +]; +static UnnecessaryMutPassed_LINTS: &[&Lint] = &[ + ::clippy_lints::unnecessary_mut_passed::UNNECESSARY_MUT_PASSED, +]; +static UnnecessaryOwnedEmptyStrings_LINTS: &[&Lint] = &[ + ::clippy_lints::unnecessary_owned_empty_strings::UNNECESSARY_OWNED_EMPTY_STRINGS, +]; +static UnnecessarySemicolon_LINTS: &[&Lint] = &[ + ::clippy_lints::unnecessary_semicolon::UNNECESSARY_SEMICOLON, +]; +static UnnecessaryStruct_LINTS: &[&Lint] = &[ + ::clippy_lints::unnecessary_struct_initialization::UNNECESSARY_STRUCT_INITIALIZATION, +]; +static UnnecessaryWraps_LINTS: &[&Lint] = &[ + ::clippy_lints::unnecessary_wraps::UNNECESSARY_WRAPS, +]; +static UnneededStructPattern_LINTS: &[&Lint] = &[ + ::clippy_lints::unneeded_struct_pattern::UNNEEDED_STRUCT_PATTERN, +]; +static UnusedAsync_LINTS: &[&Lint] = &[ + ::clippy_lints::unused_async::UNUSED_ASYNC, + ::clippy_lints::unused_async::UNUSED_ASYNC_TRAIT_IMPL, +]; +static UnusedIoAmount_LINTS: &[&Lint] = &[ + ::clippy_lints::unused_io_amount::UNUSED_IO_AMOUNT, +]; +static UnusedPeekable_LINTS: &[&Lint] = &[ + ::clippy_lints::unused_peekable::UNUSED_PEEKABLE, +]; +static UnusedResultOk_LINTS: &[&Lint] = &[ + ::clippy_lints::unused_result_ok::UNUSED_RESULT_OK, +]; +static UnusedSelf_LINTS: &[&Lint] = &[ + ::clippy_lints::unused_self::UNUSED_SELF, +]; +static UnusedTraitNames_LINTS: &[&Lint] = &[ + ::clippy_lints::unused_trait_names::UNUSED_TRAIT_NAMES, +]; +static UnusedUnit_LINTS: &[&Lint] = &[ + ::clippy_lints::unused_unit::UNUSED_UNIT, +]; +static Unwrap_LINTS: &[&Lint] = &[ + ::clippy_lints::unwrap::PANICKING_UNWRAP, + ::clippy_lints::unwrap::UNNECESSARY_UNWRAP, +]; +static UnwrapInResult_LINTS: &[&Lint] = &[ + ::clippy_lints::unwrap_in_result::UNWRAP_IN_RESULT, +]; +static UpperCaseAcronyms_LINTS: &[&Lint] = &[ + ::clippy_lints::upper_case_acronyms::UPPER_CASE_ACRONYMS, +]; +static UseSelf_LINTS: &[&Lint] = &[ + ::clippy_lints::use_self::USE_SELF, +]; +static UselessConcat_LINTS: &[&Lint] = &[ + ::clippy_lints::useless_concat::USELESS_CONCAT, +]; +static UselessConversion_LINTS: &[&Lint] = &[ + ::clippy_lints::useless_conversion::USELESS_CONVERSION, +]; +static UselessVec_LINTS: &[&Lint] = &[ + ::clippy_lints::useless_vec::USELESS_VEC, +]; +static Author_LINTS: &[&Lint] = &[ +]; +static DumpHir_LINTS: &[&Lint] = &[ +]; +static VecInitThenPush_LINTS: &[&Lint] = &[ + ::clippy_lints::vec_init_then_push::VEC_INIT_THEN_PUSH, +]; +static VolatileComposites_LINTS: &[&Lint] = &[ + ::clippy_lints::volatile_composites::VOLATILE_COMPOSITES, +]; +static WildcardImports_LINTS: &[&Lint] = &[ + ::clippy_lints::wildcard_imports::ENUM_GLOB_USE, + ::clippy_lints::wildcard_imports::WILDCARD_IMPORTS, +]; +static WithCapacityZero_LINTS: &[&Lint] = &[ + ::clippy_lints::with_capacity_zero::WITH_CAPACITY_ZERO, +]; +static Write_LINTS: &[&Lint] = &[ + ::clippy_lints::write::PRINTLN_EMPTY_STRING, + ::clippy_lints::write::PRINT_LITERAL, + ::clippy_lints::write::PRINT_STDERR, + ::clippy_lints::write::PRINT_STDOUT, + ::clippy_lints::write::PRINT_WITH_NEWLINE, + ::clippy_lints::write::USE_DEBUG, + ::clippy_lints::write::WRITELN_EMPTY_STRING, + ::clippy_lints::write::WRITE_LITERAL, + ::clippy_lints::write::WRITE_WITH_NEWLINE, +]; +static ZeroDiv_LINTS: &[&Lint] = &[ + ::clippy_lints::zero_div_zero::ZERO_DIVIDED_BY_ZERO, +]; +static ZeroRepeatSideEffects_LINTS: &[&Lint] = &[ + ::clippy_lints::zero_repeat_side_effects::ZERO_REPEAT_SIDE_EFFECTS, +]; +static ZeroSizedMapValues_LINTS: &[&Lint] = &[ + ::clippy_lints::zero_sized_map_values::ZERO_SIZED_MAP_VALUES, +]; +static ZombieProcesses_LINTS: &[&Lint] = &[ + ::clippy_lints::zombie_processes::ZOMBIE_PROCESSES, +]; + +pub struct CombinedClippyEarlyPass { + AlmostCompleteRange: ::clippy_lints::almost_complete_range::AlmostCompleteRange, + InlineAsmX86AttSyntax: ::clippy_lints::asm_syntax::InlineAsmX86AttSyntax, + InlineAsmX86IntelSyntax: ::clippy_lints::asm_syntax::InlineAsmX86IntelSyntax, + PostExpansionEarlyAttributes: ::clippy_lints::attrs::PostExpansionEarlyAttributes, + CfgNotTest: ::clippy_lints::cfg_not_test::CfgNotTest, + CrateInMacroDef: ::clippy_lints::crate_in_macro_def::CrateInMacroDef, + DefinitionInModuleRoot: ::clippy_lints::definition_in_module_root::DefinitionInModuleRoot, + DisallowedScriptIdents: ::clippy_lints::disallowed_script_idents::DisallowedScriptIdents, + Documentation: ::clippy_lints::doc::Documentation, + DoubleParens: ::clippy_lints::double_parens::DoubleParens, + DuplicateMod: ::clippy_lints::duplicate_mod::DuplicateMod, + ElseIfWithoutElse: ::clippy_lints::else_if_without_else::ElseIfWithoutElse, + EmptyLineAfter: ::clippy_lints::empty_line_after::EmptyLineAfter, + ExcessiveNesting: ::clippy_lints::excessive_nesting::ExcessiveNesting, + FieldScopedVisibilityModifiers: ::clippy_lints::field_scoped_visibility_modifiers::FieldScopedVisibilityModifiers, + Formatting: ::clippy_lints::formatting::Formatting, + EarlyFunctions: ::clippy_lints::functions::EarlyFunctions, + InlineTraitBounds: ::clippy_lints::inline_trait_bounds::InlineTraitBounds, + IntPlusOne: ::clippy_lints::int_plus_one::IntPlusOne, + LargeIncludeFile: ::clippy_lints::large_include_file::LargeIncludeFile, + UnderscoreTyped: ::clippy_lints::let_with_type_underscore::UnderscoreTyped, + DecimalLiteralRepresentation: ::clippy_lints::literal_representation::DecimalLiteralRepresentation, + LiteralDigitGrouping: ::clippy_lints::literal_representation::LiteralDigitGrouping, + MiscEarlyLints: ::clippy_lints::misc_early::MiscEarlyLints, + ModStyle: ::clippy_lints::module_style::ModStyle, + MultiAssignments: ::clippy_lints::multi_assignments::MultiAssignments, + MultipleBoundLocations: ::clippy_lints::multiple_bound_locations::MultipleBoundLocations, + NeedlessArbitrarySelfType: ::clippy_lints::needless_arbitrary_self_type::NeedlessArbitrarySelfType, + NeedlessElse: ::clippy_lints::needless_else::NeedlessElse, + NonExpressiveNames: ::clippy_lints::non_expressive_names::NonExpressiveNames, + OctalEscapes: ::clippy_lints::octal_escapes::OctalEscapes, + OptionEnvUnwrap: ::clippy_lints::option_env_unwrap::OptionEnvUnwrap, + PartialPubFields: ::clippy_lints::partial_pub_fields::PartialPubFields, + Precedence: ::clippy_lints::precedence::Precedence, + PubUse: ::clippy_lints::pub_use::PubUse, + RawStrings: ::clippy_lints::raw_strings::RawStrings, + RedundantFieldNames: ::clippy_lints::redundant_field_names::RedundantFieldNames, + RedundantStaticLifetimes: ::clippy_lints::redundant_static_lifetimes::RedundantStaticLifetimes, + SingleCharLifetimeNames: ::clippy_lints::single_char_lifetime_names::SingleCharLifetimeNames, + SingleComponentPathImports: ::clippy_lints::single_component_path_imports::SingleComponentPathImports, + SuspiciousOperationGroupings: ::clippy_lints::suspicious_operation_groupings::SuspiciousOperationGroupings, + TabsInDocComments: ::clippy_lints::tabs_in_doc_comments::TabsInDocComments, + UnnecessarySelfImports: ::clippy_lints::unnecessary_self_imports::UnnecessarySelfImports, + UnnestedOrPatterns: ::clippy_lints::unnested_or_patterns::UnnestedOrPatterns, + UnsafeNameRemoval: ::clippy_lints::unsafe_removed_from_name::UnsafeNameRemoval, + UnusedRounding: ::clippy_lints::unused_rounding::UnusedRounding, + UnusedUnit: ::clippy_lints::unused_unit::UnusedUnit, + AttrCollector: ::clippy_lints::utils::attr_collector::AttrCollector, + FormatArgsCollector: ::clippy_lints::utils::format_args_collector::FormatArgsCollector, + Visibility: ::clippy_lints::visibility::Visibility, +} +impl CombinedClippyEarlyPass { + pub fn new(conf: &'static Conf, fmt_args: &FormatArgsStorage, attrs: &AttrStorage) -> Self { + Self { + AlmostCompleteRange: ::clippy_lints::almost_complete_range::AlmostCompleteRange::new(conf), + InlineAsmX86AttSyntax: ::clippy_lints::asm_syntax::InlineAsmX86AttSyntax, + InlineAsmX86IntelSyntax: ::clippy_lints::asm_syntax::InlineAsmX86IntelSyntax, + PostExpansionEarlyAttributes: ::clippy_lints::attrs::PostExpansionEarlyAttributes::new(conf), + CfgNotTest: ::clippy_lints::cfg_not_test::CfgNotTest, + CrateInMacroDef: ::clippy_lints::crate_in_macro_def::CrateInMacroDef, + DefinitionInModuleRoot: ::clippy_lints::definition_in_module_root::DefinitionInModuleRoot::default(), + DisallowedScriptIdents: ::clippy_lints::disallowed_script_idents::DisallowedScriptIdents::new(conf), + Documentation: ::clippy_lints::doc::Documentation::new(conf), + DoubleParens: ::clippy_lints::double_parens::DoubleParens, + DuplicateMod: ::clippy_lints::duplicate_mod::DuplicateMod::default(), + ElseIfWithoutElse: ::clippy_lints::else_if_without_else::ElseIfWithoutElse, + EmptyLineAfter: ::clippy_lints::empty_line_after::EmptyLineAfter::default(), + ExcessiveNesting: ::clippy_lints::excessive_nesting::ExcessiveNesting::new(conf), + FieldScopedVisibilityModifiers: ::clippy_lints::field_scoped_visibility_modifiers::FieldScopedVisibilityModifiers, + Formatting: ::clippy_lints::formatting::Formatting, + EarlyFunctions: ::clippy_lints::functions::EarlyFunctions, + InlineTraitBounds: ::clippy_lints::inline_trait_bounds::InlineTraitBounds::default(), + IntPlusOne: ::clippy_lints::int_plus_one::IntPlusOne, + LargeIncludeFile: ::clippy_lints::large_include_file::LargeIncludeFile::new(conf), + UnderscoreTyped: ::clippy_lints::let_with_type_underscore::UnderscoreTyped, + DecimalLiteralRepresentation: ::clippy_lints::literal_representation::DecimalLiteralRepresentation::new(conf), + LiteralDigitGrouping: ::clippy_lints::literal_representation::LiteralDigitGrouping::new(conf), + MiscEarlyLints: ::clippy_lints::misc_early::MiscEarlyLints, + ModStyle: ::clippy_lints::module_style::ModStyle::default(), + MultiAssignments: ::clippy_lints::multi_assignments::MultiAssignments, + MultipleBoundLocations: ::clippy_lints::multiple_bound_locations::MultipleBoundLocations, + NeedlessArbitrarySelfType: ::clippy_lints::needless_arbitrary_self_type::NeedlessArbitrarySelfType, + NeedlessElse: ::clippy_lints::needless_else::NeedlessElse, + NonExpressiveNames: ::clippy_lints::non_expressive_names::NonExpressiveNames::new(conf), + OctalEscapes: ::clippy_lints::octal_escapes::OctalEscapes, + OptionEnvUnwrap: ::clippy_lints::option_env_unwrap::OptionEnvUnwrap, + PartialPubFields: ::clippy_lints::partial_pub_fields::PartialPubFields, + Precedence: ::clippy_lints::precedence::Precedence, + PubUse: ::clippy_lints::pub_use::PubUse, + RawStrings: ::clippy_lints::raw_strings::RawStrings::new(conf), + RedundantFieldNames: ::clippy_lints::redundant_field_names::RedundantFieldNames::new(conf), + RedundantStaticLifetimes: ::clippy_lints::redundant_static_lifetimes::RedundantStaticLifetimes::new(conf), + SingleCharLifetimeNames: ::clippy_lints::single_char_lifetime_names::SingleCharLifetimeNames, + SingleComponentPathImports: ::clippy_lints::single_component_path_imports::SingleComponentPathImports::default(), + SuspiciousOperationGroupings: ::clippy_lints::suspicious_operation_groupings::SuspiciousOperationGroupings::default(), + TabsInDocComments: ::clippy_lints::tabs_in_doc_comments::TabsInDocComments, + UnnecessarySelfImports: ::clippy_lints::unnecessary_self_imports::UnnecessarySelfImports, + UnnestedOrPatterns: ::clippy_lints::unnested_or_patterns::UnnestedOrPatterns::new(conf), + UnsafeNameRemoval: ::clippy_lints::unsafe_removed_from_name::UnsafeNameRemoval, + UnusedRounding: ::clippy_lints::unused_rounding::UnusedRounding, + UnusedUnit: ::clippy_lints::unused_unit::UnusedUnit, + AttrCollector: ::clippy_lints::utils::attr_collector::AttrCollector::new(attrs.clone()), + FormatArgsCollector: ::clippy_lints::utils::format_args_collector::FormatArgsCollector::new(fmt_args.clone()), + Visibility: ::clippy_lints::visibility::Visibility, + } + } +} +impl LintPass for CombinedClippyEarlyPass { + fn name(&self) -> &'static str { + "CombinedClippyEarlyPass" + } + fn get_lints(&self) -> LintVec { + vec![ + ::clippy_lints::attrs::ALLOW_ATTRIBUTES, + ::clippy_lints::attrs::ALLOW_ATTRIBUTES_WITHOUT_REASON, + ::clippy_lints::almost_complete_range::ALMOST_COMPLETE_RANGE, + ::clippy_lints::attrs::BLANKET_CLIPPY_RESTRICTION_LINTS, + ::clippy_lints::misc_early::BUILTIN_TYPE_SHADOW, + ::clippy_lints::cfg_not_test::CFG_NOT_TEST, + ::clippy_lints::crate_in_macro_def::CRATE_IN_MACRO_DEF, + ::clippy_lints::literal_representation::DECIMAL_LITERAL_REPRESENTATION, + ::clippy_lints::definition_in_module_root::DEFINITION_IN_MODULE_ROOT, + ::clippy_lints::attrs::DEPRECATED_SEMVER, + ::clippy_lints::disallowed_script_idents::DISALLOWED_SCRIPT_IDENTS, + ::clippy_lints::doc::DOC_BROKEN_LINK, + ::clippy_lints::doc::DOC_COMMENT_DOUBLE_SPACE_LINEBREAKS, + ::clippy_lints::doc::DOC_INCLUDE_WITHOUT_CFG, + ::clippy_lints::doc::DOC_LAZY_CONTINUATION, + ::clippy_lints::doc::DOC_LINK_CODE, + ::clippy_lints::doc::DOC_LINK_WITH_QUOTES, + ::clippy_lints::doc::DOC_MARKDOWN, + ::clippy_lints::doc::DOC_NESTED_REFDEFS, + ::clippy_lints::doc::DOC_OVERINDENTED_LIST_ITEMS, + ::clippy_lints::doc::DOC_PARAGRAPHS_MISSING_PUNCTUATION, + ::clippy_lints::doc::DOC_SUSPICIOUS_FOOTNOTES, + ::clippy_lints::double_parens::DOUBLE_PARENS, + ::clippy_lints::attrs::DUPLICATED_ATTRIBUTES, + ::clippy_lints::duplicate_mod::DUPLICATE_MOD, + ::clippy_lints::functions::DUPLICATE_UNDERSCORE_ARGUMENT, + ::clippy_lints::else_if_without_else::ELSE_IF_WITHOUT_ELSE, + ::clippy_lints::doc::EMPTY_DOCS, + ::clippy_lints::empty_line_after::EMPTY_LINE_AFTER_DOC_COMMENTS, + ::clippy_lints::empty_line_after::EMPTY_LINE_AFTER_OUTER_ATTR, + ::clippy_lints::excessive_nesting::EXCESSIVE_NESTING, + ::clippy_lints::field_scoped_visibility_modifiers::FIELD_SCOPED_VISIBILITY_MODIFIERS, + ::clippy_lints::attrs::IGNORE_WITHOUT_REASON, + ::clippy_lints::literal_representation::INCONSISTENT_DIGIT_GROUPING, + ::clippy_lints::asm_syntax::INLINE_ASM_X86_ATT_SYNTAX, + ::clippy_lints::asm_syntax::INLINE_ASM_X86_INTEL_SYNTAX, + ::clippy_lints::module_style::INLINE_MODULES, + ::clippy_lints::inline_trait_bounds::INLINE_TRAIT_BOUNDS, + ::clippy_lints::int_plus_one::INT_PLUS_ONE, + ::clippy_lints::non_expressive_names::JUST_UNDERSCORES_AND_DIGITS, + ::clippy_lints::literal_representation::LARGE_DIGIT_GROUPS, + ::clippy_lints::large_include_file::LARGE_INCLUDE_FILE, + ::clippy_lints::let_with_type_underscore::LET_WITH_TYPE_UNDERSCORE, + ::clippy_lints::non_expressive_names::MANY_SINGLE_CHAR_NAMES, + ::clippy_lints::doc::MISSING_ERRORS_DOC, + ::clippy_lints::doc::MISSING_PANICS_DOC, + ::clippy_lints::doc::MISSING_SAFETY_DOC, + ::clippy_lints::literal_representation::MISTYPED_LITERAL_SUFFIXES, + ::clippy_lints::attrs::MIXED_ATTRIBUTES_STYLE, + ::clippy_lints::misc_early::MIXED_CASE_HEX_LITERALS, + ::clippy_lints::module_style::MOD_MODULE_FILES, + ::clippy_lints::multiple_bound_locations::MULTIPLE_BOUND_LOCATIONS, + ::clippy_lints::multi_assignments::MULTI_ASSIGNMENTS, + ::clippy_lints::needless_arbitrary_self_type::NEEDLESS_ARBITRARY_SELF_TYPE, + ::clippy_lints::doc::NEEDLESS_DOCTEST_MAIN, + ::clippy_lints::needless_else::NEEDLESS_ELSE, + ::clippy_lints::visibility::NEEDLESS_PUB_SELF, + ::clippy_lints::raw_strings::NEEDLESS_RAW_STRINGS, + ::clippy_lints::raw_strings::NEEDLESS_RAW_STRING_HASHES, + ::clippy_lints::octal_escapes::OCTAL_ESCAPES, + ::clippy_lints::option_env_unwrap::OPTION_ENV_UNWRAP, + ::clippy_lints::partial_pub_fields::PARTIAL_PUB_FIELDS, + ::clippy_lints::formatting::POSSIBLE_MISSING_COMMA, + ::clippy_lints::formatting::POSSIBLE_MISSING_ELSE, + ::clippy_lints::precedence::PRECEDENCE, + ::clippy_lints::precedence::PRECEDENCE_BITS, + ::clippy_lints::pub_use::PUB_USE, + ::clippy_lints::visibility::PUB_WITHOUT_SHORTHAND, + ::clippy_lints::visibility::PUB_WITH_SHORTHAND, + ::clippy_lints::misc_early::REDUNDANT_AT_REST_PATTERN, + ::clippy_lints::redundant_field_names::REDUNDANT_FIELD_NAMES, + ::clippy_lints::misc_early::REDUNDANT_PATTERN, + ::clippy_lints::redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES, + ::clippy_lints::module_style::SELF_NAMED_MODULE_FILES, + ::clippy_lints::misc_early::SEPARATED_LITERAL_SUFFIX, + ::clippy_lints::attrs::SHOULD_PANIC_WITHOUT_EXPECT, + ::clippy_lints::non_expressive_names::SIMILAR_NAMES, + ::clippy_lints::single_char_lifetime_names::SINGLE_CHAR_LIFETIME_NAMES, + ::clippy_lints::single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS, + ::clippy_lints::formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING, + ::clippy_lints::doc::SUSPICIOUS_DOC_COMMENTS, + ::clippy_lints::formatting::SUSPICIOUS_ELSE_FORMATTING, + ::clippy_lints::suspicious_operation_groupings::SUSPICIOUS_OPERATION_GROUPINGS, + ::clippy_lints::formatting::SUSPICIOUS_UNARY_OP_FORMATTING, + ::clippy_lints::tabs_in_doc_comments::TABS_IN_DOC_COMMENTS, + ::clippy_lints::doc::TEST_ATTR_IN_DOCTEST, + ::clippy_lints::doc::TOO_LONG_FIRST_DOC_PARAGRAPH, + ::clippy_lints::doc::UNNECESSARY_SAFETY_DOC, + ::clippy_lints::unnecessary_self_imports::UNNECESSARY_SELF_IMPORTS, + ::clippy_lints::misc_early::UNNEEDED_FIELD_PATTERN, + ::clippy_lints::misc_early::UNNEEDED_WILDCARD_PATTERN, + ::clippy_lints::unnested_or_patterns::UNNESTED_OR_PATTERNS, + ::clippy_lints::literal_representation::UNREADABLE_LITERAL, + ::clippy_lints::unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME, + ::clippy_lints::misc_early::UNSEPARATED_LITERAL_SUFFIX, + ::clippy_lints::unused_rounding::UNUSED_ROUNDING, + ::clippy_lints::unused_unit::UNUSED_UNIT, + ::clippy_lints::literal_representation::UNUSUAL_BYTE_GROUPINGS, + ::clippy_lints::attrs::USELESS_ATTRIBUTE, + ::clippy_lints::misc_early::ZERO_PREFIXED_LITERAL, + ] + } +} +macro_rules! expand_early_methods { + ((), [$(fn $name:ident($($param:ident: $param_ty:ty),*);)*]) => { + impl EarlyLintPass for CombinedClippyEarlyPass {$( + fn $name(&mut self, cx: &EarlyContext<'_>, $($param: $param_ty),*) { + EarlyLintPass::$name(&mut self.AlmostCompleteRange, cx, $($param),*); + EarlyLintPass::$name(&mut self.InlineAsmX86AttSyntax, cx, $($param),*); + EarlyLintPass::$name(&mut self.InlineAsmX86IntelSyntax, cx, $($param),*); + EarlyLintPass::$name(&mut self.PostExpansionEarlyAttributes, cx, $($param),*); + EarlyLintPass::$name(&mut self.CfgNotTest, cx, $($param),*); + EarlyLintPass::$name(&mut self.CrateInMacroDef, cx, $($param),*); + EarlyLintPass::$name(&mut self.DefinitionInModuleRoot, cx, $($param),*); + EarlyLintPass::$name(&mut self.DisallowedScriptIdents, cx, $($param),*); + EarlyLintPass::$name(&mut self.Documentation, cx, $($param),*); + EarlyLintPass::$name(&mut self.DoubleParens, cx, $($param),*); + EarlyLintPass::$name(&mut self.DuplicateMod, cx, $($param),*); + EarlyLintPass::$name(&mut self.ElseIfWithoutElse, cx, $($param),*); + EarlyLintPass::$name(&mut self.EmptyLineAfter, cx, $($param),*); + EarlyLintPass::$name(&mut self.ExcessiveNesting, cx, $($param),*); + EarlyLintPass::$name(&mut self.FieldScopedVisibilityModifiers, cx, $($param),*); + EarlyLintPass::$name(&mut self.Formatting, cx, $($param),*); + EarlyLintPass::$name(&mut self.EarlyFunctions, cx, $($param),*); + EarlyLintPass::$name(&mut self.InlineTraitBounds, cx, $($param),*); + EarlyLintPass::$name(&mut self.IntPlusOne, cx, $($param),*); + EarlyLintPass::$name(&mut self.LargeIncludeFile, cx, $($param),*); + EarlyLintPass::$name(&mut self.UnderscoreTyped, cx, $($param),*); + EarlyLintPass::$name(&mut self.DecimalLiteralRepresentation, cx, $($param),*); + EarlyLintPass::$name(&mut self.LiteralDigitGrouping, cx, $($param),*); + EarlyLintPass::$name(&mut self.MiscEarlyLints, cx, $($param),*); + EarlyLintPass::$name(&mut self.ModStyle, cx, $($param),*); + EarlyLintPass::$name(&mut self.MultiAssignments, cx, $($param),*); + EarlyLintPass::$name(&mut self.MultipleBoundLocations, cx, $($param),*); + EarlyLintPass::$name(&mut self.NeedlessArbitrarySelfType, cx, $($param),*); + EarlyLintPass::$name(&mut self.NeedlessElse, cx, $($param),*); + EarlyLintPass::$name(&mut self.NonExpressiveNames, cx, $($param),*); + EarlyLintPass::$name(&mut self.OctalEscapes, cx, $($param),*); + EarlyLintPass::$name(&mut self.OptionEnvUnwrap, cx, $($param),*); + EarlyLintPass::$name(&mut self.PartialPubFields, cx, $($param),*); + EarlyLintPass::$name(&mut self.Precedence, cx, $($param),*); + EarlyLintPass::$name(&mut self.PubUse, cx, $($param),*); + EarlyLintPass::$name(&mut self.RawStrings, cx, $($param),*); + EarlyLintPass::$name(&mut self.RedundantFieldNames, cx, $($param),*); + EarlyLintPass::$name(&mut self.RedundantStaticLifetimes, cx, $($param),*); + EarlyLintPass::$name(&mut self.SingleCharLifetimeNames, cx, $($param),*); + EarlyLintPass::$name(&mut self.SingleComponentPathImports, cx, $($param),*); + EarlyLintPass::$name(&mut self.SuspiciousOperationGroupings, cx, $($param),*); + EarlyLintPass::$name(&mut self.TabsInDocComments, cx, $($param),*); + EarlyLintPass::$name(&mut self.UnnecessarySelfImports, cx, $($param),*); + EarlyLintPass::$name(&mut self.UnnestedOrPatterns, cx, $($param),*); + EarlyLintPass::$name(&mut self.UnsafeNameRemoval, cx, $($param),*); + EarlyLintPass::$name(&mut self.UnusedRounding, cx, $($param),*); + EarlyLintPass::$name(&mut self.UnusedUnit, cx, $($param),*); + EarlyLintPass::$name(&mut self.AttrCollector, cx, $($param),*); + EarlyLintPass::$name(&mut self.FormatArgsCollector, cx, $($param),*); + EarlyLintPass::$name(&mut self.Visibility, cx, $($param),*); + } + )*} + } +} +early_lint_methods!(expand_early_methods, ()); + +pub struct CombinedClippyLatePass<'tcx> { + AbsolutePaths: Option<::clippy_lints::absolute_paths::AbsolutePaths>, + ApproxConstant: Option<::clippy_lints::approx_const::ApproxConstant>, + ArbitrarySourceItemOrdering: Option<::clippy_lints::arbitrary_source_item_ordering::ArbitrarySourceItemOrdering>, + ArcWithNonSendSync: Option<::clippy_lints::arc_with_non_send_sync::ArcWithNonSendSync>, + AsConversions: Option<::clippy_lints::as_conversions::AsConversions>, + AssertIsEmpty: Option<::clippy_lints::assert_is_empty::AssertIsEmpty>, + AssertionsOnConstants: Option<::clippy_lints::assertions_on_constants::AssertionsOnConstants>, + AssertionsOnResultStates: Option<::clippy_lints::assertions_on_result_states::AssertionsOnResultStates>, + AssigningClones: Option<::clippy_lints::assigning_clones::AssigningClones>, + AsyncYieldsAsync: Option<::clippy_lints::async_yields_async::AsyncYieldsAsync>, + Attributes: Option<::clippy_lints::attrs::Attributes>, + AwaitHolding: Option<::clippy_lints::await_holding_invalid::AwaitHolding>, + ManualBitWidth: Option<::clippy_lints::bit_width::ManualBitWidth>, + BlockScrutinee: Option<::clippy_lints::block_scrutinee::BlockScrutinee>, + BlocksInConditions: Option<::clippy_lints::blocks_in_conditions::BlocksInConditions>, + BoolAssertComparison: Option<::clippy_lints::bool_assert_comparison::BoolAssertComparison>, + BoolComparison: Option<::clippy_lints::bool_comparison::BoolComparison>, + BoolToIntWithIf: Option<::clippy_lints::bool_to_int_with_if::BoolToIntWithIf>, + NonminimalBool: Option<::clippy_lints::booleans::NonminimalBool>, + BorrowDerefRef: Option<::clippy_lints::borrow_deref_ref::BorrowDerefRef>, + BoxDefault: Option<::clippy_lints::box_default::BoxDefault>, + ByteCharSlice: Option<::clippy_lints::byte_char_slices::ByteCharSlice>, + Cargo: Option<::clippy_lints::cargo::Cargo>, + Casts: Option<::clippy_lints::casts::Casts>, + CheckedConversions: Option<::clippy_lints::checked_conversions::CheckedConversions>, + ClonedRefToSliceRefs: Option<::clippy_lints::cloned_ref_to_slice_refs::ClonedRefToSliceRefs>, + CoerceContainerToAny: Option<::clippy_lints::coerce_container_to_any::CoerceContainerToAny>, + CognitiveComplexity: Option<::clippy_lints::cognitive_complexity::CognitiveComplexity>, + CollapsibleIf: Option<::clippy_lints::collapsible_if::CollapsibleIf>, + CollectionIsNeverRead: Option<::clippy_lints::collection_is_never_read::CollectionIsNeverRead>, + ComparisonChain: Option<::clippy_lints::comparison_chain::ComparisonChain>, + CopyIterator: Option<::clippy_lints::copy_iterator::CopyIterator>, + CreateDir: Option<::clippy_lints::create_dir::CreateDir>, + DbgMacro: Option<::clippy_lints::dbg_macro::DbgMacro>, + Default: Option<::clippy_lints::default::Default>, + DefaultConstructedUnitStructs: Option<::clippy_lints::default_constructed_unit_structs::DefaultConstructedUnitStructs>, + DefaultIterEmpty: Option<::clippy_lints::default_instead_of_iter_empty::DefaultIterEmpty>, + DefaultNumericFallback: Option<::clippy_lints::default_numeric_fallback::DefaultNumericFallback>, + DefaultUnionRepresentation: Option<::clippy_lints::default_union_representation::DefaultUnionRepresentation>, + Dereferencing: Option<::clippy_lints::dereference::Dereferencing<'tcx>>, + DerivableImpls: Option<::clippy_lints::derivable_impls::DerivableImpls>, + Derive: Option<::clippy_lints::derive::Derive>, + DisallowedFields: Option<::clippy_lints::disallowed_fields::DisallowedFields>, + DisallowedMacros: Option<::clippy_lints::disallowed_macros::DisallowedMacros>, + DisallowedMethods: Option<::clippy_lints::disallowed_methods::DisallowedMethods>, + DisallowedNames: Option<::clippy_lints::disallowed_names::DisallowedNames>, + DisallowedTypes: Option<::clippy_lints::disallowed_types::DisallowedTypes>, + Documentation: Option<::clippy_lints::doc::Documentation>, + DropForgetRef: Option<::clippy_lints::drop_forget_ref::DropForgetRef>, + DurationSuboptimalUnits: Option<::clippy_lints::duration_suboptimal_units::DurationSuboptimalUnits>, + EmptyDrop: Option<::clippy_lints::empty_drop::EmptyDrop>, + EmptyEnums: Option<::clippy_lints::empty_enums::EmptyEnums>, + EmptyWithBrackets: Option<::clippy_lints::empty_with_brackets::EmptyWithBrackets>, + EndianBytes: Option<::clippy_lints::endian_bytes::EndianBytes>, + HashMapPass: Option<::clippy_lints::entry::HashMapPass>, + UnportableVariant: Option<::clippy_lints::enum_clike::UnportableVariant>, + PatternEquality: Option<::clippy_lints::equatable_if_let::PatternEquality>, + ErrorImplError: Option<::clippy_lints::error_impl_error::ErrorImplError>, + BoxedLocal: Option<::clippy_lints::escape::BoxedLocal>, + EtaReduction: Option<::clippy_lints::eta_reduction::EtaReduction>, + ExcessiveBools: Option<::clippy_lints::excessive_bools::ExcessiveBools>, + ExhaustiveItems: Option<::clippy_lints::exhaustive_items::ExhaustiveItems>, + Exit: Option<::clippy_lints::exit::Exit>, + ExplicitWrite: Option<::clippy_lints::explicit_write::ExplicitWrite>, + ExtraUnusedTypeParameters: Option<::clippy_lints::extra_unused_type_parameters::ExtraUnusedTypeParameters>, + FallibleImplFrom: Option<::clippy_lints::fallible_impl_from::FallibleImplFrom>, + FloatLiteral: Option<::clippy_lints::float_literal::FloatLiteral>, + FloatingPointArithmetic: Option<::clippy_lints::floating_point_arithmetic::FloatingPointArithmetic>, + UselessFormat: Option<::clippy_lints::format::UselessFormat>, + FormatArgs: Option<::clippy_lints::format_args::FormatArgs<'tcx>>, + FormatImpl: Option<::clippy_lints::format_impl::FormatImpl>, + FormatPushString: Option<::clippy_lints::format_push_string::FormatPushString>, + FourForwardSlashes: Option<::clippy_lints::four_forward_slashes::FourForwardSlashes>, + FromOverInto: Option<::clippy_lints::from_over_into::FromOverInto>, + FromRawWithVoidPtr: Option<::clippy_lints::from_raw_with_void_ptr::FromRawWithVoidPtr>, + FromStrRadix10: Option<::clippy_lints::from_str_radix_10::FromStrRadix10>, + Functions: Option<::clippy_lints::functions::Functions>, + FutureNotSend: Option<::clippy_lints::future_not_send::FutureNotSend>, + IfLetMutex: Option<::clippy_lints::if_let_mutex::IfLetMutex>, + IfNotElse: Option<::clippy_lints::if_not_else::IfNotElse>, + IfThenSomeElseNone: Option<::clippy_lints::if_then_some_else_none::IfThenSomeElseNone>, + CopyAndPaste: Option<::clippy_lints::ifs::CopyAndPaste<'tcx>>, + IgnoredUnitPatterns: Option<::clippy_lints::ignored_unit_patterns::IgnoredUnitPatterns>, + ImplHashWithBorrowStrBytes: Option<::clippy_lints::impl_hash_with_borrow_str_and_bytes::ImplHashWithBorrowStrBytes>, + ImplicitHasher: Option<::clippy_lints::implicit_hasher::ImplicitHasher>, + ImplicitReturn: Option<::clippy_lints::implicit_return::ImplicitReturn>, + ImplicitSaturatingAdd: Option<::clippy_lints::implicit_saturating_add::ImplicitSaturatingAdd>, + ImplicitSaturatingSub: Option<::clippy_lints::implicit_saturating_sub::ImplicitSaturatingSub>, + ImpliedBoundsInImpls: Option<::clippy_lints::implied_bounds_in_impls::ImpliedBoundsInImpls>, + IncompatibleMsrv: Option<::clippy_lints::incompatible_msrv::IncompatibleMsrv>, + InconsistentStructConstructor: Option<::clippy_lints::inconsistent_struct_constructor::InconsistentStructConstructor>, + IndexRefutableSlice: Option<::clippy_lints::index_refutable_slice::IndexRefutableSlice>, + IndexingSlicing: Option<::clippy_lints::indexing_slicing::IndexingSlicing>, + IneffectiveOpenOptions: Option<::clippy_lints::ineffective_open_options::IneffectiveOpenOptions>, + InfallibleTryFrom: Option<::clippy_lints::infallible_try_from::InfallibleTryFrom>, + InfiniteIter: Option<::clippy_lints::infinite_iter::InfiniteIter>, + MultipleInherentImpl: Option<::clippy_lints::inherent_impl::MultipleInherentImpl>, + InherentToString: Option<::clippy_lints::inherent_to_string::InherentToString>, + NumberedFields: Option<::clippy_lints::init_numbered_fields::NumberedFields>, + InlineFnWithoutBody: Option<::clippy_lints::inline_fn_without_body::InlineFnWithoutBody>, + ItemNameRepetitions: Option<::clippy_lints::item_name_repetitions::ItemNameRepetitions>, + ItemsAfterStatements: Option<::clippy_lints::items_after_statements::ItemsAfterStatements>, + ItemsAfterTestModule: Option<::clippy_lints::items_after_test_module::ItemsAfterTestModule>, + IterNotReturningIterator: Option<::clippy_lints::iter_not_returning_iterator::IterNotReturningIterator>, + IterOverHashType: Option<::clippy_lints::iter_over_hash_type::IterOverHashType>, + IterWithoutIntoIter: Option<::clippy_lints::iter_without_into_iter::IterWithoutIntoIter>, + LargeConstArrays: Option<::clippy_lints::large_const_arrays::LargeConstArrays>, + LargeEnumVariant: Option<::clippy_lints::large_enum_variant::LargeEnumVariant>, + LargeFuture: Option<::clippy_lints::large_futures::LargeFuture>, + LargeIncludeFile: Option<::clippy_lints::large_include_file::LargeIncludeFile>, + LargeStackArrays: Option<::clippy_lints::large_stack_arrays::LargeStackArrays>, + LargeStackFrames: Option<::clippy_lints::large_stack_frames::LargeStackFrames>, + LegacyNumericConstants: Option<::clippy_lints::legacy_numeric_constants::LegacyNumericConstants>, + LenWithoutIsEmpty: Option<::clippy_lints::len_without_is_empty::LenWithoutIsEmpty>, + LenZero: Option<::clippy_lints::len_zero::LenZero>, + LetIfSeq: Option<::clippy_lints::let_if_seq::LetIfSeq>, + LetUnderscore: Option<::clippy_lints::let_underscore::LetUnderscore>, + Lifetimes: Option<::clippy_lints::lifetimes::Lifetimes>, + LiteralStringWithFormattingArg: Option<::clippy_lints::literal_string_with_formatting_args::LiteralStringWithFormattingArg>, + Loops: Option<::clippy_lints::loops::Loops>, + ExprMetavarsInUnsafe: Option<::clippy_lints::macro_metavars_in_unsafe::ExprMetavarsInUnsafe>, + MacroUseImports: Option<::clippy_lints::macro_use::MacroUseImports>, + MainRecursion: Option<::clippy_lints::main_recursion::MainRecursion>, + ManualAbsDiff: Option<::clippy_lints::manual_abs_diff::ManualAbsDiff>, + ManualAssert: Option<::clippy_lints::manual_assert::ManualAssert>, + ManualAssertEq: Option<::clippy_lints::manual_assert_eq::ManualAssertEq>, + ManualAsyncFn: Option<::clippy_lints::manual_async_fn::ManualAsyncFn>, + ManualBits: Option<::clippy_lints::manual_bits::ManualBits>, + ManualCheckedOps: Option<::clippy_lints::manual_checked_ops::ManualCheckedOps>, + ManualClamp: Option<::clippy_lints::manual_clamp::ManualClamp>, + ManualFloatMethods: Option<::clippy_lints::manual_float_methods::ManualFloatMethods>, + ManualHashOne: Option<::clippy_lints::manual_hash_one::ManualHashOne>, + ManualIgnoreCaseCmp: Option<::clippy_lints::manual_ignore_case_cmp::ManualIgnoreCaseCmp>, + ManualIlog2: Option<::clippy_lints::manual_ilog2::ManualIlog2>, + ManualIsAsciiCheck: Option<::clippy_lints::manual_is_ascii_check::ManualIsAsciiCheck>, + ManualIsPowerOfTwo: Option<::clippy_lints::manual_is_power_of_two::ManualIsPowerOfTwo>, + ManualMainSeparatorStr: Option<::clippy_lints::manual_main_separator_str::ManualMainSeparatorStr>, + ManualNonExhaustive: Option<::clippy_lints::manual_non_exhaustive::ManualNonExhaustive>, + ManualNoopWaker: Option<::clippy_lints::manual_noop_waker::ManualNoopWaker>, + ManualOptionAsSlice: Option<::clippy_lints::manual_option_as_slice::ManualOptionAsSlice>, + ManualPopIf: Option<::clippy_lints::manual_pop_if::ManualPopIf>, + ManualRangePatterns: Option<::clippy_lints::manual_range_patterns::ManualRangePatterns>, + ManualRemEuclid: Option<::clippy_lints::manual_rem_euclid::ManualRemEuclid>, + ManualRetain: Option<::clippy_lints::manual_retain::ManualRetain>, + ManualRotate: Option<::clippy_lints::manual_rotate::ManualRotate>, + ManualSliceSizeCalculation: Option<::clippy_lints::manual_slice_size_calculation::ManualSliceSizeCalculation>, + ManualStringNew: Option<::clippy_lints::manual_string_new::ManualStringNew>, + ManualStrip: Option<::clippy_lints::manual_strip::ManualStrip>, + ManualTake: Option<::clippy_lints::manual_take::ManualTake>, + MapUnit: Option<::clippy_lints::map_unit_fn::MapUnit>, + MatchResultOk: Option<::clippy_lints::match_result_ok::MatchResultOk>, + Matches: Option<::clippy_lints::matches::Matches>, + MemReplace: Option<::clippy_lints::mem_replace::MemReplace>, + Methods: Option<::clippy_lints::methods::Methods>, + MinIdentChars: Option<::clippy_lints::min_ident_chars::MinIdentChars>, + MinMaxPass: Option<::clippy_lints::minmax::MinMaxPass>, + LintPass: Option<::clippy_lints::misc::LintPass>, + TypeParamMismatch: Option<::clippy_lints::mismatching_type_param_order::TypeParamMismatch>, + MissingAssertMessage: Option<::clippy_lints::missing_assert_message::MissingAssertMessage>, + MissingAssertsForIndexing: Option<::clippy_lints::missing_asserts_for_indexing::MissingAssertsForIndexing>, + MissingConstForFn: Option<::clippy_lints::missing_const_for_fn::MissingConstForFn>, + MissingConstForThreadLocal: Option<::clippy_lints::missing_const_for_thread_local::MissingConstForThreadLocal>, + MissingDoc: Option<::clippy_lints::missing_doc::MissingDoc>, + ImportRename: Option<::clippy_lints::missing_enforced_import_rename::ImportRename>, + MissingFieldsInDebug: Option<::clippy_lints::missing_fields_in_debug::MissingFieldsInDebug>, + MissingInline: Option<::clippy_lints::missing_inline::MissingInline>, + MissingTraitMethods: Option<::clippy_lints::missing_trait_methods::MissingTraitMethods>, + EvalOrderDependence: Option<::clippy_lints::mixed_read_write_in_expression::EvalOrderDependence>, + MultipleUnsafeOpsPerBlock: Option<::clippy_lints::multiple_unsafe_ops_per_block::MultipleUnsafeOpsPerBlock>, + MutableKeyType: Option<::clippy_lints::mut_key::MutableKeyType<'tcx>>, + MutMut: Option<::clippy_lints::mut_mut::MutMut>, + DebugAssertWithMutCall: Option<::clippy_lints::mutable_debug_assertion::DebugAssertWithMutCall>, + Mutex: Option<::clippy_lints::mutex_atomic::Mutex>, + NeedlessBool: Option<::clippy_lints::needless_bool::NeedlessBool>, + NeedlessBorrowedRef: Option<::clippy_lints::needless_borrowed_ref::NeedlessBorrowedRef>, + NeedlessBorrowsForGenericArgs: Option<::clippy_lints::needless_borrows_for_generic_args::NeedlessBorrowsForGenericArgs<'tcx>>, + NeedlessContinue: Option<::clippy_lints::needless_continue::NeedlessContinue>, + NeedlessForEach: Option<::clippy_lints::needless_for_each::NeedlessForEach>, + NeedlessIfs: Option<::clippy_lints::needless_ifs::NeedlessIfs>, + NeedlessLateInit: Option<::clippy_lints::needless_late_init::NeedlessLateInit<'tcx>>, + NeedlessMaybeSized: Option<::clippy_lints::needless_maybe_sized::NeedlessMaybeSized>, + NeedlessNonzeroGet: Option<::clippy_lints::needless_nonzero_get::NeedlessNonzeroGet>, + NeedlessParensOnRangeLiterals: Option<::clippy_lints::needless_parens_on_range_literals::NeedlessParensOnRangeLiterals>, + NeedlessPassByRefMut: Option<::clippy_lints::needless_pass_by_ref_mut::NeedlessPassByRefMut<'tcx>>, + NeedlessPassByValue: Option<::clippy_lints::needless_pass_by_value::NeedlessPassByValue>, + NeedlessQuestionMark: Option<::clippy_lints::needless_question_mark::NeedlessQuestionMark>, + NeedlessUpdate: Option<::clippy_lints::needless_update::NeedlessUpdate>, + NoNegCompOpForPartialOrd: Option<::clippy_lints::neg_cmp_op_on_partial_ord::NoNegCompOpForPartialOrd>, + NegMultiply: Option<::clippy_lints::neg_multiply::NegMultiply>, + NewWithoutDefault: Option<::clippy_lints::new_without_default::NewWithoutDefault>, + NoEffect: Option<::clippy_lints::no_effect::NoEffect>, + NoMangleWithRustAbi: Option<::clippy_lints::no_mangle_with_rust_abi::NoMangleWithRustAbi>, + NonCanonicalImpls: Option<::clippy_lints::non_canonical_impls::NonCanonicalImpls>, + NonCopyConst: Option<::clippy_lints::non_copy_const::NonCopyConst<'tcx>>, + NonOctalUnixPermissions: Option<::clippy_lints::non_octal_unix_permissions::NonOctalUnixPermissions>, + NonSendFieldInSendTy: Option<::clippy_lints::non_send_fields_in_send_ty::NonSendFieldInSendTy>, + NonStdLazyStatic: Option<::clippy_lints::non_std_lazy_statics::NonStdLazyStatic>, + NonZeroSuggestions: Option<::clippy_lints::non_zero_suggestions::NonZeroSuggestions>, + NonnullUncheckedOnBoxPtr: Option<::clippy_lints::nonnull_unchecked_on_box_ptr::NonnullUncheckedOnBoxPtr>, + OnlyUsedInRecursion: Option<::clippy_lints::only_used_in_recursion::OnlyUsedInRecursion>, + Operators: Option<::clippy_lints::operators::Operators>, + ArithmeticSideEffects: Option<::clippy_lints::operators::arithmetic_side_effects::ArithmeticSideEffects>, + OptionIfLetElse: Option<::clippy_lints::option_if_let_else::OptionIfLetElse>, + PanicInResultFn: Option<::clippy_lints::panic_in_result_fn::PanicInResultFn>, + PanicUnimplemented: Option<::clippy_lints::panic_unimplemented::PanicUnimplemented>, + PanickingOverflowChecks: Option<::clippy_lints::panicking_overflow_checks::PanickingOverflowChecks>, + PartialEqNeImpl: Option<::clippy_lints::partialeq_ne_impl::PartialEqNeImpl>, + PartialeqToNone: Option<::clippy_lints::partialeq_to_none::PartialeqToNone>, + PassByRefOrValue: Option<::clippy_lints::pass_by_ref_or_value::PassByRefOrValue>, + PathbufThenPush: Option<::clippy_lints::pathbuf_init_then_push::PathbufThenPush<'tcx>>, + PatternTypeMismatch: Option<::clippy_lints::pattern_type_mismatch::PatternTypeMismatch>, + PermissionsSetReadonlyFalse: Option<::clippy_lints::permissions_set_readonly_false::PermissionsSetReadonlyFalse>, + PointersInNomemAsmBlock: Option<::clippy_lints::pointers_in_nomem_asm_block::PointersInNomemAsmBlock>, + Ptr: Option<::clippy_lints::ptr::Ptr>, + PubUnderscoreFields: Option<::clippy_lints::pub_underscore_fields::PubUnderscoreFields>, + QuestionMark: Option<::clippy_lints::question_mark::QuestionMark>, + QuestionMarkUsed: Option<::clippy_lints::question_mark_used::QuestionMarkUsed>, + Ranges: Option<::clippy_lints::ranges::Ranges>, + RcCloneInVecInit: Option<::clippy_lints::rc_clone_in_vec_init::RcCloneInVecInit>, + ReadZeroByteVec: Option<::clippy_lints::read_zero_byte_vec::ReadZeroByteVec>, + RedundantAsyncBlock: Option<::clippy_lints::redundant_async_block::RedundantAsyncBlock>, + RedundantClone: Option<::clippy_lints::redundant_clone::RedundantClone>, + RedundantClosureCall: Option<::clippy_lints::redundant_closure_call::RedundantClosureCall>, + RedundantElse: Option<::clippy_lints::redundant_else::RedundantElse>, + RedundantLocals: Option<::clippy_lints::redundant_locals::RedundantLocals>, + RedundantPubCrate: Option<::clippy_lints::redundant_pub_crate::RedundantPubCrate>, + RedundantSlicing: Option<::clippy_lints::redundant_slicing::RedundantSlicing>, + RedundantTestPrefix: Option<::clippy_lints::redundant_test_prefix::RedundantTestPrefix>, + RedundantTypeAnnotations: Option<::clippy_lints::redundant_type_annotations::RedundantTypeAnnotations>, + RefOptionRef: Option<::clippy_lints::ref_option_ref::RefOptionRef>, + RefPatterns: Option<::clippy_lints::ref_patterns::RefPatterns>, + DerefAddrOf: Option<::clippy_lints::reference::DerefAddrOf>, + Regex: Option<::clippy_lints::regex::Regex>, + RepeatVecWithCapacity: Option<::clippy_lints::repeat_vec_with_capacity::RepeatVecWithCapacity>, + ReplaceBox: Option<::clippy_lints::replace_box::ReplaceBox>, + ReserveAfterInitialization: Option<::clippy_lints::reserve_after_initialization::ReserveAfterInitialization>, + RestWhenDestructuringStruct: Option<::clippy_lints::rest_when_destructuring_struct::RestWhenDestructuringStruct>, + ReturnSelfNotMustUse: Option<::clippy_lints::return_self_not_must_use::ReturnSelfNotMustUse>, + Return: Option<::clippy_lints::returns::Return>, + SameLengthAndCapacity: Option<::clippy_lints::same_length_and_capacity::SameLengthAndCapacity>, + SameNameMethod: Option<::clippy_lints::same_name_method::SameNameMethod>, + SelfNamedConstructors: Option<::clippy_lints::self_named_constructors::SelfNamedConstructors>, + SemicolonBlock: Option<::clippy_lints::semicolon_block::SemicolonBlock>, + SemicolonIfNothingReturned: Option<::clippy_lints::semicolon_if_nothing_returned::SemicolonIfNothingReturned>, + SerdeApi: Option<::clippy_lints::serde_api::SerdeApi>, + SetContainsOrInsert: Option<::clippy_lints::set_contains_or_insert::SetContainsOrInsert>, + Shadow: Option<::clippy_lints::shadow::Shadow>, + SignificantDropTightening: Option<::clippy_lints::significant_drop_tightening::SignificantDropTightening<'tcx>>, + SingleCallFn: Option<::clippy_lints::single_call_fn::SingleCallFn>, + SingleOptionMap: Option<::clippy_lints::single_option_map::SingleOptionMap>, + SingleRangeInVecInit: Option<::clippy_lints::single_range_in_vec_init::SingleRangeInVecInit>, + SizeOfInElementCount: Option<::clippy_lints::size_of_in_element_count::SizeOfInElementCount>, + SizeOfRef: Option<::clippy_lints::size_of_ref::SizeOfRef>, + SlowVectorInit: Option<::clippy_lints::slow_vector_initialization::SlowVectorInit>, + StdReexports: Option<::clippy_lints::std_instead_of_core::StdReexports>, + StringPatterns: Option<::clippy_lints::string_patterns::StringPatterns>, + StrToString: Option<::clippy_lints::strings::StrToString>, + StringAdd: Option<::clippy_lints::strings::StringAdd>, + StringLitAsBytes: Option<::clippy_lints::strings::StringLitAsBytes>, + TrimSplitWhitespace: Option<::clippy_lints::strings::TrimSplitWhitespace>, + StrlenOnCStrings: Option<::clippy_lints::strlen_on_c_strings::StrlenOnCStrings>, + SuspiciousImpl: Option<::clippy_lints::suspicious_trait_impl::SuspiciousImpl>, + ConfusingXorAndPow: Option<::clippy_lints::suspicious_xor_used_as_pow::ConfusingXorAndPow>, + Swap: Option<::clippy_lints::swap::Swap>, + SwapPtrToRef: Option<::clippy_lints::swap_ptr_to_ref::SwapPtrToRef>, + TemporaryAssignment: Option<::clippy_lints::temporary_assignment::TemporaryAssignment>, + TestsOutsideTestModule: Option<::clippy_lints::tests_outside_test_module::TestsOutsideTestModule>, + UncheckedTimeSubtraction: Option<::clippy_lints::time_subtraction::UncheckedTimeSubtraction>, + ToDigitIsSome: Option<::clippy_lints::to_digit_is_some::ToDigitIsSome>, + ToStringTraitImpl: Option<::clippy_lints::to_string_trait_impl::ToStringTraitImpl>, + ToplevelRefArg: Option<::clippy_lints::toplevel_ref_arg::ToplevelRefArg>, + TrailingEmptyArray: Option<::clippy_lints::trailing_empty_array::TrailingEmptyArray>, + TraitBounds: Option<::clippy_lints::trait_bounds::TraitBounds>, + Transmute: Option<::clippy_lints::transmute::Transmute>, + TupleArrayConversions: Option<::clippy_lints::tuple_array_conversions::TupleArrayConversions>, + Types: Option<::clippy_lints::types::Types>, + UnconditionalRecursion: Option<::clippy_lints::unconditional_recursion::UnconditionalRecursion>, + UndocumentedUnsafeBlocks: Option<::clippy_lints::undocumented_unsafe_blocks::UndocumentedUnsafeBlocks>, + Unicode: Option<::clippy_lints::unicode::Unicode>, + UninhabitedReferences: Option<::clippy_lints::uninhabited_references::UninhabitedReferences>, + UninitVec: Option<::clippy_lints::uninit_vec::UninitVec>, + UnitReturnExpectingOrd: Option<::clippy_lints::unit_return_expecting_ord::UnitReturnExpectingOrd>, + UnitTypes: Option<::clippy_lints::unit_types::UnitTypes>, + UnnecessaryBoxReturns: Option<::clippy_lints::unnecessary_box_returns::UnnecessaryBoxReturns>, + UnnecessaryLiteralBound: Option<::clippy_lints::unnecessary_literal_bound::UnnecessaryLiteralBound>, + UnnecessaryMapOnConstructor: Option<::clippy_lints::unnecessary_map_on_constructor::UnnecessaryMapOnConstructor>, + UnnecessaryMutPassed: Option<::clippy_lints::unnecessary_mut_passed::UnnecessaryMutPassed>, + UnnecessaryOwnedEmptyStrings: Option<::clippy_lints::unnecessary_owned_empty_strings::UnnecessaryOwnedEmptyStrings>, + UnnecessarySemicolon: Option<::clippy_lints::unnecessary_semicolon::UnnecessarySemicolon>, + UnnecessaryStruct: Option<::clippy_lints::unnecessary_struct_initialization::UnnecessaryStruct>, + UnnecessaryWraps: Option<::clippy_lints::unnecessary_wraps::UnnecessaryWraps>, + UnneededStructPattern: Option<::clippy_lints::unneeded_struct_pattern::UnneededStructPattern>, + UnusedAsync: Option<::clippy_lints::unused_async::UnusedAsync>, + UnusedIoAmount: Option<::clippy_lints::unused_io_amount::UnusedIoAmount>, + UnusedPeekable: Option<::clippy_lints::unused_peekable::UnusedPeekable>, + UnusedResultOk: Option<::clippy_lints::unused_result_ok::UnusedResultOk>, + UnusedSelf: Option<::clippy_lints::unused_self::UnusedSelf>, + UnusedTraitNames: Option<::clippy_lints::unused_trait_names::UnusedTraitNames>, + UnusedUnit: Option<::clippy_lints::unused_unit::UnusedUnit>, + Unwrap: Option<::clippy_lints::unwrap::Unwrap>, + UnwrapInResult: Option<::clippy_lints::unwrap_in_result::UnwrapInResult>, + UpperCaseAcronyms: Option<::clippy_lints::upper_case_acronyms::UpperCaseAcronyms>, + UseSelf: Option<::clippy_lints::use_self::UseSelf>, + UselessConcat: Option<::clippy_lints::useless_concat::UselessConcat>, + UselessConversion: Option<::clippy_lints::useless_conversion::UselessConversion>, + UselessVec: Option<::clippy_lints::useless_vec::UselessVec>, + Author: Option<::clippy_lints::utils::author::Author>, + DumpHir: Option<::clippy_lints::utils::dump_hir::DumpHir>, + VecInitThenPush: Option<::clippy_lints::vec_init_then_push::VecInitThenPush>, + VolatileComposites: Option<::clippy_lints::volatile_composites::VolatileComposites>, + WildcardImports: Option<::clippy_lints::wildcard_imports::WildcardImports>, + WithCapacityZero: Option<::clippy_lints::with_capacity_zero::WithCapacityZero>, + Write: Option<::clippy_lints::write::Write>, + ZeroDiv: Option<::clippy_lints::zero_div_zero::ZeroDiv>, + ZeroRepeatSideEffects: Option<::clippy_lints::zero_repeat_side_effects::ZeroRepeatSideEffects>, + ZeroSizedMapValues: Option<::clippy_lints::zero_sized_map_values::ZeroSizedMapValues>, + ZombieProcesses: Option<::clippy_lints::zombie_processes::ZombieProcesses>, +} +impl<'tcx> CombinedClippyLatePass<'tcx> { + pub fn new(tcx: TyCtxt<'tcx>, conf: &'static Conf, fmt_args: &FormatArgsStorage, attrs: &AttrStorage) -> Self { + let skippable_lints = tcx.skippable_lints(()); + Self { + AbsolutePaths: is_lint_pass_required(skippable_lints, AbsolutePaths_LINTS).then(|| ::clippy_lints::absolute_paths::AbsolutePaths::new(conf)), + ApproxConstant: is_lint_pass_required(skippable_lints, ApproxConstant_LINTS).then(|| ::clippy_lints::approx_const::ApproxConstant::new(conf)), + ArbitrarySourceItemOrdering: is_lint_pass_required(skippable_lints, ArbitrarySourceItemOrdering_LINTS).then(|| ::clippy_lints::arbitrary_source_item_ordering::ArbitrarySourceItemOrdering::new(tcx, conf)), + ArcWithNonSendSync: is_lint_pass_required(skippable_lints, ArcWithNonSendSync_LINTS).then_some(::clippy_lints::arc_with_non_send_sync::ArcWithNonSendSync), + AsConversions: is_lint_pass_required(skippable_lints, AsConversions_LINTS).then_some(::clippy_lints::as_conversions::AsConversions), + AssertIsEmpty: is_lint_pass_required(skippable_lints, AssertIsEmpty_LINTS).then_some(::clippy_lints::assert_is_empty::AssertIsEmpty), + AssertionsOnConstants: is_lint_pass_required(skippable_lints, AssertionsOnConstants_LINTS).then(|| ::clippy_lints::assertions_on_constants::AssertionsOnConstants::new(conf)), + AssertionsOnResultStates: is_lint_pass_required(skippable_lints, AssertionsOnResultStates_LINTS).then_some(::clippy_lints::assertions_on_result_states::AssertionsOnResultStates), + AssigningClones: is_lint_pass_required(skippable_lints, AssigningClones_LINTS).then(|| ::clippy_lints::assigning_clones::AssigningClones::new(conf)), + AsyncYieldsAsync: is_lint_pass_required(skippable_lints, AsyncYieldsAsync_LINTS).then_some(::clippy_lints::async_yields_async::AsyncYieldsAsync), + Attributes: is_lint_pass_required(skippable_lints, Attributes_LINTS).then(|| ::clippy_lints::attrs::Attributes::new(conf)), + AwaitHolding: is_lint_pass_required(skippable_lints, AwaitHolding_LINTS).then(|| ::clippy_lints::await_holding_invalid::AwaitHolding::new(tcx, conf)), + ManualBitWidth: is_lint_pass_required(skippable_lints, ManualBitWidth_LINTS).then(|| ::clippy_lints::bit_width::ManualBitWidth::new(conf)), + BlockScrutinee: is_lint_pass_required(skippable_lints, BlockScrutinee_LINTS).then_some(::clippy_lints::block_scrutinee::BlockScrutinee), + BlocksInConditions: is_lint_pass_required(skippable_lints, BlocksInConditions_LINTS).then_some(::clippy_lints::blocks_in_conditions::BlocksInConditions), + BoolAssertComparison: is_lint_pass_required(skippable_lints, BoolAssertComparison_LINTS).then_some(::clippy_lints::bool_assert_comparison::BoolAssertComparison), + BoolComparison: is_lint_pass_required(skippable_lints, BoolComparison_LINTS).then_some(::clippy_lints::bool_comparison::BoolComparison), + BoolToIntWithIf: is_lint_pass_required(skippable_lints, BoolToIntWithIf_LINTS).then_some(::clippy_lints::bool_to_int_with_if::BoolToIntWithIf), + NonminimalBool: is_lint_pass_required(skippable_lints, NonminimalBool_LINTS).then(|| ::clippy_lints::booleans::NonminimalBool::new(conf)), + BorrowDerefRef: is_lint_pass_required(skippable_lints, BorrowDerefRef_LINTS).then_some(::clippy_lints::borrow_deref_ref::BorrowDerefRef), + BoxDefault: is_lint_pass_required(skippable_lints, BoxDefault_LINTS).then_some(::clippy_lints::box_default::BoxDefault), + ByteCharSlice: is_lint_pass_required(skippable_lints, ByteCharSlice_LINTS).then_some(::clippy_lints::byte_char_slices::ByteCharSlice), + Cargo: is_lint_pass_required(skippable_lints, Cargo_LINTS).then(|| ::clippy_lints::cargo::Cargo::new(conf)), + Casts: is_lint_pass_required(skippable_lints, Casts_LINTS).then(|| ::clippy_lints::casts::Casts::new(conf)), + CheckedConversions: is_lint_pass_required(skippable_lints, CheckedConversions_LINTS).then(|| ::clippy_lints::checked_conversions::CheckedConversions::new(conf)), + ClonedRefToSliceRefs: is_lint_pass_required(skippable_lints, ClonedRefToSliceRefs_LINTS).then(|| ::clippy_lints::cloned_ref_to_slice_refs::ClonedRefToSliceRefs::new(conf)), + CoerceContainerToAny: is_lint_pass_required(skippable_lints, CoerceContainerToAny_LINTS).then_some(::clippy_lints::coerce_container_to_any::CoerceContainerToAny), + CognitiveComplexity: is_lint_pass_required(skippable_lints, CognitiveComplexity_LINTS).then(|| ::clippy_lints::cognitive_complexity::CognitiveComplexity::new(conf)), + CollapsibleIf: is_lint_pass_required(skippable_lints, CollapsibleIf_LINTS).then(|| ::clippy_lints::collapsible_if::CollapsibleIf::new(conf)), + CollectionIsNeverRead: is_lint_pass_required(skippable_lints, CollectionIsNeverRead_LINTS).then_some(::clippy_lints::collection_is_never_read::CollectionIsNeverRead), + ComparisonChain: is_lint_pass_required(skippable_lints, ComparisonChain_LINTS).then_some(::clippy_lints::comparison_chain::ComparisonChain), + CopyIterator: is_lint_pass_required(skippable_lints, CopyIterator_LINTS).then_some(::clippy_lints::copy_iterator::CopyIterator), + CreateDir: is_lint_pass_required(skippable_lints, CreateDir_LINTS).then_some(::clippy_lints::create_dir::CreateDir), + DbgMacro: is_lint_pass_required(skippable_lints, DbgMacro_LINTS).then(|| ::clippy_lints::dbg_macro::DbgMacro::new(conf)), + Default: is_lint_pass_required(skippable_lints, Default_LINTS).then(::clippy_lints::default::Default::default), + DefaultConstructedUnitStructs: is_lint_pass_required(skippable_lints, DefaultConstructedUnitStructs_LINTS).then_some(::clippy_lints::default_constructed_unit_structs::DefaultConstructedUnitStructs), + DefaultIterEmpty: is_lint_pass_required(skippable_lints, DefaultIterEmpty_LINTS).then_some(::clippy_lints::default_instead_of_iter_empty::DefaultIterEmpty), + DefaultNumericFallback: is_lint_pass_required(skippable_lints, DefaultNumericFallback_LINTS).then_some(::clippy_lints::default_numeric_fallback::DefaultNumericFallback), + DefaultUnionRepresentation: is_lint_pass_required(skippable_lints, DefaultUnionRepresentation_LINTS).then_some(::clippy_lints::default_union_representation::DefaultUnionRepresentation), + Dereferencing: is_lint_pass_required(skippable_lints, Dereferencing_LINTS).then(::clippy_lints::dereference::Dereferencing::default), + DerivableImpls: is_lint_pass_required(skippable_lints, DerivableImpls_LINTS).then(|| ::clippy_lints::derivable_impls::DerivableImpls::new(conf)), + Derive: is_lint_pass_required(skippable_lints, Derive_LINTS).then_some(::clippy_lints::derive::Derive), + DisallowedFields: is_lint_pass_required(skippable_lints, DisallowedFields_LINTS).then(|| ::clippy_lints::disallowed_fields::DisallowedFields::new(tcx, conf)), + DisallowedMacros: is_lint_pass_required(skippable_lints, DisallowedMacros_LINTS).then(|| ::clippy_lints::disallowed_macros::DisallowedMacros::new(tcx, conf, attrs.clone())), + DisallowedMethods: is_lint_pass_required(skippable_lints, DisallowedMethods_LINTS).then(|| ::clippy_lints::disallowed_methods::DisallowedMethods::new(tcx, conf)), + DisallowedNames: is_lint_pass_required(skippable_lints, DisallowedNames_LINTS).then(|| ::clippy_lints::disallowed_names::DisallowedNames::new(conf)), + DisallowedTypes: is_lint_pass_required(skippable_lints, DisallowedTypes_LINTS).then(|| ::clippy_lints::disallowed_types::DisallowedTypes::new(tcx, conf)), + Documentation: is_lint_pass_required(skippable_lints, Documentation_LINTS).then(|| ::clippy_lints::doc::Documentation::new(conf)), + DropForgetRef: is_lint_pass_required(skippable_lints, DropForgetRef_LINTS).then_some(::clippy_lints::drop_forget_ref::DropForgetRef), + DurationSuboptimalUnits: is_lint_pass_required(skippable_lints, DurationSuboptimalUnits_LINTS).then(|| ::clippy_lints::duration_suboptimal_units::DurationSuboptimalUnits::new(tcx, conf)), + EmptyDrop: is_lint_pass_required(skippable_lints, EmptyDrop_LINTS).then_some(::clippy_lints::empty_drop::EmptyDrop), + EmptyEnums: is_lint_pass_required(skippable_lints, EmptyEnums_LINTS).then_some(::clippy_lints::empty_enums::EmptyEnums), + EmptyWithBrackets: is_lint_pass_required(skippable_lints, EmptyWithBrackets_LINTS).then(::clippy_lints::empty_with_brackets::EmptyWithBrackets::default), + EndianBytes: is_lint_pass_required(skippable_lints, EndianBytes_LINTS).then_some(::clippy_lints::endian_bytes::EndianBytes), + HashMapPass: is_lint_pass_required(skippable_lints, HashMapPass_LINTS).then_some(::clippy_lints::entry::HashMapPass), + UnportableVariant: is_lint_pass_required(skippable_lints, UnportableVariant_LINTS).then_some(::clippy_lints::enum_clike::UnportableVariant), + PatternEquality: is_lint_pass_required(skippable_lints, PatternEquality_LINTS).then_some(::clippy_lints::equatable_if_let::PatternEquality), + ErrorImplError: is_lint_pass_required(skippable_lints, ErrorImplError_LINTS).then_some(::clippy_lints::error_impl_error::ErrorImplError), + BoxedLocal: is_lint_pass_required(skippable_lints, BoxedLocal_LINTS).then(|| ::clippy_lints::escape::BoxedLocal::new(conf)), + EtaReduction: is_lint_pass_required(skippable_lints, EtaReduction_LINTS).then_some(::clippy_lints::eta_reduction::EtaReduction), + ExcessiveBools: is_lint_pass_required(skippable_lints, ExcessiveBools_LINTS).then(|| ::clippy_lints::excessive_bools::ExcessiveBools::new(conf)), + ExhaustiveItems: is_lint_pass_required(skippable_lints, ExhaustiveItems_LINTS).then_some(::clippy_lints::exhaustive_items::ExhaustiveItems), + Exit: is_lint_pass_required(skippable_lints, Exit_LINTS).then_some(::clippy_lints::exit::Exit), + ExplicitWrite: is_lint_pass_required(skippable_lints, ExplicitWrite_LINTS).then(|| ::clippy_lints::explicit_write::ExplicitWrite::new(fmt_args.clone())), + ExtraUnusedTypeParameters: is_lint_pass_required(skippable_lints, ExtraUnusedTypeParameters_LINTS).then(|| ::clippy_lints::extra_unused_type_parameters::ExtraUnusedTypeParameters::new(conf)), + FallibleImplFrom: is_lint_pass_required(skippable_lints, FallibleImplFrom_LINTS).then_some(::clippy_lints::fallible_impl_from::FallibleImplFrom), + FloatLiteral: is_lint_pass_required(skippable_lints, FloatLiteral_LINTS).then(|| ::clippy_lints::float_literal::FloatLiteral::new(conf)), + FloatingPointArithmetic: is_lint_pass_required(skippable_lints, FloatingPointArithmetic_LINTS).then_some(::clippy_lints::floating_point_arithmetic::FloatingPointArithmetic), + UselessFormat: is_lint_pass_required(skippable_lints, UselessFormat_LINTS).then(|| ::clippy_lints::format::UselessFormat::new(fmt_args.clone())), + FormatArgs: is_lint_pass_required(skippable_lints, FormatArgs_LINTS).then(|| ::clippy_lints::format_args::FormatArgs::new(tcx, conf, fmt_args.clone())), + FormatImpl: is_lint_pass_required(skippable_lints, FormatImpl_LINTS).then(|| ::clippy_lints::format_impl::FormatImpl::new(fmt_args.clone())), + FormatPushString: is_lint_pass_required(skippable_lints, FormatPushString_LINTS).then(|| ::clippy_lints::format_push_string::FormatPushString::new(fmt_args.clone())), + FourForwardSlashes: is_lint_pass_required(skippable_lints, FourForwardSlashes_LINTS).then_some(::clippy_lints::four_forward_slashes::FourForwardSlashes), + FromOverInto: is_lint_pass_required(skippable_lints, FromOverInto_LINTS).then(|| ::clippy_lints::from_over_into::FromOverInto::new(conf)), + FromRawWithVoidPtr: is_lint_pass_required(skippable_lints, FromRawWithVoidPtr_LINTS).then_some(::clippy_lints::from_raw_with_void_ptr::FromRawWithVoidPtr), + FromStrRadix10: is_lint_pass_required(skippable_lints, FromStrRadix10_LINTS).then_some(::clippy_lints::from_str_radix_10::FromStrRadix10), + Functions: is_lint_pass_required(skippable_lints, Functions_LINTS).then(|| ::clippy_lints::functions::Functions::new(tcx, conf)), + FutureNotSend: is_lint_pass_required(skippable_lints, FutureNotSend_LINTS).then_some(::clippy_lints::future_not_send::FutureNotSend), + IfLetMutex: is_lint_pass_required(skippable_lints, IfLetMutex_LINTS).then_some(::clippy_lints::if_let_mutex::IfLetMutex), + IfNotElse: is_lint_pass_required(skippable_lints, IfNotElse_LINTS).then_some(::clippy_lints::if_not_else::IfNotElse), + IfThenSomeElseNone: is_lint_pass_required(skippable_lints, IfThenSomeElseNone_LINTS).then(|| ::clippy_lints::if_then_some_else_none::IfThenSomeElseNone::new(conf)), + CopyAndPaste: is_lint_pass_required(skippable_lints, CopyAndPaste_LINTS).then(|| ::clippy_lints::ifs::CopyAndPaste::new(tcx, conf)), + IgnoredUnitPatterns: is_lint_pass_required(skippable_lints, IgnoredUnitPatterns_LINTS).then_some(::clippy_lints::ignored_unit_patterns::IgnoredUnitPatterns), + ImplHashWithBorrowStrBytes: is_lint_pass_required(skippable_lints, ImplHashWithBorrowStrBytes_LINTS).then_some(::clippy_lints::impl_hash_with_borrow_str_and_bytes::ImplHashWithBorrowStrBytes), + ImplicitHasher: is_lint_pass_required(skippable_lints, ImplicitHasher_LINTS).then_some(::clippy_lints::implicit_hasher::ImplicitHasher), + ImplicitReturn: is_lint_pass_required(skippable_lints, ImplicitReturn_LINTS).then_some(::clippy_lints::implicit_return::ImplicitReturn), + ImplicitSaturatingAdd: is_lint_pass_required(skippable_lints, ImplicitSaturatingAdd_LINTS).then_some(::clippy_lints::implicit_saturating_add::ImplicitSaturatingAdd), + ImplicitSaturatingSub: is_lint_pass_required(skippable_lints, ImplicitSaturatingSub_LINTS).then(|| ::clippy_lints::implicit_saturating_sub::ImplicitSaturatingSub::new(conf)), + ImpliedBoundsInImpls: is_lint_pass_required(skippable_lints, ImpliedBoundsInImpls_LINTS).then_some(::clippy_lints::implied_bounds_in_impls::ImpliedBoundsInImpls), + IncompatibleMsrv: is_lint_pass_required(skippable_lints, IncompatibleMsrv_LINTS).then(|| ::clippy_lints::incompatible_msrv::IncompatibleMsrv::new(tcx, conf)), + InconsistentStructConstructor: is_lint_pass_required(skippable_lints, InconsistentStructConstructor_LINTS).then(|| ::clippy_lints::inconsistent_struct_constructor::InconsistentStructConstructor::new(conf)), + IndexRefutableSlice: is_lint_pass_required(skippable_lints, IndexRefutableSlice_LINTS).then(|| ::clippy_lints::index_refutable_slice::IndexRefutableSlice::new(conf)), + IndexingSlicing: is_lint_pass_required(skippable_lints, IndexingSlicing_LINTS).then(|| ::clippy_lints::indexing_slicing::IndexingSlicing::new(conf)), + IneffectiveOpenOptions: is_lint_pass_required(skippable_lints, IneffectiveOpenOptions_LINTS).then_some(::clippy_lints::ineffective_open_options::IneffectiveOpenOptions), + InfallibleTryFrom: is_lint_pass_required(skippable_lints, InfallibleTryFrom_LINTS).then_some(::clippy_lints::infallible_try_from::InfallibleTryFrom), + InfiniteIter: is_lint_pass_required(skippable_lints, InfiniteIter_LINTS).then_some(::clippy_lints::infinite_iter::InfiniteIter), + MultipleInherentImpl: is_lint_pass_required(skippable_lints, MultipleInherentImpl_LINTS).then(|| ::clippy_lints::inherent_impl::MultipleInherentImpl::new(conf)), + InherentToString: is_lint_pass_required(skippable_lints, InherentToString_LINTS).then_some(::clippy_lints::inherent_to_string::InherentToString), + NumberedFields: is_lint_pass_required(skippable_lints, NumberedFields_LINTS).then_some(::clippy_lints::init_numbered_fields::NumberedFields), + InlineFnWithoutBody: is_lint_pass_required(skippable_lints, InlineFnWithoutBody_LINTS).then_some(::clippy_lints::inline_fn_without_body::InlineFnWithoutBody), + ItemNameRepetitions: is_lint_pass_required(skippable_lints, ItemNameRepetitions_LINTS).then(|| ::clippy_lints::item_name_repetitions::ItemNameRepetitions::new(conf)), + ItemsAfterStatements: is_lint_pass_required(skippable_lints, ItemsAfterStatements_LINTS).then_some(::clippy_lints::items_after_statements::ItemsAfterStatements), + ItemsAfterTestModule: is_lint_pass_required(skippable_lints, ItemsAfterTestModule_LINTS).then_some(::clippy_lints::items_after_test_module::ItemsAfterTestModule), + IterNotReturningIterator: is_lint_pass_required(skippable_lints, IterNotReturningIterator_LINTS).then_some(::clippy_lints::iter_not_returning_iterator::IterNotReturningIterator), + IterOverHashType: is_lint_pass_required(skippable_lints, IterOverHashType_LINTS).then_some(::clippy_lints::iter_over_hash_type::IterOverHashType), + IterWithoutIntoIter: is_lint_pass_required(skippable_lints, IterWithoutIntoIter_LINTS).then_some(::clippy_lints::iter_without_into_iter::IterWithoutIntoIter), + LargeConstArrays: is_lint_pass_required(skippable_lints, LargeConstArrays_LINTS).then(|| ::clippy_lints::large_const_arrays::LargeConstArrays::new(conf)), + LargeEnumVariant: is_lint_pass_required(skippable_lints, LargeEnumVariant_LINTS).then(|| ::clippy_lints::large_enum_variant::LargeEnumVariant::new(conf)), + LargeFuture: is_lint_pass_required(skippable_lints, LargeFuture_LINTS).then(|| ::clippy_lints::large_futures::LargeFuture::new(conf)), + LargeIncludeFile: is_lint_pass_required(skippable_lints, LargeIncludeFile_LINTS).then(|| ::clippy_lints::large_include_file::LargeIncludeFile::new(conf)), + LargeStackArrays: is_lint_pass_required(skippable_lints, LargeStackArrays_LINTS).then(|| ::clippy_lints::large_stack_arrays::LargeStackArrays::new(conf)), + LargeStackFrames: is_lint_pass_required(skippable_lints, LargeStackFrames_LINTS).then(|| ::clippy_lints::large_stack_frames::LargeStackFrames::new(conf)), + LegacyNumericConstants: is_lint_pass_required(skippable_lints, LegacyNumericConstants_LINTS).then(|| ::clippy_lints::legacy_numeric_constants::LegacyNumericConstants::new(conf)), + LenWithoutIsEmpty: is_lint_pass_required(skippable_lints, LenWithoutIsEmpty_LINTS).then_some(::clippy_lints::len_without_is_empty::LenWithoutIsEmpty), + LenZero: is_lint_pass_required(skippable_lints, LenZero_LINTS).then(|| ::clippy_lints::len_zero::LenZero::new(conf)), + LetIfSeq: is_lint_pass_required(skippable_lints, LetIfSeq_LINTS).then_some(::clippy_lints::let_if_seq::LetIfSeq), + LetUnderscore: is_lint_pass_required(skippable_lints, LetUnderscore_LINTS).then_some(::clippy_lints::let_underscore::LetUnderscore), + Lifetimes: is_lint_pass_required(skippable_lints, Lifetimes_LINTS).then(|| ::clippy_lints::lifetimes::Lifetimes::new(conf)), + LiteralStringWithFormattingArg: is_lint_pass_required(skippable_lints, LiteralStringWithFormattingArg_LINTS).then_some(::clippy_lints::literal_string_with_formatting_args::LiteralStringWithFormattingArg), + Loops: is_lint_pass_required(skippable_lints, Loops_LINTS).then(|| ::clippy_lints::loops::Loops::new(conf)), + ExprMetavarsInUnsafe: is_lint_pass_required(skippable_lints, ExprMetavarsInUnsafe_LINTS).then(|| ::clippy_lints::macro_metavars_in_unsafe::ExprMetavarsInUnsafe::new(conf)), + MacroUseImports: is_lint_pass_required(skippable_lints, MacroUseImports_LINTS).then(::clippy_lints::macro_use::MacroUseImports::default), + MainRecursion: is_lint_pass_required(skippable_lints, MainRecursion_LINTS).then(::clippy_lints::main_recursion::MainRecursion::default), + ManualAbsDiff: is_lint_pass_required(skippable_lints, ManualAbsDiff_LINTS).then(|| ::clippy_lints::manual_abs_diff::ManualAbsDiff::new(conf)), + ManualAssert: is_lint_pass_required(skippable_lints, ManualAssert_LINTS).then_some(::clippy_lints::manual_assert::ManualAssert), + ManualAssertEq: is_lint_pass_required(skippable_lints, ManualAssertEq_LINTS).then_some(::clippy_lints::manual_assert_eq::ManualAssertEq), + ManualAsyncFn: is_lint_pass_required(skippable_lints, ManualAsyncFn_LINTS).then_some(::clippy_lints::manual_async_fn::ManualAsyncFn), + ManualBits: is_lint_pass_required(skippable_lints, ManualBits_LINTS).then(|| ::clippy_lints::manual_bits::ManualBits::new(conf)), + ManualCheckedOps: is_lint_pass_required(skippable_lints, ManualCheckedOps_LINTS).then_some(::clippy_lints::manual_checked_ops::ManualCheckedOps), + ManualClamp: is_lint_pass_required(skippable_lints, ManualClamp_LINTS).then(|| ::clippy_lints::manual_clamp::ManualClamp::new(conf)), + ManualFloatMethods: is_lint_pass_required(skippable_lints, ManualFloatMethods_LINTS).then(|| ::clippy_lints::manual_float_methods::ManualFloatMethods::new(conf)), + ManualHashOne: is_lint_pass_required(skippable_lints, ManualHashOne_LINTS).then(|| ::clippy_lints::manual_hash_one::ManualHashOne::new(conf)), + ManualIgnoreCaseCmp: is_lint_pass_required(skippable_lints, ManualIgnoreCaseCmp_LINTS).then_some(::clippy_lints::manual_ignore_case_cmp::ManualIgnoreCaseCmp), + ManualIlog2: is_lint_pass_required(skippable_lints, ManualIlog2_LINTS).then(|| ::clippy_lints::manual_ilog2::ManualIlog2::new(conf)), + ManualIsAsciiCheck: is_lint_pass_required(skippable_lints, ManualIsAsciiCheck_LINTS).then(|| ::clippy_lints::manual_is_ascii_check::ManualIsAsciiCheck::new(conf)), + ManualIsPowerOfTwo: is_lint_pass_required(skippable_lints, ManualIsPowerOfTwo_LINTS).then(|| ::clippy_lints::manual_is_power_of_two::ManualIsPowerOfTwo::new(conf)), + ManualMainSeparatorStr: is_lint_pass_required(skippable_lints, ManualMainSeparatorStr_LINTS).then(|| ::clippy_lints::manual_main_separator_str::ManualMainSeparatorStr::new(conf)), + ManualNonExhaustive: is_lint_pass_required(skippable_lints, ManualNonExhaustive_LINTS).then(|| ::clippy_lints::manual_non_exhaustive::ManualNonExhaustive::new(conf)), + ManualNoopWaker: is_lint_pass_required(skippable_lints, ManualNoopWaker_LINTS).then(|| ::clippy_lints::manual_noop_waker::ManualNoopWaker::new(conf)), + ManualOptionAsSlice: is_lint_pass_required(skippable_lints, ManualOptionAsSlice_LINTS).then(|| ::clippy_lints::manual_option_as_slice::ManualOptionAsSlice::new(conf)), + ManualPopIf: is_lint_pass_required(skippable_lints, ManualPopIf_LINTS).then(|| ::clippy_lints::manual_pop_if::ManualPopIf::new(tcx, conf)), + ManualRangePatterns: is_lint_pass_required(skippable_lints, ManualRangePatterns_LINTS).then_some(::clippy_lints::manual_range_patterns::ManualRangePatterns), + ManualRemEuclid: is_lint_pass_required(skippable_lints, ManualRemEuclid_LINTS).then(|| ::clippy_lints::manual_rem_euclid::ManualRemEuclid::new(conf)), + ManualRetain: is_lint_pass_required(skippable_lints, ManualRetain_LINTS).then(|| ::clippy_lints::manual_retain::ManualRetain::new(conf)), + ManualRotate: is_lint_pass_required(skippable_lints, ManualRotate_LINTS).then_some(::clippy_lints::manual_rotate::ManualRotate), + ManualSliceSizeCalculation: is_lint_pass_required(skippable_lints, ManualSliceSizeCalculation_LINTS).then(|| ::clippy_lints::manual_slice_size_calculation::ManualSliceSizeCalculation::new(conf)), + ManualStringNew: is_lint_pass_required(skippable_lints, ManualStringNew_LINTS).then_some(::clippy_lints::manual_string_new::ManualStringNew), + ManualStrip: is_lint_pass_required(skippable_lints, ManualStrip_LINTS).then(|| ::clippy_lints::manual_strip::ManualStrip::new(conf)), + ManualTake: is_lint_pass_required(skippable_lints, ManualTake_LINTS).then(|| ::clippy_lints::manual_take::ManualTake::new(conf)), + MapUnit: is_lint_pass_required(skippable_lints, MapUnit_LINTS).then_some(::clippy_lints::map_unit_fn::MapUnit), + MatchResultOk: is_lint_pass_required(skippable_lints, MatchResultOk_LINTS).then_some(::clippy_lints::match_result_ok::MatchResultOk), + Matches: is_lint_pass_required(skippable_lints, Matches_LINTS).then(|| ::clippy_lints::matches::Matches::new(conf)), + MemReplace: is_lint_pass_required(skippable_lints, MemReplace_LINTS).then(|| ::clippy_lints::mem_replace::MemReplace::new(conf)), + Methods: is_lint_pass_required(skippable_lints, Methods_LINTS).then(|| ::clippy_lints::methods::Methods::new(conf, fmt_args.clone())), + MinIdentChars: is_lint_pass_required(skippable_lints, MinIdentChars_LINTS).then(|| ::clippy_lints::min_ident_chars::MinIdentChars::new(conf)), + MinMaxPass: is_lint_pass_required(skippable_lints, MinMaxPass_LINTS).then_some(::clippy_lints::minmax::MinMaxPass), + LintPass: is_lint_pass_required(skippable_lints, LintPass_LINTS).then_some(::clippy_lints::misc::LintPass), + TypeParamMismatch: is_lint_pass_required(skippable_lints, TypeParamMismatch_LINTS).then_some(::clippy_lints::mismatching_type_param_order::TypeParamMismatch), + MissingAssertMessage: is_lint_pass_required(skippable_lints, MissingAssertMessage_LINTS).then_some(::clippy_lints::missing_assert_message::MissingAssertMessage), + MissingAssertsForIndexing: is_lint_pass_required(skippable_lints, MissingAssertsForIndexing_LINTS).then_some(::clippy_lints::missing_asserts_for_indexing::MissingAssertsForIndexing), + MissingConstForFn: is_lint_pass_required(skippable_lints, MissingConstForFn_LINTS).then(|| ::clippy_lints::missing_const_for_fn::MissingConstForFn::new(conf)), + MissingConstForThreadLocal: is_lint_pass_required(skippable_lints, MissingConstForThreadLocal_LINTS).then(|| ::clippy_lints::missing_const_for_thread_local::MissingConstForThreadLocal::new(conf)), + MissingDoc: is_lint_pass_required(skippable_lints, MissingDoc_LINTS).then(|| ::clippy_lints::missing_doc::MissingDoc::new(conf)), + ImportRename: is_lint_pass_required(skippable_lints, ImportRename_LINTS).then(|| ::clippy_lints::missing_enforced_import_rename::ImportRename::new(tcx, conf)), + MissingFieldsInDebug: is_lint_pass_required(skippable_lints, MissingFieldsInDebug_LINTS).then_some(::clippy_lints::missing_fields_in_debug::MissingFieldsInDebug), + MissingInline: is_lint_pass_required(skippable_lints, MissingInline_LINTS).then_some(::clippy_lints::missing_inline::MissingInline), + MissingTraitMethods: is_lint_pass_required(skippable_lints, MissingTraitMethods_LINTS).then(|| ::clippy_lints::missing_trait_methods::MissingTraitMethods::new(conf)), + EvalOrderDependence: is_lint_pass_required(skippable_lints, EvalOrderDependence_LINTS).then_some(::clippy_lints::mixed_read_write_in_expression::EvalOrderDependence), + MultipleUnsafeOpsPerBlock: is_lint_pass_required(skippable_lints, MultipleUnsafeOpsPerBlock_LINTS).then_some(::clippy_lints::multiple_unsafe_ops_per_block::MultipleUnsafeOpsPerBlock), + MutableKeyType: is_lint_pass_required(skippable_lints, MutableKeyType_LINTS).then(|| ::clippy_lints::mut_key::MutableKeyType::new(tcx, conf)), + MutMut: is_lint_pass_required(skippable_lints, MutMut_LINTS).then(::clippy_lints::mut_mut::MutMut::default), + DebugAssertWithMutCall: is_lint_pass_required(skippable_lints, DebugAssertWithMutCall_LINTS).then_some(::clippy_lints::mutable_debug_assertion::DebugAssertWithMutCall), + Mutex: is_lint_pass_required(skippable_lints, Mutex_LINTS).then_some(::clippy_lints::mutex_atomic::Mutex), + NeedlessBool: is_lint_pass_required(skippable_lints, NeedlessBool_LINTS).then_some(::clippy_lints::needless_bool::NeedlessBool), + NeedlessBorrowedRef: is_lint_pass_required(skippable_lints, NeedlessBorrowedRef_LINTS).then_some(::clippy_lints::needless_borrowed_ref::NeedlessBorrowedRef), + NeedlessBorrowsForGenericArgs: is_lint_pass_required(skippable_lints, NeedlessBorrowsForGenericArgs_LINTS).then(|| ::clippy_lints::needless_borrows_for_generic_args::NeedlessBorrowsForGenericArgs::new(conf)), + NeedlessContinue: is_lint_pass_required(skippable_lints, NeedlessContinue_LINTS).then_some(::clippy_lints::needless_continue::NeedlessContinue), + NeedlessForEach: is_lint_pass_required(skippable_lints, NeedlessForEach_LINTS).then_some(::clippy_lints::needless_for_each::NeedlessForEach), + NeedlessIfs: is_lint_pass_required(skippable_lints, NeedlessIfs_LINTS).then_some(::clippy_lints::needless_ifs::NeedlessIfs), + NeedlessLateInit: is_lint_pass_required(skippable_lints, NeedlessLateInit_LINTS).then(|| ::clippy_lints::needless_late_init::NeedlessLateInit::new(conf)), + NeedlessMaybeSized: is_lint_pass_required(skippable_lints, NeedlessMaybeSized_LINTS).then_some(::clippy_lints::needless_maybe_sized::NeedlessMaybeSized), + NeedlessNonzeroGet: is_lint_pass_required(skippable_lints, NeedlessNonzeroGet_LINTS).then(|| ::clippy_lints::needless_nonzero_get::NeedlessNonzeroGet::new(conf)), + NeedlessParensOnRangeLiterals: is_lint_pass_required(skippable_lints, NeedlessParensOnRangeLiterals_LINTS).then_some(::clippy_lints::needless_parens_on_range_literals::NeedlessParensOnRangeLiterals), + NeedlessPassByRefMut: is_lint_pass_required(skippable_lints, NeedlessPassByRefMut_LINTS).then(|| ::clippy_lints::needless_pass_by_ref_mut::NeedlessPassByRefMut::new(conf)), + NeedlessPassByValue: is_lint_pass_required(skippable_lints, NeedlessPassByValue_LINTS).then_some(::clippy_lints::needless_pass_by_value::NeedlessPassByValue), + NeedlessQuestionMark: is_lint_pass_required(skippable_lints, NeedlessQuestionMark_LINTS).then_some(::clippy_lints::needless_question_mark::NeedlessQuestionMark), + NeedlessUpdate: is_lint_pass_required(skippable_lints, NeedlessUpdate_LINTS).then_some(::clippy_lints::needless_update::NeedlessUpdate), + NoNegCompOpForPartialOrd: is_lint_pass_required(skippable_lints, NoNegCompOpForPartialOrd_LINTS).then_some(::clippy_lints::neg_cmp_op_on_partial_ord::NoNegCompOpForPartialOrd), + NegMultiply: is_lint_pass_required(skippable_lints, NegMultiply_LINTS).then_some(::clippy_lints::neg_multiply::NegMultiply), + NewWithoutDefault: is_lint_pass_required(skippable_lints, NewWithoutDefault_LINTS).then(::clippy_lints::new_without_default::NewWithoutDefault::default), + NoEffect: is_lint_pass_required(skippable_lints, NoEffect_LINTS).then(::clippy_lints::no_effect::NoEffect::default), + NoMangleWithRustAbi: is_lint_pass_required(skippable_lints, NoMangleWithRustAbi_LINTS).then_some(::clippy_lints::no_mangle_with_rust_abi::NoMangleWithRustAbi), + NonCanonicalImpls: is_lint_pass_required(skippable_lints, NonCanonicalImpls_LINTS).then(|| ::clippy_lints::non_canonical_impls::NonCanonicalImpls::new(tcx)), + NonCopyConst: is_lint_pass_required(skippable_lints, NonCopyConst_LINTS).then(|| ::clippy_lints::non_copy_const::NonCopyConst::new(tcx, conf)), + NonOctalUnixPermissions: is_lint_pass_required(skippable_lints, NonOctalUnixPermissions_LINTS).then_some(::clippy_lints::non_octal_unix_permissions::NonOctalUnixPermissions), + NonSendFieldInSendTy: is_lint_pass_required(skippable_lints, NonSendFieldInSendTy_LINTS).then(|| ::clippy_lints::non_send_fields_in_send_ty::NonSendFieldInSendTy::new(conf)), + NonStdLazyStatic: is_lint_pass_required(skippable_lints, NonStdLazyStatic_LINTS).then(|| ::clippy_lints::non_std_lazy_statics::NonStdLazyStatic::new(conf)), + NonZeroSuggestions: is_lint_pass_required(skippable_lints, NonZeroSuggestions_LINTS).then_some(::clippy_lints::non_zero_suggestions::NonZeroSuggestions), + NonnullUncheckedOnBoxPtr: is_lint_pass_required(skippable_lints, NonnullUncheckedOnBoxPtr_LINTS).then(|| ::clippy_lints::nonnull_unchecked_on_box_ptr::NonnullUncheckedOnBoxPtr::new(conf)), + OnlyUsedInRecursion: is_lint_pass_required(skippable_lints, OnlyUsedInRecursion_LINTS).then(::clippy_lints::only_used_in_recursion::OnlyUsedInRecursion::default), + Operators: is_lint_pass_required(skippable_lints, Operators_LINTS).then(|| ::clippy_lints::operators::Operators::new(conf)), + ArithmeticSideEffects: is_lint_pass_required(skippable_lints, ArithmeticSideEffects_LINTS).then(|| ::clippy_lints::operators::arithmetic_side_effects::ArithmeticSideEffects::new(conf)), + OptionIfLetElse: is_lint_pass_required(skippable_lints, OptionIfLetElse_LINTS).then_some(::clippy_lints::option_if_let_else::OptionIfLetElse), + PanicInResultFn: is_lint_pass_required(skippable_lints, PanicInResultFn_LINTS).then_some(::clippy_lints::panic_in_result_fn::PanicInResultFn), + PanicUnimplemented: is_lint_pass_required(skippable_lints, PanicUnimplemented_LINTS).then(|| ::clippy_lints::panic_unimplemented::PanicUnimplemented::new(conf)), + PanickingOverflowChecks: is_lint_pass_required(skippable_lints, PanickingOverflowChecks_LINTS).then_some(::clippy_lints::panicking_overflow_checks::PanickingOverflowChecks), + PartialEqNeImpl: is_lint_pass_required(skippable_lints, PartialEqNeImpl_LINTS).then_some(::clippy_lints::partialeq_ne_impl::PartialEqNeImpl), + PartialeqToNone: is_lint_pass_required(skippable_lints, PartialeqToNone_LINTS).then_some(::clippy_lints::partialeq_to_none::PartialeqToNone), + PassByRefOrValue: is_lint_pass_required(skippable_lints, PassByRefOrValue_LINTS).then(|| ::clippy_lints::pass_by_ref_or_value::PassByRefOrValue::new(tcx, conf)), + PathbufThenPush: is_lint_pass_required(skippable_lints, PathbufThenPush_LINTS).then(::clippy_lints::pathbuf_init_then_push::PathbufThenPush::default), + PatternTypeMismatch: is_lint_pass_required(skippable_lints, PatternTypeMismatch_LINTS).then_some(::clippy_lints::pattern_type_mismatch::PatternTypeMismatch), + PermissionsSetReadonlyFalse: is_lint_pass_required(skippable_lints, PermissionsSetReadonlyFalse_LINTS).then_some(::clippy_lints::permissions_set_readonly_false::PermissionsSetReadonlyFalse), + PointersInNomemAsmBlock: is_lint_pass_required(skippable_lints, PointersInNomemAsmBlock_LINTS).then_some(::clippy_lints::pointers_in_nomem_asm_block::PointersInNomemAsmBlock), + Ptr: is_lint_pass_required(skippable_lints, Ptr_LINTS).then_some(::clippy_lints::ptr::Ptr), + PubUnderscoreFields: is_lint_pass_required(skippable_lints, PubUnderscoreFields_LINTS).then(|| ::clippy_lints::pub_underscore_fields::PubUnderscoreFields::new(conf)), + QuestionMark: is_lint_pass_required(skippable_lints, QuestionMark_LINTS).then(|| ::clippy_lints::question_mark::QuestionMark::new(conf)), + QuestionMarkUsed: is_lint_pass_required(skippable_lints, QuestionMarkUsed_LINTS).then_some(::clippy_lints::question_mark_used::QuestionMarkUsed), + Ranges: is_lint_pass_required(skippable_lints, Ranges_LINTS).then(|| ::clippy_lints::ranges::Ranges::new(conf)), + RcCloneInVecInit: is_lint_pass_required(skippable_lints, RcCloneInVecInit_LINTS).then_some(::clippy_lints::rc_clone_in_vec_init::RcCloneInVecInit), + ReadZeroByteVec: is_lint_pass_required(skippable_lints, ReadZeroByteVec_LINTS).then_some(::clippy_lints::read_zero_byte_vec::ReadZeroByteVec), + RedundantAsyncBlock: is_lint_pass_required(skippable_lints, RedundantAsyncBlock_LINTS).then_some(::clippy_lints::redundant_async_block::RedundantAsyncBlock), + RedundantClone: is_lint_pass_required(skippable_lints, RedundantClone_LINTS).then_some(::clippy_lints::redundant_clone::RedundantClone), + RedundantClosureCall: is_lint_pass_required(skippable_lints, RedundantClosureCall_LINTS).then_some(::clippy_lints::redundant_closure_call::RedundantClosureCall), + RedundantElse: is_lint_pass_required(skippable_lints, RedundantElse_LINTS).then_some(::clippy_lints::redundant_else::RedundantElse), + RedundantLocals: is_lint_pass_required(skippable_lints, RedundantLocals_LINTS).then_some(::clippy_lints::redundant_locals::RedundantLocals), + RedundantPubCrate: is_lint_pass_required(skippable_lints, RedundantPubCrate_LINTS).then(::clippy_lints::redundant_pub_crate::RedundantPubCrate::default), + RedundantSlicing: is_lint_pass_required(skippable_lints, RedundantSlicing_LINTS).then_some(::clippy_lints::redundant_slicing::RedundantSlicing), + RedundantTestPrefix: is_lint_pass_required(skippable_lints, RedundantTestPrefix_LINTS).then_some(::clippy_lints::redundant_test_prefix::RedundantTestPrefix), + RedundantTypeAnnotations: is_lint_pass_required(skippable_lints, RedundantTypeAnnotations_LINTS).then_some(::clippy_lints::redundant_type_annotations::RedundantTypeAnnotations), + RefOptionRef: is_lint_pass_required(skippable_lints, RefOptionRef_LINTS).then_some(::clippy_lints::ref_option_ref::RefOptionRef), + RefPatterns: is_lint_pass_required(skippable_lints, RefPatterns_LINTS).then_some(::clippy_lints::ref_patterns::RefPatterns), + DerefAddrOf: is_lint_pass_required(skippable_lints, DerefAddrOf_LINTS).then_some(::clippy_lints::reference::DerefAddrOf), + Regex: is_lint_pass_required(skippable_lints, Regex_LINTS).then(::clippy_lints::regex::Regex::default), + RepeatVecWithCapacity: is_lint_pass_required(skippable_lints, RepeatVecWithCapacity_LINTS).then(|| ::clippy_lints::repeat_vec_with_capacity::RepeatVecWithCapacity::new(conf)), + ReplaceBox: is_lint_pass_required(skippable_lints, ReplaceBox_LINTS).then(::clippy_lints::replace_box::ReplaceBox::default), + ReserveAfterInitialization: is_lint_pass_required(skippable_lints, ReserveAfterInitialization_LINTS).then(::clippy_lints::reserve_after_initialization::ReserveAfterInitialization::default), + RestWhenDestructuringStruct: is_lint_pass_required(skippable_lints, RestWhenDestructuringStruct_LINTS).then_some(::clippy_lints::rest_when_destructuring_struct::RestWhenDestructuringStruct), + ReturnSelfNotMustUse: is_lint_pass_required(skippable_lints, ReturnSelfNotMustUse_LINTS).then_some(::clippy_lints::return_self_not_must_use::ReturnSelfNotMustUse), + Return: is_lint_pass_required(skippable_lints, Return_LINTS).then_some(::clippy_lints::returns::Return), + SameLengthAndCapacity: is_lint_pass_required(skippable_lints, SameLengthAndCapacity_LINTS).then_some(::clippy_lints::same_length_and_capacity::SameLengthAndCapacity), + SameNameMethod: is_lint_pass_required(skippable_lints, SameNameMethod_LINTS).then_some(::clippy_lints::same_name_method::SameNameMethod), + SelfNamedConstructors: is_lint_pass_required(skippable_lints, SelfNamedConstructors_LINTS).then_some(::clippy_lints::self_named_constructors::SelfNamedConstructors), + SemicolonBlock: is_lint_pass_required(skippable_lints, SemicolonBlock_LINTS).then(|| ::clippy_lints::semicolon_block::SemicolonBlock::new(conf)), + SemicolonIfNothingReturned: is_lint_pass_required(skippable_lints, SemicolonIfNothingReturned_LINTS).then_some(::clippy_lints::semicolon_if_nothing_returned::SemicolonIfNothingReturned), + SerdeApi: is_lint_pass_required(skippable_lints, SerdeApi_LINTS).then_some(::clippy_lints::serde_api::SerdeApi), + SetContainsOrInsert: is_lint_pass_required(skippable_lints, SetContainsOrInsert_LINTS).then_some(::clippy_lints::set_contains_or_insert::SetContainsOrInsert), + Shadow: is_lint_pass_required(skippable_lints, Shadow_LINTS).then(::clippy_lints::shadow::Shadow::default), + SignificantDropTightening: is_lint_pass_required(skippable_lints, SignificantDropTightening_LINTS).then(::clippy_lints::significant_drop_tightening::SignificantDropTightening::default), + SingleCallFn: is_lint_pass_required(skippable_lints, SingleCallFn_LINTS).then(|| ::clippy_lints::single_call_fn::SingleCallFn::new(conf)), + SingleOptionMap: is_lint_pass_required(skippable_lints, SingleOptionMap_LINTS).then_some(::clippy_lints::single_option_map::SingleOptionMap), + SingleRangeInVecInit: is_lint_pass_required(skippable_lints, SingleRangeInVecInit_LINTS).then_some(::clippy_lints::single_range_in_vec_init::SingleRangeInVecInit), + SizeOfInElementCount: is_lint_pass_required(skippable_lints, SizeOfInElementCount_LINTS).then_some(::clippy_lints::size_of_in_element_count::SizeOfInElementCount), + SizeOfRef: is_lint_pass_required(skippable_lints, SizeOfRef_LINTS).then_some(::clippy_lints::size_of_ref::SizeOfRef), + SlowVectorInit: is_lint_pass_required(skippable_lints, SlowVectorInit_LINTS).then_some(::clippy_lints::slow_vector_initialization::SlowVectorInit), + StdReexports: is_lint_pass_required(skippable_lints, StdReexports_LINTS).then(|| ::clippy_lints::std_instead_of_core::StdReexports::new(conf)), + StringPatterns: is_lint_pass_required(skippable_lints, StringPatterns_LINTS).then(|| ::clippy_lints::string_patterns::StringPatterns::new(conf)), + StrToString: is_lint_pass_required(skippable_lints, StrToString_LINTS).then_some(::clippy_lints::strings::StrToString), + StringAdd: is_lint_pass_required(skippable_lints, StringAdd_LINTS).then_some(::clippy_lints::strings::StringAdd), + StringLitAsBytes: is_lint_pass_required(skippable_lints, StringLitAsBytes_LINTS).then_some(::clippy_lints::strings::StringLitAsBytes), + TrimSplitWhitespace: is_lint_pass_required(skippable_lints, TrimSplitWhitespace_LINTS).then_some(::clippy_lints::strings::TrimSplitWhitespace), + StrlenOnCStrings: is_lint_pass_required(skippable_lints, StrlenOnCStrings_LINTS).then(|| ::clippy_lints::strlen_on_c_strings::StrlenOnCStrings::new(conf)), + SuspiciousImpl: is_lint_pass_required(skippable_lints, SuspiciousImpl_LINTS).then_some(::clippy_lints::suspicious_trait_impl::SuspiciousImpl), + ConfusingXorAndPow: is_lint_pass_required(skippable_lints, ConfusingXorAndPow_LINTS).then_some(::clippy_lints::suspicious_xor_used_as_pow::ConfusingXorAndPow), + Swap: is_lint_pass_required(skippable_lints, Swap_LINTS).then_some(::clippy_lints::swap::Swap), + SwapPtrToRef: is_lint_pass_required(skippable_lints, SwapPtrToRef_LINTS).then_some(::clippy_lints::swap_ptr_to_ref::SwapPtrToRef), + TemporaryAssignment: is_lint_pass_required(skippable_lints, TemporaryAssignment_LINTS).then_some(::clippy_lints::temporary_assignment::TemporaryAssignment), + TestsOutsideTestModule: is_lint_pass_required(skippable_lints, TestsOutsideTestModule_LINTS).then_some(::clippy_lints::tests_outside_test_module::TestsOutsideTestModule), + UncheckedTimeSubtraction: is_lint_pass_required(skippable_lints, UncheckedTimeSubtraction_LINTS).then(|| ::clippy_lints::time_subtraction::UncheckedTimeSubtraction::new(conf)), + ToDigitIsSome: is_lint_pass_required(skippable_lints, ToDigitIsSome_LINTS).then(|| ::clippy_lints::to_digit_is_some::ToDigitIsSome::new(conf)), + ToStringTraitImpl: is_lint_pass_required(skippable_lints, ToStringTraitImpl_LINTS).then_some(::clippy_lints::to_string_trait_impl::ToStringTraitImpl), + ToplevelRefArg: is_lint_pass_required(skippable_lints, ToplevelRefArg_LINTS).then_some(::clippy_lints::toplevel_ref_arg::ToplevelRefArg), + TrailingEmptyArray: is_lint_pass_required(skippable_lints, TrailingEmptyArray_LINTS).then_some(::clippy_lints::trailing_empty_array::TrailingEmptyArray), + TraitBounds: is_lint_pass_required(skippable_lints, TraitBounds_LINTS).then(|| ::clippy_lints::trait_bounds::TraitBounds::new(conf)), + Transmute: is_lint_pass_required(skippable_lints, Transmute_LINTS).then(|| ::clippy_lints::transmute::Transmute::new(conf)), + TupleArrayConversions: is_lint_pass_required(skippable_lints, TupleArrayConversions_LINTS).then(|| ::clippy_lints::tuple_array_conversions::TupleArrayConversions::new(conf)), + Types: is_lint_pass_required(skippable_lints, Types_LINTS).then(|| ::clippy_lints::types::Types::new(conf)), + UnconditionalRecursion: is_lint_pass_required(skippable_lints, UnconditionalRecursion_LINTS).then(::clippy_lints::unconditional_recursion::UnconditionalRecursion::default), + UndocumentedUnsafeBlocks: is_lint_pass_required(skippable_lints, UndocumentedUnsafeBlocks_LINTS).then(|| ::clippy_lints::undocumented_unsafe_blocks::UndocumentedUnsafeBlocks::new(conf)), + Unicode: is_lint_pass_required(skippable_lints, Unicode_LINTS).then_some(::clippy_lints::unicode::Unicode), + UninhabitedReferences: is_lint_pass_required(skippable_lints, UninhabitedReferences_LINTS).then_some(::clippy_lints::uninhabited_references::UninhabitedReferences), + UninitVec: is_lint_pass_required(skippable_lints, UninitVec_LINTS).then_some(::clippy_lints::uninit_vec::UninitVec), + UnitReturnExpectingOrd: is_lint_pass_required(skippable_lints, UnitReturnExpectingOrd_LINTS).then_some(::clippy_lints::unit_return_expecting_ord::UnitReturnExpectingOrd), + UnitTypes: is_lint_pass_required(skippable_lints, UnitTypes_LINTS).then(|| ::clippy_lints::unit_types::UnitTypes::new(fmt_args.clone())), + UnnecessaryBoxReturns: is_lint_pass_required(skippable_lints, UnnecessaryBoxReturns_LINTS).then(|| ::clippy_lints::unnecessary_box_returns::UnnecessaryBoxReturns::new(conf)), + UnnecessaryLiteralBound: is_lint_pass_required(skippable_lints, UnnecessaryLiteralBound_LINTS).then_some(::clippy_lints::unnecessary_literal_bound::UnnecessaryLiteralBound), + UnnecessaryMapOnConstructor: is_lint_pass_required(skippable_lints, UnnecessaryMapOnConstructor_LINTS).then_some(::clippy_lints::unnecessary_map_on_constructor::UnnecessaryMapOnConstructor), + UnnecessaryMutPassed: is_lint_pass_required(skippable_lints, UnnecessaryMutPassed_LINTS).then_some(::clippy_lints::unnecessary_mut_passed::UnnecessaryMutPassed), + UnnecessaryOwnedEmptyStrings: is_lint_pass_required(skippable_lints, UnnecessaryOwnedEmptyStrings_LINTS).then_some(::clippy_lints::unnecessary_owned_empty_strings::UnnecessaryOwnedEmptyStrings), + UnnecessarySemicolon: is_lint_pass_required(skippable_lints, UnnecessarySemicolon_LINTS).then(::clippy_lints::unnecessary_semicolon::UnnecessarySemicolon::default), + UnnecessaryStruct: is_lint_pass_required(skippable_lints, UnnecessaryStruct_LINTS).then_some(::clippy_lints::unnecessary_struct_initialization::UnnecessaryStruct), + UnnecessaryWraps: is_lint_pass_required(skippable_lints, UnnecessaryWraps_LINTS).then(|| ::clippy_lints::unnecessary_wraps::UnnecessaryWraps::new(conf)), + UnneededStructPattern: is_lint_pass_required(skippable_lints, UnneededStructPattern_LINTS).then_some(::clippy_lints::unneeded_struct_pattern::UnneededStructPattern), + UnusedAsync: is_lint_pass_required(skippable_lints, UnusedAsync_LINTS).then(::clippy_lints::unused_async::UnusedAsync::default), + UnusedIoAmount: is_lint_pass_required(skippable_lints, UnusedIoAmount_LINTS).then_some(::clippy_lints::unused_io_amount::UnusedIoAmount), + UnusedPeekable: is_lint_pass_required(skippable_lints, UnusedPeekable_LINTS).then_some(::clippy_lints::unused_peekable::UnusedPeekable), + UnusedResultOk: is_lint_pass_required(skippable_lints, UnusedResultOk_LINTS).then_some(::clippy_lints::unused_result_ok::UnusedResultOk), + UnusedSelf: is_lint_pass_required(skippable_lints, UnusedSelf_LINTS).then(|| ::clippy_lints::unused_self::UnusedSelf::new(conf)), + UnusedTraitNames: is_lint_pass_required(skippable_lints, UnusedTraitNames_LINTS).then(|| ::clippy_lints::unused_trait_names::UnusedTraitNames::new(conf)), + UnusedUnit: is_lint_pass_required(skippable_lints, UnusedUnit_LINTS).then_some(::clippy_lints::unused_unit::UnusedUnit), + Unwrap: is_lint_pass_required(skippable_lints, Unwrap_LINTS).then(|| ::clippy_lints::unwrap::Unwrap::new(conf)), + UnwrapInResult: is_lint_pass_required(skippable_lints, UnwrapInResult_LINTS).then(::clippy_lints::unwrap_in_result::UnwrapInResult::default), + UpperCaseAcronyms: is_lint_pass_required(skippable_lints, UpperCaseAcronyms_LINTS).then(|| ::clippy_lints::upper_case_acronyms::UpperCaseAcronyms::new(conf)), + UseSelf: is_lint_pass_required(skippable_lints, UseSelf_LINTS).then(|| ::clippy_lints::use_self::UseSelf::new(conf)), + UselessConcat: is_lint_pass_required(skippable_lints, UselessConcat_LINTS).then_some(::clippy_lints::useless_concat::UselessConcat), + UselessConversion: is_lint_pass_required(skippable_lints, UselessConversion_LINTS).then(::clippy_lints::useless_conversion::UselessConversion::default), + UselessVec: is_lint_pass_required(skippable_lints, UselessVec_LINTS).then(|| ::clippy_lints::useless_vec::UselessVec::new(conf)), + Author: is_lint_pass_required(skippable_lints, Author_LINTS).then_some(::clippy_lints::utils::author::Author), + DumpHir: is_lint_pass_required(skippable_lints, DumpHir_LINTS).then_some(::clippy_lints::utils::dump_hir::DumpHir), + VecInitThenPush: is_lint_pass_required(skippable_lints, VecInitThenPush_LINTS).then(::clippy_lints::vec_init_then_push::VecInitThenPush::default), + VolatileComposites: is_lint_pass_required(skippable_lints, VolatileComposites_LINTS).then_some(::clippy_lints::volatile_composites::VolatileComposites), + WildcardImports: is_lint_pass_required(skippable_lints, WildcardImports_LINTS).then(|| ::clippy_lints::wildcard_imports::WildcardImports::new(conf)), + WithCapacityZero: is_lint_pass_required(skippable_lints, WithCapacityZero_LINTS).then_some(::clippy_lints::with_capacity_zero::WithCapacityZero), + Write: is_lint_pass_required(skippable_lints, Write_LINTS).then(|| ::clippy_lints::write::Write::new(conf, fmt_args.clone())), + ZeroDiv: is_lint_pass_required(skippable_lints, ZeroDiv_LINTS).then_some(::clippy_lints::zero_div_zero::ZeroDiv), + ZeroRepeatSideEffects: is_lint_pass_required(skippable_lints, ZeroRepeatSideEffects_LINTS).then_some(::clippy_lints::zero_repeat_side_effects::ZeroRepeatSideEffects), + ZeroSizedMapValues: is_lint_pass_required(skippable_lints, ZeroSizedMapValues_LINTS).then_some(::clippy_lints::zero_sized_map_values::ZeroSizedMapValues), + ZombieProcesses: is_lint_pass_required(skippable_lints, ZombieProcesses_LINTS).then_some(::clippy_lints::zombie_processes::ZombieProcesses), + } + } +} +impl LintPass for CombinedClippyLatePass<'_> { + fn name(&self) -> &'static str { + "CombinedClippyLatePass" + } + fn get_lints(&self) -> LintVec { + vec![ + ::clippy_lints::absolute_paths::ABSOLUTE_PATHS, + ::clippy_lints::operators::ABSURD_EXTREME_COMPARISONS, + ::clippy_lints::std_instead_of_core::ALLOC_INSTEAD_OF_CORE, + ::clippy_lints::swap::ALMOST_SWAPPED, + ::clippy_lints::approx_const::APPROX_CONSTANT, + ::clippy_lints::arbitrary_source_item_ordering::ARBITRARY_SOURCE_ITEM_ORDERING, + ::clippy_lints::arc_with_non_send_sync::ARC_WITH_NON_SEND_SYNC, + ::clippy_lints::operators::ARITHMETIC_SIDE_EFFECTS, + ::clippy_lints::assertions_on_constants::ASSERTIONS_ON_CONSTANTS, + ::clippy_lints::assertions_on_result_states::ASSERTIONS_ON_RESULT_STATES, + ::clippy_lints::assert_is_empty::ASSERT_IS_EMPTY, + ::clippy_lints::assigning_clones::ASSIGNING_CLONES, + ::clippy_lints::operators::ASSIGN_OP_PATTERN, + ::clippy_lints::async_yields_async::ASYNC_YIELDS_ASYNC, + ::clippy_lints::as_conversions::AS_CONVERSIONS, + ::clippy_lints::casts::AS_POINTER_UNDERSCORE, + ::clippy_lints::casts::AS_PTR_CAST_MUT, + ::clippy_lints::casts::AS_UNDERSCORE, + ::clippy_lints::await_holding_invalid::AWAIT_HOLDING_INVALID_TYPE, + ::clippy_lints::await_holding_invalid::AWAIT_HOLDING_LOCK, + ::clippy_lints::await_holding_invalid::AWAIT_HOLDING_REFCELL_REF, + ::clippy_lints::operators::BAD_BIT_MASK, + ::clippy_lints::endian_bytes::BIG_ENDIAN_BYTES, + ::clippy_lints::methods::BIND_INSTEAD_OF_MAP, + ::clippy_lints::blocks_in_conditions::BLOCKS_IN_CONDITIONS, + ::clippy_lints::block_scrutinee::BLOCK_SCRUTINEE, + ::clippy_lints::bool_assert_comparison::BOOL_ASSERT_COMPARISON, + ::clippy_lints::bool_comparison::BOOL_COMPARISON, + ::clippy_lints::bool_to_int_with_if::BOOL_TO_INT_WITH_IF, + ::clippy_lints::types::BORROWED_BOX, + ::clippy_lints::casts::BORROW_AS_PTR, + ::clippy_lints::borrow_deref_ref::BORROW_DEREF_REF, + ::clippy_lints::non_copy_const::BORROW_INTERIOR_MUTABLE_CONST, + ::clippy_lints::escape::BOXED_LOCAL, + ::clippy_lints::types::BOX_COLLECTION, + ::clippy_lints::box_default::BOX_DEFAULT, + ::clippy_lints::ifs::BRANCHES_SHARING_CODE, + ::clippy_lints::methods::BYTES_COUNT_TO_LEN, + ::clippy_lints::methods::BYTES_NTH, + ::clippy_lints::byte_char_slices::BYTE_CHAR_SLICES, + ::clippy_lints::methods::BY_REF_PEEKABLE_PEEK, + ::clippy_lints::cargo::CARGO_COMMON_METADATA, + ::clippy_lints::methods::CASE_SENSITIVE_FILE_EXTENSION_COMPARISONS, + ::clippy_lints::casts::CAST_ABS_TO_UNSIGNED, + ::clippy_lints::casts::CAST_ENUM_CONSTRUCTOR, + ::clippy_lints::casts::CAST_ENUM_TRUNCATION, + ::clippy_lints::casts::CAST_LOSSLESS, + ::clippy_lints::casts::CAST_NAN_TO_INT, + ::clippy_lints::casts::CAST_POSSIBLE_TRUNCATION, + ::clippy_lints::casts::CAST_POSSIBLE_WRAP, + ::clippy_lints::casts::CAST_PRECISION_LOSS, + ::clippy_lints::casts::CAST_PTR_ALIGNMENT, + ::clippy_lints::casts::CAST_SIGN_LOSS, + ::clippy_lints::casts::CAST_SLICE_DIFFERENT_SIZES, + ::clippy_lints::casts::CAST_SLICE_FROM_RAW_PARTS, + ::clippy_lints::methods::CHARS_LAST_CMP, + ::clippy_lints::methods::CHARS_NEXT_CMP, + ::clippy_lints::loops::CHAR_INDICES_AS_BYTE_INDICES, + ::clippy_lints::casts::CHAR_LIT_AS_U8, + ::clippy_lints::checked_conversions::CHECKED_CONVERSIONS, + ::clippy_lints::methods::CHUNKS_EXACT_TO_AS_CHUNKS, + ::clippy_lints::methods::CLEAR_WITH_DRAIN, + ::clippy_lints::methods::CLONED_INSTEAD_OF_COPIED, + ::clippy_lints::cloned_ref_to_slice_refs::CLONED_REF_TO_SLICE_REFS, + ::clippy_lints::methods::CLONE_ON_COPY, + ::clippy_lints::methods::CLONE_ON_REF_PTR, + ::clippy_lints::ptr::CMP_NULL, + ::clippy_lints::operators::CMP_OWNED, + ::clippy_lints::coerce_container_to_any::COERCE_CONTAINER_TO_ANY, + ::clippy_lints::cognitive_complexity::COGNITIVE_COMPLEXITY, + ::clippy_lints::collapsible_if::COLLAPSIBLE_ELSE_IF, + ::clippy_lints::collapsible_if::COLLAPSIBLE_IF, + ::clippy_lints::matches::COLLAPSIBLE_MATCH, + ::clippy_lints::methods::COLLAPSIBLE_STR_REPLACE, + ::clippy_lints::collection_is_never_read::COLLECTION_IS_NEVER_READ, + ::clippy_lints::comparison_chain::COMPARISON_CHAIN, + ::clippy_lints::len_zero::COMPARISON_TO_EMPTY, + ::clippy_lints::casts::CONFUSING_METHOD_TO_NUMERIC_CAST, + ::clippy_lints::methods::CONST_IS_EMPTY, + ::clippy_lints::copy_iterator::COPY_ITERATOR, + ::clippy_lints::create_dir::CREATE_DIR, + ::clippy_lints::transmute::CROSSPOINTER_TRANSMUTE, + ::clippy_lints::dbg_macro::DBG_MACRO, + ::clippy_lints::mutable_debug_assertion::DEBUG_ASSERT_WITH_MUT_CALL, + ::clippy_lints::operators::DECIMAL_BITWISE_OPERANDS, + ::clippy_lints::non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST, + ::clippy_lints::default_constructed_unit_structs::DEFAULT_CONSTRUCTED_UNIT_STRUCTS, + ::clippy_lints::default_instead_of_iter_empty::DEFAULT_INSTEAD_OF_ITER_EMPTY, + ::clippy_lints::default_numeric_fallback::DEFAULT_NUMERIC_FALLBACK, + ::clippy_lints::default::DEFAULT_TRAIT_ACCESS, + ::clippy_lints::default_union_representation::DEFAULT_UNION_REPRESENTATION, + ::clippy_lints::reference::DEREF_ADDROF, + ::clippy_lints::redundant_slicing::DEREF_BY_SLICING, + ::clippy_lints::derivable_impls::DERIVABLE_IMPLS, + ::clippy_lints::derive::DERIVED_HASH_WITH_MANUAL_EQ, + ::clippy_lints::derive::DERIVE_ORD_XOR_PARTIAL_ORD, + ::clippy_lints::derive::DERIVE_PARTIAL_EQ_WITHOUT_EQ, + ::clippy_lints::disallowed_fields::DISALLOWED_FIELDS, + ::clippy_lints::disallowed_macros::DISALLOWED_MACROS, + ::clippy_lints::disallowed_methods::DISALLOWED_METHODS, + ::clippy_lints::disallowed_names::DISALLOWED_NAMES, + ::clippy_lints::disallowed_types::DISALLOWED_TYPES, + ::clippy_lints::mixed_read_write_in_expression::DIVERGING_SUB_EXPRESSION, + ::clippy_lints::doc::DOC_BROKEN_LINK, + ::clippy_lints::doc::DOC_COMMENT_DOUBLE_SPACE_LINEBREAKS, + ::clippy_lints::doc::DOC_INCLUDE_WITHOUT_CFG, + ::clippy_lints::doc::DOC_LAZY_CONTINUATION, + ::clippy_lints::doc::DOC_LINK_CODE, + ::clippy_lints::doc::DOC_LINK_WITH_QUOTES, + ::clippy_lints::doc::DOC_MARKDOWN, + ::clippy_lints::doc::DOC_NESTED_REFDEFS, + ::clippy_lints::doc::DOC_OVERINDENTED_LIST_ITEMS, + ::clippy_lints::doc::DOC_PARAGRAPHS_MISSING_PUNCTUATION, + ::clippy_lints::doc::DOC_SUSPICIOUS_FOOTNOTES, + ::clippy_lints::operators::DOUBLE_COMPARISONS, + ::clippy_lints::methods::DOUBLE_ENDED_ITERATOR_LAST, + ::clippy_lints::functions::DOUBLE_MUST_USE, + ::clippy_lints::methods::DRAIN_COLLECT, + ::clippy_lints::drop_forget_ref::DROP_NON_DROP, + ::clippy_lints::duration_suboptimal_units::DURATION_SUBOPTIMAL_UNITS, + ::clippy_lints::operators::DURATION_SUBSEC, + ::clippy_lints::transmute::EAGER_TRANSMUTE, + ::clippy_lints::lifetimes::ELIDABLE_LIFETIME_NAMES, + ::clippy_lints::doc::EMPTY_DOCS, + ::clippy_lints::empty_drop::EMPTY_DROP, + ::clippy_lints::empty_enums::EMPTY_ENUMS, + ::clippy_lints::empty_with_brackets::EMPTY_ENUM_VARIANTS_WITH_BRACKETS, + ::clippy_lints::loops::EMPTY_LOOP, + ::clippy_lints::empty_with_brackets::EMPTY_STRUCTS_WITH_BRACKETS, + ::clippy_lints::enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT, + ::clippy_lints::wildcard_imports::ENUM_GLOB_USE, + ::clippy_lints::item_name_repetitions::ENUM_VARIANT_NAMES, + ::clippy_lints::equatable_if_let::EQUATABLE_IF_LET, + ::clippy_lints::operators::EQ_OP, + ::clippy_lints::operators::ERASING_OP, + ::clippy_lints::error_impl_error::ERROR_IMPL_ERROR, + ::clippy_lints::methods::ERR_EXPECT, + ::clippy_lints::float_literal::EXCESSIVE_PRECISION, + ::clippy_lints::exhaustive_items::EXHAUSTIVE_ENUMS, + ::clippy_lints::exhaustive_items::EXHAUSTIVE_STRUCTS, + ::clippy_lints::exit::EXIT, + ::clippy_lints::methods::EXPECT_FUN_CALL, + ::clippy_lints::methods::EXPECT_USED, + ::clippy_lints::dereference::EXPLICIT_AUTO_DEREF, + ::clippy_lints::loops::EXPLICIT_COUNTER_LOOP, + ::clippy_lints::dereference::EXPLICIT_DEREF_METHODS, + ::clippy_lints::loops::EXPLICIT_INTO_ITER_LOOP, + ::clippy_lints::loops::EXPLICIT_ITER_LOOP, + ::clippy_lints::explicit_write::EXPLICIT_WRITE, + ::clippy_lints::derive::EXPL_IMPL_CLONE_ON_COPY, + ::clippy_lints::methods::EXTEND_WITH_DRAIN, + ::clippy_lints::lifetimes::EXTRA_UNUSED_LIFETIMES, + ::clippy_lints::extra_unused_type_parameters::EXTRA_UNUSED_TYPE_PARAMETERS, + ::clippy_lints::fallible_impl_from::FALLIBLE_IMPL_FROM, + ::clippy_lints::default::FIELD_REASSIGN_WITH_DEFAULT, + ::clippy_lints::methods::FILETYPE_IS_FILE, + ::clippy_lints::methods::FILTER_MAP_BOOL_THEN, + ::clippy_lints::methods::FILTER_MAP_IDENTITY, + ::clippy_lints::methods::FILTER_MAP_NEXT, + ::clippy_lints::methods::FILTER_NEXT, + ::clippy_lints::methods::FLAT_MAP_IDENTITY, + ::clippy_lints::methods::FLAT_MAP_OPTION, + ::clippy_lints::operators::FLOAT_ARITHMETIC, + ::clippy_lints::operators::FLOAT_CMP, + ::clippy_lints::operators::FLOAT_CMP_CONST, + ::clippy_lints::operators::FLOAT_EQUALITY_WITHOUT_ABS, + ::clippy_lints::excessive_bools::FN_PARAMS_EXCESSIVE_BOOLS, + ::clippy_lints::casts::FN_TO_NUMERIC_CAST, + ::clippy_lints::casts::FN_TO_NUMERIC_CAST_ANY, + ::clippy_lints::casts::FN_TO_NUMERIC_CAST_WITH_TRUNCATION, + ::clippy_lints::drop_forget_ref::FORGET_NON_DROP, + ::clippy_lints::methods::FORMAT_COLLECT, + ::clippy_lints::format_args::FORMAT_IN_FORMAT_ARGS, + ::clippy_lints::format_push_string::FORMAT_PUSH_STRING, + ::clippy_lints::loops::FOR_KV_MAP, + ::clippy_lints::loops::FOR_UNBOUNDED_RANGE, + ::clippy_lints::four_forward_slashes::FOUR_FORWARD_SLASHES, + ::clippy_lints::from_over_into::FROM_OVER_INTO, + ::clippy_lints::from_raw_with_void_ptr::FROM_RAW_WITH_VOID_PTR, + ::clippy_lints::from_str_radix_10::FROM_STR_RADIX_10, + ::clippy_lints::future_not_send::FUTURE_NOT_SEND, + ::clippy_lints::methods::GET_FIRST, + ::clippy_lints::methods::GET_LAST_WITH_LEN, + ::clippy_lints::methods::GET_UNWRAP, + ::clippy_lints::endian_bytes::HOST_ENDIAN_BYTES, + ::clippy_lints::operators::IDENTITY_OP, + ::clippy_lints::ifs::IFS_SAME_COND, + ::clippy_lints::if_let_mutex::IF_LET_MUTEX, + ::clippy_lints::if_not_else::IF_NOT_ELSE, + ::clippy_lints::ifs::IF_SAME_THEN_ELSE, + ::clippy_lints::if_then_some_else_none::IF_THEN_SOME_ELSE_NONE, + ::clippy_lints::ignored_unit_patterns::IGNORED_UNIT_PATTERNS, + ::clippy_lints::methods::IMPLICIT_CLONE, + ::clippy_lints::implicit_hasher::IMPLICIT_HASHER, + ::clippy_lints::implicit_return::IMPLICIT_RETURN, + ::clippy_lints::implicit_saturating_add::IMPLICIT_SATURATING_ADD, + ::clippy_lints::implicit_saturating_sub::IMPLICIT_SATURATING_SUB, + ::clippy_lints::implied_bounds_in_impls::IMPLIED_BOUNDS_IN_IMPLS, + ::clippy_lints::impl_hash_with_borrow_str_and_bytes::IMPL_HASH_BORROW_WITH_STR_AND_BYTES, + ::clippy_lints::functions::IMPL_TRAIT_IN_PARAMS, + ::clippy_lints::operators::IMPOSSIBLE_COMPARISONS, + ::clippy_lints::floating_point_arithmetic::IMPRECISE_FLOPS, + ::clippy_lints::incompatible_msrv::INCOMPATIBLE_MSRV, + ::clippy_lints::inconsistent_struct_constructor::INCONSISTENT_STRUCT_CONSTRUCTOR, + ::clippy_lints::indexing_slicing::INDEXING_SLICING, + ::clippy_lints::index_refutable_slice::INDEX_REFUTABLE_SLICE, + ::clippy_lints::operators::INEFFECTIVE_BIT_MASK, + ::clippy_lints::ineffective_open_options::INEFFECTIVE_OPEN_OPTIONS, + ::clippy_lints::methods::INEFFICIENT_TO_STRING, + ::clippy_lints::matches::INFALLIBLE_DESTRUCTURING_MATCH, + ::clippy_lints::infallible_try_from::INFALLIBLE_TRY_FROM, + ::clippy_lints::infinite_iter::INFINITE_ITER, + ::clippy_lints::loops::INFINITE_LOOP, + ::clippy_lints::inherent_to_string::INHERENT_TO_STRING, + ::clippy_lints::inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY, + ::clippy_lints::init_numbered_fields::INIT_NUMBERED_FIELDS, + ::clippy_lints::attrs::INLINE_ALWAYS, + ::clippy_lints::inline_fn_without_body::INLINE_FN_WITHOUT_BODY, + ::clippy_lints::methods::INSPECT_FOR_EACH, + ::clippy_lints::operators::INTEGER_DIVISION, + ::clippy_lints::operators::INTEGER_DIVISION_REMAINDER_USED, + ::clippy_lints::methods::INTO_ITER_ON_REF, + ::clippy_lints::iter_without_into_iter::INTO_ITER_WITHOUT_ITER, + ::clippy_lints::regex::INVALID_REGEX, + ::clippy_lints::operators::INVALID_UPCAST_COMPARISONS, + ::clippy_lints::implicit_saturating_sub::INVERTED_SATURATING_SUB, + ::clippy_lints::unicode::INVISIBLE_CHARACTERS, + ::clippy_lints::methods::IO_OTHER_ERROR, + ::clippy_lints::methods::IP_CONSTANT, + ::clippy_lints::methods::IS_DIGIT_ASCII_RADIX, + ::clippy_lints::items_after_statements::ITEMS_AFTER_STATEMENTS, + ::clippy_lints::items_after_test_module::ITEMS_AFTER_TEST_MODULE, + ::clippy_lints::methods::ITERATOR_STEP_BY_ZERO, + ::clippy_lints::methods::ITER_CLONED_COLLECT, + ::clippy_lints::methods::ITER_COUNT, + ::clippy_lints::methods::ITER_FILTER_IS_OK, + ::clippy_lints::methods::ITER_FILTER_IS_SOME, + ::clippy_lints::methods::ITER_KV_MAP, + ::clippy_lints::loops::ITER_NEXT_LOOP, + ::clippy_lints::methods::ITER_NEXT_SLICE, + ::clippy_lints::iter_not_returning_iterator::ITER_NOT_RETURNING_ITERATOR, + ::clippy_lints::methods::ITER_NTH, + ::clippy_lints::methods::ITER_NTH_ZERO, + ::clippy_lints::methods::ITER_ON_EMPTY_COLLECTIONS, + ::clippy_lints::methods::ITER_ON_SINGLE_ITEMS, + ::clippy_lints::methods::ITER_OUT_OF_BOUNDS, + ::clippy_lints::methods::ITER_OVEREAGER_CLONED, + ::clippy_lints::iter_over_hash_type::ITER_OVER_HASH_TYPE, + ::clippy_lints::methods::ITER_SKIP_NEXT, + ::clippy_lints::methods::ITER_SKIP_ZERO, + ::clippy_lints::iter_without_into_iter::ITER_WITHOUT_INTO_ITER, + ::clippy_lints::methods::ITER_WITH_DRAIN, + ::clippy_lints::methods::JOIN_ABSOLUTE_PATHS, + ::clippy_lints::large_const_arrays::LARGE_CONST_ARRAYS, + ::clippy_lints::large_enum_variant::LARGE_ENUM_VARIANT, + ::clippy_lints::large_futures::LARGE_FUTURES, + ::clippy_lints::large_include_file::LARGE_INCLUDE_FILE, + ::clippy_lints::large_stack_arrays::LARGE_STACK_ARRAYS, + ::clippy_lints::large_stack_frames::LARGE_STACK_FRAMES, + ::clippy_lints::pass_by_ref_or_value::LARGE_TYPES_PASSED_BY_VALUE, + ::clippy_lints::legacy_numeric_constants::LEGACY_NUMERIC_CONSTANTS, + ::clippy_lints::len_without_is_empty::LEN_WITHOUT_IS_EMPTY, + ::clippy_lints::len_zero::LEN_ZERO, + ::clippy_lints::returns::LET_AND_RETURN, + ::clippy_lints::let_underscore::LET_UNDERSCORE_FUTURE, + ::clippy_lints::let_underscore::LET_UNDERSCORE_LOCK, + ::clippy_lints::let_underscore::LET_UNDERSCORE_MUST_USE, + ::clippy_lints::let_underscore::LET_UNDERSCORE_UNTYPED, + ::clippy_lints::unit_types::LET_UNIT_VALUE, + ::clippy_lints::methods::LINES_FILTER_MAP_OK, + ::clippy_lints::types::LINKEDLIST, + ::clippy_lints::cargo::LINT_GROUPS_PRIORITY, + ::clippy_lints::literal_string_with_formatting_args::LITERAL_STRING_WITH_FORMATTING_ARGS, + ::clippy_lints::endian_bytes::LITTLE_ENDIAN_BYTES, + ::clippy_lints::float_literal::LOSSY_FLOAT_LITERAL, + ::clippy_lints::macro_metavars_in_unsafe::MACRO_METAVARS_IN_UNSAFE, + ::clippy_lints::macro_use::MACRO_USE_IMPORTS, + ::clippy_lints::main_recursion::MAIN_RECURSION, + ::clippy_lints::manual_abs_diff::MANUAL_ABS_DIFF, + ::clippy_lints::manual_assert::MANUAL_ASSERT, + ::clippy_lints::manual_assert_eq::MANUAL_ASSERT_EQ, + ::clippy_lints::manual_async_fn::MANUAL_ASYNC_FN, + ::clippy_lints::manual_bits::MANUAL_BITS, + ::clippy_lints::bit_width::MANUAL_BIT_WIDTH, + ::clippy_lints::manual_checked_ops::MANUAL_CHECKED_OPS, + ::clippy_lints::manual_clamp::MANUAL_CLAMP, + ::clippy_lints::methods::MANUAL_CLEAR, + ::clippy_lints::methods::MANUAL_CONTAINS, + ::clippy_lints::methods::MANUAL_C_STR_LITERALS, + ::clippy_lints::casts::MANUAL_DANGLING_PTR, + ::clippy_lints::operators::MANUAL_DIV_CEIL, + ::clippy_lints::matches::MANUAL_FILTER, + ::clippy_lints::methods::MANUAL_FILTER_MAP, + ::clippy_lints::loops::MANUAL_FIND, + ::clippy_lints::methods::MANUAL_FIND_MAP, + ::clippy_lints::loops::MANUAL_FLATTEN, + ::clippy_lints::manual_hash_one::MANUAL_HASH_ONE, + ::clippy_lints::manual_ignore_case_cmp::MANUAL_IGNORE_CASE_CMP, + ::clippy_lints::manual_ilog2::MANUAL_ILOG2, + ::clippy_lints::methods::MANUAL_INSPECT, + ::clippy_lints::time_subtraction::MANUAL_INSTANT_ELAPSED, + ::clippy_lints::operators::MANUAL_ISOLATE_LOWEST_ONE, + ::clippy_lints::manual_is_ascii_check::MANUAL_IS_ASCII_CHECK, + ::clippy_lints::manual_float_methods::MANUAL_IS_FINITE, + ::clippy_lints::manual_float_methods::MANUAL_IS_INFINITE, + ::clippy_lints::operators::MANUAL_IS_MULTIPLE_OF, + ::clippy_lints::manual_is_power_of_two::MANUAL_IS_POWER_OF_TWO, + ::clippy_lints::methods::MANUAL_IS_VARIANT_AND, + ::clippy_lints::manual_let_else::MANUAL_LET_ELSE, + ::clippy_lints::manual_main_separator_str::MANUAL_MAIN_SEPARATOR_STR, + ::clippy_lints::matches::MANUAL_MAP, + ::clippy_lints::loops::MANUAL_MEMCPY, + ::clippy_lints::operators::MANUAL_MIDPOINT, + ::clippy_lints::methods::MANUAL_NEXT_BACK, + ::clippy_lints::manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE, + ::clippy_lints::manual_noop_waker::MANUAL_NOOP_WAKER, + ::clippy_lints::matches::MANUAL_OK_ERR, + ::clippy_lints::methods::MANUAL_OK_OR, + ::clippy_lints::manual_option_as_slice::MANUAL_OPTION_AS_SLICE, + ::clippy_lints::methods::MANUAL_OPTION_ZIP, + ::clippy_lints::string_patterns::MANUAL_PATTERN_CHAR_COMPARISON, + ::clippy_lints::manual_pop_if::MANUAL_POP_IF, + ::clippy_lints::ranges::MANUAL_RANGE_CONTAINS, + ::clippy_lints::manual_range_patterns::MANUAL_RANGE_PATTERNS, + ::clippy_lints::manual_rem_euclid::MANUAL_REM_EUCLID, + ::clippy_lints::methods::MANUAL_REPEAT_N, + ::clippy_lints::manual_retain::MANUAL_RETAIN, + ::clippy_lints::manual_rotate::MANUAL_ROTATE, + ::clippy_lints::methods::MANUAL_SATURATING_ARITHMETIC, + ::clippy_lints::loops::MANUAL_SLICE_FILL, + ::clippy_lints::manual_slice_size_calculation::MANUAL_SLICE_SIZE_CALCULATION, + ::clippy_lints::methods::MANUAL_SPLIT_ONCE, + ::clippy_lints::manual_string_new::MANUAL_STRING_NEW, + ::clippy_lints::manual_strip::MANUAL_STRIP, + ::clippy_lints::methods::MANUAL_STR_REPEAT, + ::clippy_lints::swap::MANUAL_SWAP, + ::clippy_lints::manual_take::MANUAL_TAKE, + ::clippy_lints::methods::MANUAL_TRY_FOLD, + ::clippy_lints::matches::MANUAL_UNWRAP_OR, + ::clippy_lints::matches::MANUAL_UNWRAP_OR_DEFAULT, + ::clippy_lints::loops::MANUAL_WHILE_LET_SOME, + ::clippy_lints::methods::MAP_ALL_ANY_IDENTITY, + ::clippy_lints::methods::MAP_CLONE, + ::clippy_lints::methods::MAP_COLLECT_RESULT_UNIT, + ::clippy_lints::entry::MAP_ENTRY, + ::clippy_lints::methods::MAP_ERR_IGNORE, + ::clippy_lints::methods::MAP_FLATTEN, + ::clippy_lints::methods::MAP_IDENTITY, + ::clippy_lints::methods::MAP_OR_IDENTITY, + ::clippy_lints::methods::MAP_UNWRAP_OR, + ::clippy_lints::methods::MAP_WITH_UNUSED_ARGUMENT_OVER_RANGES, + ::clippy_lints::matches::MATCH_AS_REF, + ::clippy_lints::matches::MATCH_BOOL, + ::clippy_lints::matches::MATCH_LIKE_MATCHES_MACRO, + ::clippy_lints::matches::MATCH_OVERLAPPING_ARM, + ::clippy_lints::matches::MATCH_REF_PATS, + ::clippy_lints::match_result_ok::MATCH_RESULT_OK, + ::clippy_lints::matches::MATCH_SAME_ARMS, + ::clippy_lints::matches::MATCH_SINGLE_BINDING, + ::clippy_lints::matches::MATCH_STR_CASE_MISMATCH, + ::clippy_lints::matches::MATCH_WILDCARD_FOR_SINGLE_VARIANTS, + ::clippy_lints::matches::MATCH_WILD_ERR_ARM, + ::clippy_lints::infinite_iter::MAYBE_INFINITE_ITER, + ::clippy_lints::drop_forget_ref::MEM_FORGET, + ::clippy_lints::mem_replace::MEM_REPLACE_OPTION_WITH_NONE, + ::clippy_lints::mem_replace::MEM_REPLACE_OPTION_WITH_SOME, + ::clippy_lints::mem_replace::MEM_REPLACE_WITH_DEFAULT, + ::clippy_lints::mem_replace::MEM_REPLACE_WITH_UNINIT, + ::clippy_lints::min_ident_chars::MIN_IDENT_CHARS, + ::clippy_lints::minmax::MIN_MAX, + ::clippy_lints::bit_width::MISMATCHED_BIT_WIDTH_TYPE, + ::clippy_lints::mismatching_type_param_order::MISMATCHING_TYPE_PARAM_ORDER, + ::clippy_lints::functions::MISNAMED_GETTERS, + ::clippy_lints::operators::MISREFACTORED_ASSIGN_OP, + ::clippy_lints::missing_asserts_for_indexing::MISSING_ASSERTS_FOR_INDEXING, + ::clippy_lints::missing_assert_message::MISSING_ASSERT_MESSAGE, + ::clippy_lints::missing_const_for_fn::MISSING_CONST_FOR_FN, + ::clippy_lints::missing_const_for_thread_local::MISSING_CONST_FOR_THREAD_LOCAL, + ::clippy_lints::missing_doc::MISSING_DOCS_IN_PRIVATE_ITEMS, + ::clippy_lints::missing_enforced_import_rename::MISSING_ENFORCED_IMPORT_RENAMES, + ::clippy_lints::doc::MISSING_ERRORS_DOC, + ::clippy_lints::missing_fields_in_debug::MISSING_FIELDS_IN_DEBUG, + ::clippy_lints::missing_inline::MISSING_INLINE_IN_PUBLIC_ITEMS, + ::clippy_lints::doc::MISSING_PANICS_DOC, + ::clippy_lints::doc::MISSING_SAFETY_DOC, + ::clippy_lints::loops::MISSING_SPIN_LOOP, + ::clippy_lints::missing_trait_methods::MISSING_TRAIT_METHODS, + ::clippy_lints::transmute::MISSING_TRANSMUTE_ANNOTATIONS, + ::clippy_lints::mixed_read_write_in_expression::MIXED_READ_WRITE_IN_EXPRESSION, + ::clippy_lints::item_name_repetitions::MODULE_INCEPTION, + ::clippy_lints::item_name_repetitions::MODULE_NAME_REPETITIONS, + ::clippy_lints::operators::MODULO_ARITHMETIC, + ::clippy_lints::operators::MODULO_ONE, + ::clippy_lints::cargo::MULTIPLE_CRATE_VERSIONS, + ::clippy_lints::inherent_impl::MULTIPLE_INHERENT_IMPL, + ::clippy_lints::multiple_unsafe_ops_per_block::MULTIPLE_UNSAFE_OPS_PER_BLOCK, + ::clippy_lints::functions::MUST_USE_CANDIDATE, + ::clippy_lints::functions::MUST_USE_UNIT, + ::clippy_lints::mut_key::MUTABLE_KEY_TYPE, + ::clippy_lints::mutex_atomic::MUTEX_ATOMIC, + ::clippy_lints::mutex_atomic::MUTEX_INTEGER, + ::clippy_lints::ptr::MUT_FROM_REF, + ::clippy_lints::mut_mut::MUT_MUT, + ::clippy_lints::methods::MUT_MUTEX_LOCK, + ::clippy_lints::loops::MUT_RANGE_BOUND, + ::clippy_lints::methods::NAIVE_BYTECOUNT, + ::clippy_lints::methods::NEEDLESS_AS_BYTES, + ::clippy_lints::operators::NEEDLESS_BITWISE_BOOL, + ::clippy_lints::needless_bool::NEEDLESS_BOOL, + ::clippy_lints::needless_bool::NEEDLESS_BOOL_ASSIGN, + ::clippy_lints::dereference::NEEDLESS_BORROW, + ::clippy_lints::needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE, + ::clippy_lints::needless_borrows_for_generic_args::NEEDLESS_BORROWS_FOR_GENERIC_ARGS, + ::clippy_lints::methods::NEEDLESS_CHARACTER_ITERATION, + ::clippy_lints::methods::NEEDLESS_COLLECT, + ::clippy_lints::needless_continue::NEEDLESS_CONTINUE, + ::clippy_lints::doc::NEEDLESS_DOCTEST_MAIN, + ::clippy_lints::needless_for_each::NEEDLESS_FOR_EACH, + ::clippy_lints::needless_ifs::NEEDLESS_IFS, + ::clippy_lints::needless_late_init::NEEDLESS_LATE_INIT, + ::clippy_lints::lifetimes::NEEDLESS_LIFETIMES, + ::clippy_lints::matches::NEEDLESS_MATCH, + ::clippy_lints::needless_maybe_sized::NEEDLESS_MAYBE_SIZED, + ::clippy_lints::needless_nonzero_get::NEEDLESS_NONZERO_GET, + ::clippy_lints::methods::NEEDLESS_OPTION_AS_DEREF, + ::clippy_lints::methods::NEEDLESS_OPTION_TAKE, + ::clippy_lints::needless_parens_on_range_literals::NEEDLESS_PARENS_ON_RANGE_LITERALS, + ::clippy_lints::needless_pass_by_ref_mut::NEEDLESS_PASS_BY_REF_MUT, + ::clippy_lints::needless_pass_by_value::NEEDLESS_PASS_BY_VALUE, + ::clippy_lints::needless_question_mark::NEEDLESS_QUESTION_MARK, + ::clippy_lints::loops::NEEDLESS_RANGE_LOOP, + ::clippy_lints::returns::NEEDLESS_RETURN, + ::clippy_lints::returns::NEEDLESS_RETURN_WITH_QUESTION_MARK, + ::clippy_lints::methods::NEEDLESS_SPLITN, + ::clippy_lints::casts::NEEDLESS_TYPE_CAST, + ::clippy_lints::needless_update::NEEDLESS_UPDATE, + ::clippy_lints::cargo::NEGATIVE_FEATURE_NAMES, + ::clippy_lints::neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD, + ::clippy_lints::neg_multiply::NEG_MULTIPLY, + ::clippy_lints::loops::NEVER_LOOP, + ::clippy_lints::methods::NEW_RET_NO_SELF, + ::clippy_lints::new_without_default::NEW_WITHOUT_DEFAULT, + ::clippy_lints::booleans::NONMINIMAL_BOOL, + ::clippy_lints::nonnull_unchecked_on_box_ptr::NONNULL_UNCHECKED_ON_BOX_PTR, + ::clippy_lints::methods::NONSENSICAL_OPEN_OPTIONS, + ::clippy_lints::unicode::NON_ASCII_LITERAL, + ::clippy_lints::non_canonical_impls::NON_CANONICAL_CLONE_IMPL, + ::clippy_lints::non_canonical_impls::NON_CANONICAL_PARTIAL_ORD_IMPL, + ::clippy_lints::non_octal_unix_permissions::NON_OCTAL_UNIX_PERMISSIONS, + ::clippy_lints::non_send_fields_in_send_ty::NON_SEND_FIELDS_IN_SEND_TY, + ::clippy_lints::non_std_lazy_statics::NON_STD_LAZY_STATICS, + ::clippy_lints::non_zero_suggestions::NON_ZERO_SUGGESTIONS, + ::clippy_lints::functions::NOT_UNSAFE_PTR_ARG_DEREF, + ::clippy_lints::no_effect::NO_EFFECT, + ::clippy_lints::methods::NO_EFFECT_REPLACE, + ::clippy_lints::no_effect::NO_EFFECT_UNDERSCORE_BINDING, + ::clippy_lints::no_mangle_with_rust_abi::NO_MANGLE_WITH_RUST_ABI, + ::clippy_lints::methods::OBFUSCATED_IF_ELSE, + ::clippy_lints::methods::OK_EXPECT, + ::clippy_lints::only_used_in_recursion::ONLY_USED_IN_RECURSION, + ::clippy_lints::methods::OPTION_AS_REF_CLONED, + ::clippy_lints::methods::OPTION_AS_REF_DEREF, + ::clippy_lints::methods::OPTION_FILTER_MAP, + ::clippy_lints::option_if_let_else::OPTION_IF_LET_ELSE, + ::clippy_lints::methods::OPTION_MAP_OR_NONE, + ::clippy_lints::map_unit_fn::OPTION_MAP_UNIT_FN, + ::clippy_lints::types::OPTION_OPTION, + ::clippy_lints::methods::OPTION_ZIP_NONE, + ::clippy_lints::operators::OP_REF, + ::clippy_lints::methods::OR_FUN_CALL, + ::clippy_lints::methods::OR_THEN_UNWRAP, + ::clippy_lints::indexing_slicing::OUT_OF_BOUNDS_INDEXING, + ::clippy_lints::booleans::OVERLY_COMPLEX_BOOL_EXPR, + ::clippy_lints::types::OWNED_COW, + ::clippy_lints::panic_unimplemented::PANIC, + ::clippy_lints::panicking_overflow_checks::PANICKING_OVERFLOW_CHECKS, + ::clippy_lints::unwrap::PANICKING_UNWRAP, + ::clippy_lints::panic_in_result_fn::PANIC_IN_RESULT_FN, + ::clippy_lints::partialeq_ne_impl::PARTIALEQ_NE_IMPL, + ::clippy_lints::partialeq_to_none::PARTIALEQ_TO_NONE, + ::clippy_lints::pathbuf_init_then_push::PATHBUF_INIT_THEN_PUSH, + ::clippy_lints::methods::PATH_BUF_PUSH_OVERWRITE, + ::clippy_lints::methods::PATH_ENDS_WITH_EXT, + ::clippy_lints::pattern_type_mismatch::PATTERN_TYPE_MISMATCH, + ::clippy_lints::permissions_set_readonly_false::PERMISSIONS_SET_READONLY_FALSE, + ::clippy_lints::pointers_in_nomem_asm_block::POINTERS_IN_NOMEM_ASM_BLOCK, + ::clippy_lints::format_args::POINTER_FORMAT, + ::clippy_lints::write::PRINTLN_EMPTY_STRING, + ::clippy_lints::format_impl::PRINT_IN_FORMAT_IMPL, + ::clippy_lints::write::PRINT_LITERAL, + ::clippy_lints::write::PRINT_STDERR, + ::clippy_lints::write::PRINT_STDOUT, + ::clippy_lints::write::PRINT_WITH_NEWLINE, + ::clippy_lints::ptr::PTR_ARG, + ::clippy_lints::casts::PTR_AS_PTR, + ::clippy_lints::casts::PTR_CAST_CONSTNESS, + ::clippy_lints::ptr::PTR_EQ, + ::clippy_lints::methods::PTR_OFFSET_BY_LITERAL, + ::clippy_lints::methods::PTR_OFFSET_WITH_CAST, + ::clippy_lints::pub_underscore_fields::PUB_UNDERSCORE_FIELDS, + ::clippy_lints::question_mark::QUESTION_MARK, + ::clippy_lints::question_mark_used::QUESTION_MARK_USED, + ::clippy_lints::ranges::RANGE_MINUS_ONE, + ::clippy_lints::ranges::RANGE_PLUS_ONE, + ::clippy_lints::methods::RANGE_ZIP_WITH_LEN, + ::clippy_lints::types::RC_BUFFER, + ::clippy_lints::rc_clone_in_vec_init::RC_CLONE_IN_VEC_INIT, + ::clippy_lints::types::RC_MUTEX, + ::clippy_lints::methods::READONLY_WRITE_LOCK, + ::clippy_lints::methods::READ_LINE_WITHOUT_TRIM, + ::clippy_lints::read_zero_byte_vec::READ_ZERO_BYTE_VEC, + ::clippy_lints::format_impl::RECURSIVE_FORMAT_IMPL, + ::clippy_lints::types::REDUNDANT_ALLOCATION, + ::clippy_lints::redundant_async_block::REDUNDANT_ASYNC_BLOCK, + ::clippy_lints::methods::REDUNDANT_AS_STR, + ::clippy_lints::redundant_clone::REDUNDANT_CLONE, + ::clippy_lints::eta_reduction::REDUNDANT_CLOSURE, + ::clippy_lints::redundant_closure_call::REDUNDANT_CLOSURE_CALL, + ::clippy_lints::eta_reduction::REDUNDANT_CLOSURE_FOR_METHOD_CALLS, + ::clippy_lints::operators::REDUNDANT_COMPARISONS, + ::clippy_lints::redundant_else::REDUNDANT_ELSE, + ::clippy_lints::cargo::REDUNDANT_FEATURE_NAMES, + ::clippy_lints::matches::REDUNDANT_GUARDS, + ::clippy_lints::methods::REDUNDANT_ITER_CLONED, + ::clippy_lints::redundant_locals::REDUNDANT_LOCALS, + ::clippy_lints::matches::REDUNDANT_PATTERN_MATCHING, + ::clippy_lints::redundant_pub_crate::REDUNDANT_PUB_CRATE, + ::clippy_lints::redundant_slicing::REDUNDANT_SLICING, + ::clippy_lints::redundant_test_prefix::REDUNDANT_TEST_PREFIX, + ::clippy_lints::redundant_type_annotations::REDUNDANT_TYPE_ANNOTATIONS, + ::clippy_lints::casts::REF_AS_PTR, + ::clippy_lints::dereference::REF_BINDING_TO_REFERENCE, + ::clippy_lints::functions::REF_OPTION, + ::clippy_lints::ref_option_ref::REF_OPTION_REF, + ::clippy_lints::ref_patterns::REF_PATTERNS, + ::clippy_lints::regex::REGEX_CREATION_IN_LOOPS, + ::clippy_lints::functions::RENAMED_FUNCTION_PARAMS, + ::clippy_lints::methods::REPEAT_ONCE, + ::clippy_lints::repeat_vec_with_capacity::REPEAT_VEC_WITH_CAPACITY, + ::clippy_lints::replace_box::REPLACE_BOX, + ::clippy_lints::attrs::REPR_PACKED_WITHOUT_ABI, + ::clippy_lints::reserve_after_initialization::RESERVE_AFTER_INITIALIZATION, + ::clippy_lints::rest_when_destructuring_struct::REST_PATTERN_ACCESSIBLE_FIELD, + ::clippy_lints::matches::REST_PAT_IN_FULLY_BOUND_STRUCTS, + ::clippy_lints::methods::RESULT_FILTER_MAP, + ::clippy_lints::functions::RESULT_LARGE_ERR, + ::clippy_lints::methods::RESULT_MAP_OR_INTO_OPTION, + ::clippy_lints::map_unit_fn::RESULT_MAP_UNIT_FN, + ::clippy_lints::functions::RESULT_UNIT_ERR, + ::clippy_lints::methods::RETURN_AND_THEN, + ::clippy_lints::return_self_not_must_use::RETURN_SELF_NOT_MUST_USE, + ::clippy_lints::ranges::REVERSED_EMPTY_RANGES, + ::clippy_lints::ifs::SAME_FUNCTIONS_IN_IF_CONDITION, + ::clippy_lints::loops::SAME_ITEM_PUSH, + ::clippy_lints::same_length_and_capacity::SAME_LENGTH_AND_CAPACITY, + ::clippy_lints::same_name_method::SAME_NAME_METHOD, + ::clippy_lints::methods::SEARCH_IS_SOME, + ::clippy_lints::methods::SEEK_FROM_CURRENT, + ::clippy_lints::methods::SEEK_TO_START_INSTEAD_OF_REWIND, + ::clippy_lints::operators::SELF_ASSIGNMENT, + ::clippy_lints::self_named_constructors::SELF_NAMED_CONSTRUCTORS, + ::clippy_lints::only_used_in_recursion::SELF_ONLY_USED_IN_RECURSION, + ::clippy_lints::semicolon_if_nothing_returned::SEMICOLON_IF_NOTHING_RETURNED, + ::clippy_lints::semicolon_block::SEMICOLON_INSIDE_BLOCK, + ::clippy_lints::semicolon_block::SEMICOLON_OUTSIDE_BLOCK, + ::clippy_lints::serde_api::SERDE_API_MISUSE, + ::clippy_lints::set_contains_or_insert::SET_CONTAINS_OR_INSERT, + ::clippy_lints::shadow::SHADOW_REUSE, + ::clippy_lints::shadow::SHADOW_SAME, + ::clippy_lints::shadow::SHADOW_UNRELATED, + ::clippy_lints::misc::SHORT_CIRCUIT_STATEMENT, + ::clippy_lints::methods::SHOULD_IMPLEMENT_TRAIT, + ::clippy_lints::matches::SIGNIFICANT_DROP_IN_SCRUTINEE, + ::clippy_lints::significant_drop_tightening::SIGNIFICANT_DROP_TIGHTENING, + ::clippy_lints::single_call_fn::SINGLE_CALL_FN, + ::clippy_lints::methods::SINGLE_CHAR_ADD_STR, + ::clippy_lints::string_patterns::SINGLE_CHAR_PATTERN, + ::clippy_lints::loops::SINGLE_ELEMENT_LOOP, + ::clippy_lints::matches::SINGLE_MATCH, + ::clippy_lints::matches::SINGLE_MATCH_ELSE, + ::clippy_lints::single_option_map::SINGLE_OPTION_MAP, + ::clippy_lints::single_range_in_vec_init::SINGLE_RANGE_IN_VEC_INIT, + ::clippy_lints::size_of_in_element_count::SIZE_OF_IN_ELEMENT_COUNT, + ::clippy_lints::size_of_ref::SIZE_OF_REF, + ::clippy_lints::methods::SKIP_WHILE_NEXT, + ::clippy_lints::methods::SLICED_STRING_AS_BYTES, + ::clippy_lints::slow_vector_initialization::SLOW_VECTOR_INITIALIZATION, + ::clippy_lints::methods::SOME_FILTER, + ::clippy_lints::methods::STABLE_SORT_PRIMITIVE, + ::clippy_lints::std_instead_of_core::STD_INSTEAD_OF_ALLOC, + ::clippy_lints::std_instead_of_core::STD_INSTEAD_OF_CORE, + ::clippy_lints::strings::STRING_ADD, + ::clippy_lints::strings::STRING_ADD_ASSIGN, + ::clippy_lints::methods::STRING_EXTEND_CHARS, + ::clippy_lints::strings::STRING_FROM_UTF8_AS_BYTES, + ::clippy_lints::strings::STRING_LIT_AS_BYTES, + ::clippy_lints::methods::STRING_LIT_CHARS_ANY, + ::clippy_lints::strings::STRING_SLICE, + ::clippy_lints::strlen_on_c_strings::STRLEN_ON_C_STRINGS, + ::clippy_lints::excessive_bools::STRUCT_EXCESSIVE_BOOLS, + ::clippy_lints::item_name_repetitions::STRUCT_FIELD_NAMES, + ::clippy_lints::methods::STR_SPLIT_AT_NEWLINE, + ::clippy_lints::strings::STR_TO_STRING, + ::clippy_lints::floating_point_arithmetic::SUBOPTIMAL_FLOPS, + ::clippy_lints::suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL, + ::clippy_lints::methods::SUSPICIOUS_COMMAND_ARG_SPACE, + ::clippy_lints::doc::SUSPICIOUS_DOC_COMMENTS, + ::clippy_lints::methods::SUSPICIOUS_MAP, + ::clippy_lints::methods::SUSPICIOUS_OPEN_OPTIONS, + ::clippy_lints::suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL, + ::clippy_lints::methods::SUSPICIOUS_SPLITN, + ::clippy_lints::methods::SUSPICIOUS_TO_OWNED, + ::clippy_lints::suspicious_xor_used_as_pow::SUSPICIOUS_XOR_USED_AS_POW, + ::clippy_lints::swap_ptr_to_ref::SWAP_PTR_TO_REF, + ::clippy_lints::methods::SWAP_WITH_TEMPORARY, + ::clippy_lints::temporary_assignment::TEMPORARY_ASSIGNMENT, + ::clippy_lints::tests_outside_test_module::TESTS_OUTSIDE_TEST_MODULE, + ::clippy_lints::doc::TEST_ATTR_IN_DOCTEST, + ::clippy_lints::panic_unimplemented::TODO, + ::clippy_lints::doc::TOO_LONG_FIRST_DOC_PARAGRAPH, + ::clippy_lints::functions::TOO_MANY_ARGUMENTS, + ::clippy_lints::functions::TOO_MANY_LINES, + ::clippy_lints::toplevel_ref_arg::TOPLEVEL_REF_ARG, + ::clippy_lints::to_digit_is_some::TO_DIGIT_IS_SOME, + ::clippy_lints::format_args::TO_STRING_IN_FORMAT_ARGS, + ::clippy_lints::to_string_trait_impl::TO_STRING_TRAIT_IMPL, + ::clippy_lints::trailing_empty_array::TRAILING_EMPTY_ARRAY, + ::clippy_lints::trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS, + ::clippy_lints::transmute::TRANSMUTES_EXPRESSIBLE_AS_PTR_CASTS, + ::clippy_lints::transmute::TRANSMUTE_BYTES_TO_STR, + ::clippy_lints::transmute::TRANSMUTE_INT_TO_BOOL, + ::clippy_lints::transmute::TRANSMUTE_INT_TO_NON_ZERO, + ::clippy_lints::transmute::TRANSMUTE_NULL_TO_FN, + ::clippy_lints::transmute::TRANSMUTE_PTR_TO_PTR, + ::clippy_lints::transmute::TRANSMUTE_PTR_TO_REF, + ::clippy_lints::transmute::TRANSMUTE_UNDEFINED_REPR, + ::clippy_lints::transmute::TRANSMUTING_NULL, + ::clippy_lints::strings::TRIM_SPLIT_WHITESPACE, + ::clippy_lints::pass_by_ref_or_value::TRIVIALLY_COPY_PASS_BY_REF, + ::clippy_lints::regex::TRIVIAL_REGEX, + ::clippy_lints::matches::TRY_ERR, + ::clippy_lints::tuple_array_conversions::TUPLE_ARRAY_CONVERSIONS, + ::clippy_lints::types::TYPE_COMPLEXITY, + ::clippy_lints::methods::TYPE_ID_ON_BOX, + ::clippy_lints::trait_bounds::TYPE_REPETITION_IN_BOUNDS, + ::clippy_lints::methods::UNBUFFERED_BYTES, + ::clippy_lints::time_subtraction::UNCHECKED_TIME_SUBTRACTION, + ::clippy_lints::unconditional_recursion::UNCONDITIONAL_RECURSION, + ::clippy_lints::undocumented_unsafe_blocks::UNDOCUMENTED_UNSAFE_BLOCKS, + ::clippy_lints::unicode::UNICODE_NOT_NFC, + ::clippy_lints::panic_unimplemented::UNIMPLEMENTED, + ::clippy_lints::uninhabited_references::UNINHABITED_REFERENCES, + ::clippy_lints::methods::UNINIT_ASSUMED_INIT, + ::clippy_lints::uninit_vec::UNINIT_VEC, + ::clippy_lints::format_args::UNINLINED_FORMAT_ARGS, + ::clippy_lints::unit_types::UNIT_ARG, + ::clippy_lints::unit_types::UNIT_CMP, + ::clippy_lints::methods::UNIT_HASH, + ::clippy_lints::unit_return_expecting_ord::UNIT_RETURN_EXPECTING_ORD, + ::clippy_lints::unnecessary_box_returns::UNNECESSARY_BOX_RETURNS, + ::clippy_lints::casts::UNNECESSARY_CAST, + ::clippy_lints::format_args::UNNECESSARY_DEBUG_FORMATTING, + ::clippy_lints::methods::UNNECESSARY_FALLIBLE_CONVERSIONS, + ::clippy_lints::methods::UNNECESSARY_FILTER_MAP, + ::clippy_lints::methods::UNNECESSARY_FIND_MAP, + ::clippy_lints::methods::UNNECESSARY_FIRST_THEN_CHECK, + ::clippy_lints::methods::UNNECESSARY_FOLD, + ::clippy_lints::methods::UNNECESSARY_GET_THEN_CHECK, + ::clippy_lints::methods::UNNECESSARY_JOIN, + ::clippy_lints::methods::UNNECESSARY_LAZY_EVALUATIONS, + ::clippy_lints::unnecessary_literal_bound::UNNECESSARY_LITERAL_BOUND, + ::clippy_lints::methods::UNNECESSARY_LITERAL_UNWRAP, + ::clippy_lints::unnecessary_map_on_constructor::UNNECESSARY_MAP_ON_CONSTRUCTOR, + ::clippy_lints::methods::UNNECESSARY_MAP_OR, + ::clippy_lints::methods::UNNECESSARY_MIN_OR_MAX, + ::clippy_lints::unnecessary_mut_passed::UNNECESSARY_MUT_PASSED, + ::clippy_lints::no_effect::UNNECESSARY_OPERATION, + ::clippy_lints::methods::UNNECESSARY_OPTION_MAP_OR_ELSE, + ::clippy_lints::unnecessary_owned_empty_strings::UNNECESSARY_OWNED_EMPTY_STRINGS, + ::clippy_lints::rest_when_destructuring_struct::UNNECESSARY_REST_PATTERN, + ::clippy_lints::methods::UNNECESSARY_RESULT_MAP_OR_ELSE, + ::clippy_lints::undocumented_unsafe_blocks::UNNECESSARY_SAFETY_COMMENT, + ::clippy_lints::doc::UNNECESSARY_SAFETY_DOC, + ::clippy_lints::unnecessary_semicolon::UNNECESSARY_SEMICOLON, + ::clippy_lints::methods::UNNECESSARY_SORT_BY, + ::clippy_lints::unnecessary_struct_initialization::UNNECESSARY_STRUCT_INITIALIZATION, + ::clippy_lints::methods::UNNECESSARY_TO_OWNED, + ::clippy_lints::format_args::UNNECESSARY_TRAILING_COMMA, + ::clippy_lints::unwrap::UNNECESSARY_UNWRAP, + ::clippy_lints::methods::UNNECESSARY_UNWRAP_UNCHECKED, + ::clippy_lints::unnecessary_wraps::UNNECESSARY_WRAPS, + ::clippy_lints::unneeded_struct_pattern::UNNEEDED_STRUCT_PATTERN, + ::clippy_lints::panic_unimplemented::UNREACHABLE, + ::clippy_lints::derive::UNSAFE_DERIVE_DESERIALIZE, + ::clippy_lints::transmute::UNSOUND_COLLECTION_TRANSMUTE, + ::clippy_lints::unused_async::UNUSED_ASYNC, + ::clippy_lints::unused_async::UNUSED_ASYNC_TRAIT_IMPL, + ::clippy_lints::loops::UNUSED_ENUMERATE_INDEX, + ::clippy_lints::format_args::UNUSED_FORMAT_SPECS, + ::clippy_lints::unused_io_amount::UNUSED_IO_AMOUNT, + ::clippy_lints::unused_peekable::UNUSED_PEEKABLE, + ::clippy_lints::unused_result_ok::UNUSED_RESULT_OK, + ::clippy_lints::unused_self::UNUSED_SELF, + ::clippy_lints::unused_trait_names::UNUSED_TRAIT_NAMES, + ::clippy_lints::unused_unit::UNUSED_UNIT, + ::clippy_lints::unwrap_in_result::UNWRAP_IN_RESULT, + ::clippy_lints::methods::UNWRAP_OR_DEFAULT, + ::clippy_lints::methods::UNWRAP_USED, + ::clippy_lints::upper_case_acronyms::UPPER_CASE_ACRONYMS, + ::clippy_lints::misc::USED_UNDERSCORE_BINDING, + ::clippy_lints::misc::USED_UNDERSCORE_ITEMS, + ::clippy_lints::methods::USELESS_ASREF, + ::clippy_lints::format_args::USELESS_BORROWS_IN_FORMATTING, + ::clippy_lints::useless_concat::USELESS_CONCAT, + ::clippy_lints::useless_conversion::USELESS_CONVERSION, + ::clippy_lints::format::USELESS_FORMAT, + ::clippy_lints::let_if_seq::USELESS_LET_IF_SEQ, + ::clippy_lints::methods::USELESS_NONZERO_NEW_UNCHECKED, + ::clippy_lints::transmute::USELESS_TRANSMUTE, + ::clippy_lints::useless_vec::USELESS_VEC, + ::clippy_lints::write::USE_DEBUG, + ::clippy_lints::use_self::USE_SELF, + ::clippy_lints::types::VEC_BOX, + ::clippy_lints::vec_init_then_push::VEC_INIT_THEN_PUSH, + ::clippy_lints::methods::VEC_RESIZE_TO_ZERO, + ::clippy_lints::operators::VERBOSE_BIT_MASK, + ::clippy_lints::methods::VERBOSE_FILE_READS, + ::clippy_lints::volatile_composites::VOLATILE_COMPOSITES, + ::clippy_lints::methods::WAKER_CLONE_WAKE, + ::clippy_lints::loops::WHILE_FLOAT, + ::clippy_lints::loops::WHILE_IMMUTABLE_CONDITION, + ::clippy_lints::loops::WHILE_LET_LOOP, + ::clippy_lints::loops::WHILE_LET_ON_ITERATOR, + ::clippy_lints::cargo::WILDCARD_DEPENDENCIES, + ::clippy_lints::matches::WILDCARD_ENUM_MATCH_ARM, + ::clippy_lints::wildcard_imports::WILDCARD_IMPORTS, + ::clippy_lints::matches::WILDCARD_IN_OR_PATTERNS, + ::clippy_lints::with_capacity_zero::WITH_CAPACITY_ZERO, + ::clippy_lints::write::WRITELN_EMPTY_STRING, + ::clippy_lints::write::WRITE_LITERAL, + ::clippy_lints::write::WRITE_WITH_NEWLINE, + ::clippy_lints::methods::WRONG_SELF_CONVENTION, + ::clippy_lints::transmute::WRONG_TRANSMUTE, + ::clippy_lints::zero_div_zero::ZERO_DIVIDED_BY_ZERO, + ::clippy_lints::casts::ZERO_PTR, + ::clippy_lints::zero_repeat_side_effects::ZERO_REPEAT_SIDE_EFFECTS, + ::clippy_lints::zero_sized_map_values::ZERO_SIZED_MAP_VALUES, + ::clippy_lints::zombie_processes::ZOMBIE_PROCESSES, + ::clippy_lints::methods::ZST_OFFSET, + ] + } +} +macro_rules! expand_late_methods { + ((), [$(fn $name:ident($($param:ident: $param_ty:ty),*);)*]) => { + impl<'tcx> LateLintPass<'tcx> for CombinedClippyLatePass<'tcx> {$( + fn $name(&mut self, cx: &LateContext<'tcx>, $($param: $param_ty),*) { + if let Some(pass) = &mut self.AbsolutePaths { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ApproxConstant { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ArbitrarySourceItemOrdering { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ArcWithNonSendSync { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.AsConversions { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.AssertIsEmpty { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.AssertionsOnConstants { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.AssertionsOnResultStates { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.AssigningClones { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.AsyncYieldsAsync { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Attributes { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.AwaitHolding { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualBitWidth { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.BlockScrutinee { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.BlocksInConditions { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.BoolAssertComparison { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.BoolComparison { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.BoolToIntWithIf { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NonminimalBool { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.BorrowDerefRef { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.BoxDefault { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ByteCharSlice { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Cargo { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Casts { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.CheckedConversions { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ClonedRefToSliceRefs { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.CoerceContainerToAny { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.CognitiveComplexity { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.CollapsibleIf { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.CollectionIsNeverRead { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ComparisonChain { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.CopyIterator { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.CreateDir { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.DbgMacro { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Default { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.DefaultConstructedUnitStructs { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.DefaultIterEmpty { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.DefaultNumericFallback { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.DefaultUnionRepresentation { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Dereferencing { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.DerivableImpls { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Derive { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.DisallowedFields { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.DisallowedMacros { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.DisallowedMethods { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.DisallowedNames { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.DisallowedTypes { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Documentation { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.DropForgetRef { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.DurationSuboptimalUnits { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.EmptyDrop { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.EmptyEnums { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.EmptyWithBrackets { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.EndianBytes { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.HashMapPass { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnportableVariant { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.PatternEquality { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ErrorImplError { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.BoxedLocal { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.EtaReduction { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ExcessiveBools { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ExhaustiveItems { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Exit { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ExplicitWrite { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ExtraUnusedTypeParameters { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.FallibleImplFrom { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.FloatLiteral { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.FloatingPointArithmetic { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UselessFormat { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.FormatArgs { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.FormatImpl { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.FormatPushString { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.FourForwardSlashes { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.FromOverInto { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.FromRawWithVoidPtr { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.FromStrRadix10 { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Functions { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.FutureNotSend { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.IfLetMutex { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.IfNotElse { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.IfThenSomeElseNone { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.CopyAndPaste { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.IgnoredUnitPatterns { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ImplHashWithBorrowStrBytes { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ImplicitHasher { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ImplicitReturn { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ImplicitSaturatingAdd { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ImplicitSaturatingSub { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ImpliedBoundsInImpls { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.IncompatibleMsrv { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.InconsistentStructConstructor { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.IndexRefutableSlice { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.IndexingSlicing { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.IneffectiveOpenOptions { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.InfallibleTryFrom { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.InfiniteIter { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.MultipleInherentImpl { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.InherentToString { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NumberedFields { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.InlineFnWithoutBody { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ItemNameRepetitions { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ItemsAfterStatements { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ItemsAfterTestModule { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.IterNotReturningIterator { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.IterOverHashType { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.IterWithoutIntoIter { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.LargeConstArrays { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.LargeEnumVariant { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.LargeFuture { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.LargeIncludeFile { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.LargeStackArrays { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.LargeStackFrames { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.LegacyNumericConstants { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.LenWithoutIsEmpty { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.LenZero { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.LetIfSeq { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.LetUnderscore { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Lifetimes { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.LiteralStringWithFormattingArg { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Loops { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ExprMetavarsInUnsafe { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.MacroUseImports { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.MainRecursion { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualAbsDiff { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualAssert { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualAssertEq { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualAsyncFn { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualBits { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualCheckedOps { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualClamp { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualFloatMethods { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualHashOne { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualIgnoreCaseCmp { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualIlog2 { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualIsAsciiCheck { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualIsPowerOfTwo { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualMainSeparatorStr { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualNonExhaustive { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualNoopWaker { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualOptionAsSlice { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualPopIf { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualRangePatterns { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualRemEuclid { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualRetain { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualRotate { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualSliceSizeCalculation { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualStringNew { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualStrip { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ManualTake { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.MapUnit { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.MatchResultOk { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Matches { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.MemReplace { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Methods { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.MinIdentChars { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.MinMaxPass { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.LintPass { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.TypeParamMismatch { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.MissingAssertMessage { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.MissingAssertsForIndexing { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.MissingConstForFn { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.MissingConstForThreadLocal { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.MissingDoc { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ImportRename { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.MissingFieldsInDebug { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.MissingInline { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.MissingTraitMethods { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.EvalOrderDependence { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.MultipleUnsafeOpsPerBlock { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.MutableKeyType { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.MutMut { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.DebugAssertWithMutCall { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Mutex { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NeedlessBool { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NeedlessBorrowedRef { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NeedlessBorrowsForGenericArgs { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NeedlessContinue { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NeedlessForEach { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NeedlessIfs { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NeedlessLateInit { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NeedlessMaybeSized { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NeedlessNonzeroGet { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NeedlessParensOnRangeLiterals { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NeedlessPassByRefMut { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NeedlessPassByValue { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NeedlessQuestionMark { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NeedlessUpdate { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NoNegCompOpForPartialOrd { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NegMultiply { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NewWithoutDefault { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NoEffect { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NoMangleWithRustAbi { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NonCanonicalImpls { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NonCopyConst { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NonOctalUnixPermissions { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NonSendFieldInSendTy { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NonStdLazyStatic { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NonZeroSuggestions { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.NonnullUncheckedOnBoxPtr { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.OnlyUsedInRecursion { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Operators { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ArithmeticSideEffects { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.OptionIfLetElse { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.PanicInResultFn { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.PanicUnimplemented { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.PanickingOverflowChecks { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.PartialEqNeImpl { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.PartialeqToNone { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.PassByRefOrValue { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.PathbufThenPush { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.PatternTypeMismatch { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.PermissionsSetReadonlyFalse { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.PointersInNomemAsmBlock { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Ptr { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.PubUnderscoreFields { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.QuestionMark { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.QuestionMarkUsed { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Ranges { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.RcCloneInVecInit { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ReadZeroByteVec { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.RedundantAsyncBlock { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.RedundantClone { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.RedundantClosureCall { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.RedundantElse { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.RedundantLocals { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.RedundantPubCrate { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.RedundantSlicing { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.RedundantTestPrefix { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.RedundantTypeAnnotations { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.RefOptionRef { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.RefPatterns { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.DerefAddrOf { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Regex { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.RepeatVecWithCapacity { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ReplaceBox { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ReserveAfterInitialization { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.RestWhenDestructuringStruct { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ReturnSelfNotMustUse { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Return { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.SameLengthAndCapacity { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.SameNameMethod { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.SelfNamedConstructors { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.SemicolonBlock { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.SemicolonIfNothingReturned { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.SerdeApi { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.SetContainsOrInsert { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Shadow { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.SignificantDropTightening { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.SingleCallFn { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.SingleOptionMap { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.SingleRangeInVecInit { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.SizeOfInElementCount { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.SizeOfRef { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.SlowVectorInit { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.StdReexports { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.StringPatterns { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.StrToString { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.StringAdd { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.StringLitAsBytes { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.TrimSplitWhitespace { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.StrlenOnCStrings { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.SuspiciousImpl { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ConfusingXorAndPow { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Swap { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.SwapPtrToRef { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.TemporaryAssignment { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.TestsOutsideTestModule { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UncheckedTimeSubtraction { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ToDigitIsSome { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ToStringTraitImpl { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ToplevelRefArg { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.TrailingEmptyArray { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.TraitBounds { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Transmute { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.TupleArrayConversions { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Types { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnconditionalRecursion { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UndocumentedUnsafeBlocks { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Unicode { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UninhabitedReferences { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UninitVec { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnitReturnExpectingOrd { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnitTypes { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnnecessaryBoxReturns { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnnecessaryLiteralBound { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnnecessaryMapOnConstructor { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnnecessaryMutPassed { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnnecessaryOwnedEmptyStrings { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnnecessarySemicolon { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnnecessaryStruct { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnnecessaryWraps { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnneededStructPattern { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnusedAsync { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnusedIoAmount { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnusedPeekable { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnusedResultOk { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnusedSelf { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnusedTraitNames { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnusedUnit { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Unwrap { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UnwrapInResult { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UpperCaseAcronyms { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UseSelf { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UselessConcat { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UselessConversion { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.UselessVec { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Author { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.DumpHir { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.VecInitThenPush { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.VolatileComposites { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.WildcardImports { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.WithCapacityZero { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.Write { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ZeroDiv { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ZeroRepeatSideEffects { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ZeroSizedMapValues { LateLintPass::$name(pass, cx, $($param),*); } + if let Some(pass) = &mut self.ZombieProcesses { LateLintPass::$name(pass, cx, $($param),*); } + } + )*} + } +} +late_lint_methods!(expand_late_methods, ()); \ No newline at end of file diff --git a/src/driver.rs b/src/driver.rs index 78b9b2cd8de3..654874558b60 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -1,4 +1,4 @@ -#![feature(rustc_private)] +#![feature(custom_inner_attributes, rustc_private)] #![warn( // warn on lints, that are included in `rust-lang/rust`s bootstrap rust_2018_idioms, unused_lifetimes, @@ -7,14 +7,23 @@ // FIXME: switch to something more ergonomic here, once available. // (Currently there is no way to opt into sysroot crates without `extern crate`.) +extern crate rustc_ast; +extern crate rustc_data_structures; extern crate rustc_driver; +extern crate rustc_hir; extern crate rustc_interface; +extern crate rustc_lint; +extern crate rustc_middle; extern crate rustc_session; extern crate rustc_span; // Override the C allocator in the same way that the `rustc` binary would do. rustc_driver::override_c_allocator_in_binary!(); +mod combined_passes; + +use clippy_lints::utils::attr_collector::AttrStorage; +use clippy_utils::macros::FormatArgsStorage; use clippy_utils::sym; use declare_clippy_lint::LintListBuilder; use rustc_interface::interface; @@ -159,11 +168,47 @@ impl rustc_driver::Callbacks for ClippyCallbacks { } let mut list_builder = LintListBuilder::default(); - list_builder.insert(clippy_lints::declared_lints::LINTS); + list_builder.insert(::clippy_lints::declared_lints::LINTS); list_builder.register(lint_store); + for (old_name, new_name) in ::clippy_lints::deprecated_lints::RENAMED { + lint_store.register_renamed(old_name, new_name); + } + for (name, reason) in ::clippy_lints::deprecated_lints::DEPRECATED { + lint_store.register_removed(name, reason); + } let conf = clippy_config::Conf::load(sess); - clippy_lints::register_lint_passes(lint_store, conf); + + // NOTE: Do not add any more pre-expansion passes. These should be removed eventually. + // Due to the architecture of the compiler, currently `cfg_attr` attributes on crate + // level (i.e `#![cfg_attr(...)]`) will still be expanded even when using a pre-expansion pass. + lint_store.register_pre_expansion_lint_pass(Box::new(move || { + Box::new(::clippy_lints::attrs::EarlyAttributes::new(conf)) + })); + lint_store.register_pre_expansion_lint_pass(Box::new(move || { + Box::new(::clippy_lints::nonstandard_macro_braces::MacroBraces::new(conf)) + })); + + let format_args = FormatArgsStorage::default(); + let attrs = AttrStorage::default(); + let format_args_dup = format_args.clone(); + let attrs_dup = attrs.clone(); + + lint_store.register_early_lint_pass(Box::new(move || { + Box::new(combined_passes::CombinedClippyEarlyPass::new( + conf, + &format_args, + &attrs, + )) + })); + lint_store.register_late_lint_pass(Box::new(move |tcx| { + Box::new(combined_passes::CombinedClippyLatePass::new( + tcx, + conf, + &format_args_dup, + &attrs_dup, + )) + })); #[cfg(feature = "internal")] clippy_lints_internal::register_lints(lint_store); diff --git a/src/main.rs b/src/main.rs index 14a437fc874f..0a1981e0f910 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,6 +6,8 @@ extern crate rustc_driver; +use clippy_config::{Conf, sanitize_explanation}; +use clippy_lints::declared_lints; use std::env; use std::io::Write as _; use std::path::PathBuf; @@ -24,6 +26,27 @@ fn show_version() { } } +fn explain(name: &str) -> i32 { + let target = format!("clippy::{}", name.to_ascii_uppercase()); + if let Some(&info) = declared_lints::LINTS.iter().find(|info| info.lint.name == target) { + println!("{}", sanitize_explanation(info.explanation)); + // Check if the lint has configuration + let mut mdconf = Conf::get_metadata(); + let name = name.to_ascii_lowercase(); + mdconf.retain(|cconf| cconf.lints.contains(&&*name)); + if !mdconf.is_empty() { + println!("### Configuration for {}:\n", info.lint.name_lower()); + for conf in mdconf { + println!("{conf}"); + } + } + 0 + } else { + println!("unknown lint: {name}"); + 1 + } +} + pub fn main() { // Check for version and help flags even when invoked as 'cargo-clippy' if env::args().any(|a| a == "--help" || a == "-h") { @@ -39,7 +62,7 @@ pub fn main() { if let Some(pos) = env::args().position(|a| a == "--explain") { if let Some(mut lint) = env::args().nth(pos + 1) { lint.make_ascii_lowercase(); - process::exit(clippy_lints::explain( + process::exit(explain( &lint.strip_prefix("clippy::").unwrap_or(&lint).replace('-', "_"), )); } @@ -182,6 +205,7 @@ You can use tool lints to allow or deny lints from your code, e.g.: --offline Run without accessing the network ") } + #[cfg(test)] mod tests { use super::ClippyCmd; diff --git a/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.fixed b/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.fixed index 07d7bc55d918..3e05c4a8e5df 100644 --- a/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.fixed +++ b/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.fixed @@ -16,7 +16,6 @@ proc_macro_derive::foo_bar!(); #[rustfmt::skip] macro_rules! test { () => {{ - //~v nonstandard_macro_braces vec![0, 0, 0] //~^ nonstandard_macro_braces }}; diff --git a/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs b/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs index 9ec181c3fbd4..a64d2d3e9818 100644 --- a/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs +++ b/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs @@ -16,7 +16,6 @@ proc_macro_derive::foo_bar!(); #[rustfmt::skip] macro_rules! test { () => {{ - //~v nonstandard_macro_braces vec!{0, 0, 0} //~^ nonstandard_macro_braces }}; diff --git a/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.stderr b/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.stderr index de6d5e7cc243..bb326d331d64 100644 --- a/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.stderr +++ b/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.stderr @@ -1,5 +1,5 @@ error: use of irregular braces for `vec!` macro - --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:20:9 + --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:19:9 | LL | vec!{0, 0, 0} | ^^^^^^^^^^^^^ help: consider writing: `vec![0, 0, 0]` @@ -8,84 +8,76 @@ LL | vec!{0, 0, 0} = help: to override `-D warnings` add `#[allow(clippy::nonstandard_macro_braces)]` error: use of irregular braces for `vec!` macro - --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:46:13 + --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:45:13 | LL | let _ = vec! {1, 2, 3}; | ^^^^^^^^^^^^^^ help: consider writing: `vec![1, 2, 3]` error: use of irregular braces for `format!` macro - --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:48:13 + --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:47:13 | LL | let _ = format!["ugh {} stop being such a good compiler", "hello"]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider writing: `format!("ugh {} stop being such a good compiler", "hello")` error: use of irregular braces for `matches!` macro - --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:50:13 + --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:49:13 | LL | let _ = matches!{{}, ()}; | ^^^^^^^^^^^^^^^^ help: consider writing: `matches!({}, ())` error: use of irregular braces for `quote!` macro - --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:52:13 + --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:51:13 | LL | let _ = quote!(let x = 1;); | ^^^^^^^^^^^^^^^^^^ help: consider writing: `quote!{let x = 1;}` error: use of irregular braces for `quote::quote!` macro - --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:54:13 + --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:53:13 | LL | let _ = quote::quote!(match match match); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider writing: `quote::quote!{match match match}` error: use of irregular braces for `type_pos!` macro - --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:64:12 + --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:63:12 | LL | let _: type_pos!(usize) = vec![]; | ^^^^^^^^^^^^^^^^ help: consider writing: `type_pos![usize]` error: use of irregular braces for `eprint!` macro - --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:67:5 + --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:66:5 | LL | eprint!("test if user config overrides defaults"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider writing: `eprint!["test if user config overrides defaults"]` error: use of irregular braces for `println!` macro - --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:76:5 + --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:75:5 | LL | println! {"hello world"} | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider writing: `println!("hello world");` error: use of irregular braces for `println!` macro - --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:84:5 + --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:83:5 | LL | println![]; | ^^^^^^^^^^ help: consider writing: `println!()` error: use of irregular braces for `println!` macro - --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:86:5 + --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:85:5 | LL | println![""]; | ^^^^^^^^^^^^ help: consider writing: `println!("")` error: use of irregular braces for `println!` macro - --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:88:5 + --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:87:5 | LL | println! {}; | ^^^^^^^^^^^ help: consider writing: `println!()` error: use of irregular braces for `println!` macro - --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:90:5 + --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:89:5 | LL | println! {""}; | ^^^^^^^^^^^^^ help: consider writing: `println!("")` -error: use of irregular braces for `vec!` macro - --> tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:20:9 - | -LL | vec!{0, 0, 0} - | ^^^^^^^^^^^^^ help: consider writing: `vec![0, 0, 0]` - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error: aborting due to 14 previous errors +error: aborting due to 13 previous errors From ed669f1a18a46def225032d7a4f8bf75da493539 Mon Sep 17 00:00:00 2001 From: Jason Newcomb Date: Mon, 23 Mar 2026 05:35:33 -0400 Subject: [PATCH 14/14] Move both the deprecated and active lints list into the root crate. --- clippy_dev/src/generate.rs | 45 +- clippy_dev/src/parse.rs | 14 +- clippy_dev/src/utils.rs | 22 - clippy_lints/src/declared_lints.rs | 838 ----------------- clippy_lints/src/lib.rs | 3 - declare_clippy_lint/src/lib.rs | 2 +- {clippy_lints/src => src}/deprecated_lints.rs | 0 src/driver.rs | 6 +- src/lib.rs | 7 + src/lints.rs | 839 ++++++++++++++++++ src/main.rs | 3 +- tests/compile-test.rs | 18 +- tests/config-consistency.rs | 2 +- 13 files changed, 883 insertions(+), 916 deletions(-) delete mode 100644 clippy_lints/src/declared_lints.rs rename {clippy_lints/src => src}/deprecated_lints.rs (100%) create mode 100644 src/lib.rs create mode 100644 src/lints.rs diff --git a/clippy_dev/src/generate.rs b/clippy_dev/src/generate.rs index baaeafe29e36..610dafaad17c 100644 --- a/clippy_dev/src/generate.rs +++ b/clippy_dev/src/generate.rs @@ -2,14 +2,12 @@ use crate::ir::{ ActiveLint, ConfDef, LintData, LintPass, LintPassCtor, LintPassCtorArg, LintPassCtorArgs, LintPasses, ParsedLints, }; use crate::parse::cursor::Cursor; -use crate::utils::{ - FileUpdater, UpdateMode, UpdateStatus, VecBuf, path_as_crate_mod, slice_groups, update_text_region_fn, -}; +use crate::utils::{FileUpdater, UpdateMode, UpdateStatus, VecBuf, path_as_crate_mod, update_text_region_fn}; use core::range::Range; use itertools::Itertools as _; use std::collections::HashSet; use std::fmt::Write as _; -use std::path::{self, Path}; +use std::path; const GENERATED_FILE_COMMENT: &str = "// This file was generated by `cargo dev update_lints`.\n\ // Use that command to update this file and do not edit by hand.\n\ @@ -143,29 +141,24 @@ impl ParsedLints<'_> { UpdateStatus::from_changed(src != dst) }, ); - for lints in slice_groups(&active, |(_, (head, _)), tail| { - tail.iter().take_while(|(_, (x, _))| head == x).count() - }) { - let (_, (krate, _)) = lints[0]; - updater.update_file_checked( - "cargo dev update_lints", - update_mode, - Path::new(krate).join("src/declared_lints.rs"), - &mut |_, src, dst| { - dst.push_str(GENERATED_FILE_COMMENT); - dst.push_str("pub static LINTS: &[&::declare_clippy_lint::LintInfo] = &[\n"); - for &(name, (_, mod_path)) in lints { - dst.push_str(" crate::"); - for part in mod_path.split(path::MAIN_SEPARATOR) { - dst.extend([part, "::"]); - } - dst.extend([name, "_INFO,\n"]); + updater.update_file_checked( + "cargo dev update_lints", + update_mode, + "src/lints.rs", + &mut |_, src, dst| { + dst.push_str(GENERATED_FILE_COMMENT); + dst.push_str("#[rustfmt::skip]\npub static LINTS: &[&::declare_clippy_lint::LintInfo] = &[\n"); + for &(name, (krate, mod_path)) in &active { + dst.extend([" &::", krate, "::"]); + for part in mod_path.split(path::MAIN_SEPARATOR) { + dst.extend([part, "::"]); } - dst.push_str("];\n"); - UpdateStatus::from_changed(src != dst) - }, - ); - } + dst.extend([name, "_INFO,\n"]); + } + dst.push_str("];\n"); + UpdateStatus::from_changed(src != dst) + }, + ); active.sort_unstable_by_key(|&(name, _)| name); updater.update_file_checked( "cargo dev update_lints", diff --git a/clippy_dev/src/parse.rs b/clippy_dev/src/parse.rs index fabd0fba3952..3dba42ac446c 100644 --- a/clippy_dev/src/parse.rs +++ b/clippy_dev/src/parse.rs @@ -198,16 +198,10 @@ impl<'cx> ParseCxImpl<'cx> { #[expect(clippy::default_trait_access)] lints: LintMap(FxHashMap::with_capacity_and_hasher(1000, Default::default())), lint_passes: LintPasses(Vec::with_capacity(400)), - deprecated_file: self.source_files.alloc(SourceFile::load(self.str_buf.alloc_collect( - self.arena, - [ - "clippy_lints", - path::MAIN_SEPARATOR_STR, - "src", - path::MAIN_SEPARATOR_STR, - "deprecated_lints.rs", - ], - ))), + deprecated_file: self.source_files.alloc(SourceFile::load( + self.str_buf + .alloc_collect(self.arena, ["src", path::MAIN_SEPARATOR_STR, "deprecated_lints.rs"]), + )), }; for e in expect_action(fs::read_dir("."), ErrAction::Read, ".") { diff --git a/clippy_dev/src/utils.rs b/clippy_dev/src/utils.rs index 0a9b93862a3a..a6344991827a 100644 --- a/clippy_dev/src/utils.rs +++ b/clippy_dev/src/utils.rs @@ -698,28 +698,6 @@ pub fn walk_dir_no_dot_or_target(p: impl AsRef) -> impl Iterator(slice: &[T], split_idx: impl FnMut(&T, &[T]) -> usize) -> impl Iterator { - struct I<'a, T, F> { - slice: &'a [T], - split_idx: F, - } - impl<'a, T, F: FnMut(&T, &[T]) -> usize> Iterator for I<'a, T, F> { - type Item = &'a [T]; - fn next(&mut self) -> Option { - let (head, tail) = self.slice.split_first()?; - let idx = (self.split_idx)(head, tail) + 1; - if let Some((head, tail)) = self.slice.split_at_checked(idx) { - self.slice = tail; - Some(head) - } else { - self.slice = &mut []; - None - } - } - } - I { slice, split_idx } -} - pub fn slice_groups_mut( slice: &mut [T], split_idx: impl FnMut(&T, &[T]) -> usize, diff --git a/clippy_lints/src/declared_lints.rs b/clippy_lints/src/declared_lints.rs deleted file mode 100644 index 2258ae765928..000000000000 --- a/clippy_lints/src/declared_lints.rs +++ /dev/null @@ -1,838 +0,0 @@ -// This file was generated by `cargo dev update_lints`. -// Use that command to update this file and do not edit by hand. -// Manual edits will be overwritten. - -pub static LINTS: &[&::declare_clippy_lint::LintInfo] = &[ - crate::absolute_paths::ABSOLUTE_PATHS_INFO, - crate::almost_complete_range::ALMOST_COMPLETE_RANGE_INFO, - crate::approx_const::APPROX_CONSTANT_INFO, - crate::arbitrary_source_item_ordering::ARBITRARY_SOURCE_ITEM_ORDERING_INFO, - crate::arc_with_non_send_sync::ARC_WITH_NON_SEND_SYNC_INFO, - crate::as_conversions::AS_CONVERSIONS_INFO, - crate::asm_syntax::INLINE_ASM_X86_ATT_SYNTAX_INFO, - crate::asm_syntax::INLINE_ASM_X86_INTEL_SYNTAX_INFO, - crate::assert_is_empty::ASSERT_IS_EMPTY_INFO, - crate::assertions_on_constants::ASSERTIONS_ON_CONSTANTS_INFO, - crate::assertions_on_result_states::ASSERTIONS_ON_RESULT_STATES_INFO, - crate::assigning_clones::ASSIGNING_CLONES_INFO, - crate::async_yields_async::ASYNC_YIELDS_ASYNC_INFO, - crate::attrs::ALLOW_ATTRIBUTES_INFO, - crate::attrs::ALLOW_ATTRIBUTES_WITHOUT_REASON_INFO, - crate::attrs::BLANKET_CLIPPY_RESTRICTION_LINTS_INFO, - crate::attrs::DEPRECATED_CFG_ATTR_INFO, - crate::attrs::DEPRECATED_CLIPPY_CFG_ATTR_INFO, - crate::attrs::DEPRECATED_SEMVER_INFO, - crate::attrs::DUPLICATED_ATTRIBUTES_INFO, - crate::attrs::IGNORE_WITHOUT_REASON_INFO, - crate::attrs::INLINE_ALWAYS_INFO, - crate::attrs::MIXED_ATTRIBUTES_STYLE_INFO, - crate::attrs::NON_MINIMAL_CFG_INFO, - crate::attrs::REPR_PACKED_WITHOUT_ABI_INFO, - crate::attrs::SHOULD_PANIC_WITHOUT_EXPECT_INFO, - crate::attrs::UNNECESSARY_CLIPPY_CFG_INFO, - crate::attrs::USELESS_ATTRIBUTE_INFO, - crate::await_holding_invalid::AWAIT_HOLDING_INVALID_TYPE_INFO, - crate::await_holding_invalid::AWAIT_HOLDING_LOCK_INFO, - crate::await_holding_invalid::AWAIT_HOLDING_REFCELL_REF_INFO, - crate::bit_width::MANUAL_BIT_WIDTH_INFO, - crate::bit_width::MISMATCHED_BIT_WIDTH_TYPE_INFO, - crate::block_scrutinee::BLOCK_SCRUTINEE_INFO, - crate::blocks_in_conditions::BLOCKS_IN_CONDITIONS_INFO, - crate::bool_assert_comparison::BOOL_ASSERT_COMPARISON_INFO, - crate::bool_comparison::BOOL_COMPARISON_INFO, - crate::bool_to_int_with_if::BOOL_TO_INT_WITH_IF_INFO, - crate::booleans::NONMINIMAL_BOOL_INFO, - crate::booleans::OVERLY_COMPLEX_BOOL_EXPR_INFO, - crate::borrow_deref_ref::BORROW_DEREF_REF_INFO, - crate::box_default::BOX_DEFAULT_INFO, - crate::byte_char_slices::BYTE_CHAR_SLICES_INFO, - crate::cargo::CARGO_COMMON_METADATA_INFO, - crate::cargo::LINT_GROUPS_PRIORITY_INFO, - crate::cargo::MULTIPLE_CRATE_VERSIONS_INFO, - crate::cargo::NEGATIVE_FEATURE_NAMES_INFO, - crate::cargo::REDUNDANT_FEATURE_NAMES_INFO, - crate::cargo::WILDCARD_DEPENDENCIES_INFO, - crate::casts::AS_POINTER_UNDERSCORE_INFO, - crate::casts::AS_PTR_CAST_MUT_INFO, - crate::casts::AS_UNDERSCORE_INFO, - crate::casts::BORROW_AS_PTR_INFO, - crate::casts::CAST_ABS_TO_UNSIGNED_INFO, - crate::casts::CAST_ENUM_CONSTRUCTOR_INFO, - crate::casts::CAST_ENUM_TRUNCATION_INFO, - crate::casts::CAST_LOSSLESS_INFO, - crate::casts::CAST_NAN_TO_INT_INFO, - crate::casts::CAST_POSSIBLE_TRUNCATION_INFO, - crate::casts::CAST_POSSIBLE_WRAP_INFO, - crate::casts::CAST_PRECISION_LOSS_INFO, - crate::casts::CAST_PTR_ALIGNMENT_INFO, - crate::casts::CAST_SIGN_LOSS_INFO, - crate::casts::CAST_SLICE_DIFFERENT_SIZES_INFO, - crate::casts::CAST_SLICE_FROM_RAW_PARTS_INFO, - crate::casts::CHAR_LIT_AS_U8_INFO, - crate::casts::CONFUSING_METHOD_TO_NUMERIC_CAST_INFO, - crate::casts::FN_TO_NUMERIC_CAST_INFO, - crate::casts::FN_TO_NUMERIC_CAST_ANY_INFO, - crate::casts::FN_TO_NUMERIC_CAST_WITH_TRUNCATION_INFO, - crate::casts::MANUAL_DANGLING_PTR_INFO, - crate::casts::NEEDLESS_TYPE_CAST_INFO, - crate::casts::PTR_AS_PTR_INFO, - crate::casts::PTR_CAST_CONSTNESS_INFO, - crate::casts::REF_AS_PTR_INFO, - crate::casts::UNNECESSARY_CAST_INFO, - crate::casts::ZERO_PTR_INFO, - crate::cfg_not_test::CFG_NOT_TEST_INFO, - crate::checked_conversions::CHECKED_CONVERSIONS_INFO, - crate::cloned_ref_to_slice_refs::CLONED_REF_TO_SLICE_REFS_INFO, - crate::coerce_container_to_any::COERCE_CONTAINER_TO_ANY_INFO, - crate::cognitive_complexity::COGNITIVE_COMPLEXITY_INFO, - crate::collapsible_if::COLLAPSIBLE_ELSE_IF_INFO, - crate::collapsible_if::COLLAPSIBLE_IF_INFO, - crate::collection_is_never_read::COLLECTION_IS_NEVER_READ_INFO, - crate::comparison_chain::COMPARISON_CHAIN_INFO, - crate::copy_iterator::COPY_ITERATOR_INFO, - crate::crate_in_macro_def::CRATE_IN_MACRO_DEF_INFO, - crate::create_dir::CREATE_DIR_INFO, - crate::dbg_macro::DBG_MACRO_INFO, - crate::default::DEFAULT_TRAIT_ACCESS_INFO, - crate::default::FIELD_REASSIGN_WITH_DEFAULT_INFO, - crate::default_constructed_unit_structs::DEFAULT_CONSTRUCTED_UNIT_STRUCTS_INFO, - crate::default_instead_of_iter_empty::DEFAULT_INSTEAD_OF_ITER_EMPTY_INFO, - crate::default_numeric_fallback::DEFAULT_NUMERIC_FALLBACK_INFO, - crate::default_union_representation::DEFAULT_UNION_REPRESENTATION_INFO, - crate::definition_in_module_root::DEFINITION_IN_MODULE_ROOT_INFO, - crate::dereference::EXPLICIT_AUTO_DEREF_INFO, - crate::dereference::EXPLICIT_DEREF_METHODS_INFO, - crate::dereference::NEEDLESS_BORROW_INFO, - crate::dereference::REF_BINDING_TO_REFERENCE_INFO, - crate::derivable_impls::DERIVABLE_IMPLS_INFO, - crate::derive::DERIVE_ORD_XOR_PARTIAL_ORD_INFO, - crate::derive::DERIVE_PARTIAL_EQ_WITHOUT_EQ_INFO, - crate::derive::DERIVED_HASH_WITH_MANUAL_EQ_INFO, - crate::derive::EXPL_IMPL_CLONE_ON_COPY_INFO, - crate::derive::UNSAFE_DERIVE_DESERIALIZE_INFO, - crate::disallowed_fields::DISALLOWED_FIELDS_INFO, - crate::disallowed_macros::DISALLOWED_MACROS_INFO, - crate::disallowed_methods::DISALLOWED_METHODS_INFO, - crate::disallowed_names::DISALLOWED_NAMES_INFO, - crate::disallowed_script_idents::DISALLOWED_SCRIPT_IDENTS_INFO, - crate::disallowed_types::DISALLOWED_TYPES_INFO, - crate::doc::DOC_BROKEN_LINK_INFO, - crate::doc::DOC_COMMENT_DOUBLE_SPACE_LINEBREAKS_INFO, - crate::doc::DOC_INCLUDE_WITHOUT_CFG_INFO, - crate::doc::DOC_LAZY_CONTINUATION_INFO, - crate::doc::DOC_LINK_CODE_INFO, - crate::doc::DOC_LINK_WITH_QUOTES_INFO, - crate::doc::DOC_MARKDOWN_INFO, - crate::doc::DOC_NESTED_REFDEFS_INFO, - crate::doc::DOC_OVERINDENTED_LIST_ITEMS_INFO, - crate::doc::DOC_PARAGRAPHS_MISSING_PUNCTUATION_INFO, - crate::doc::DOC_SUSPICIOUS_FOOTNOTES_INFO, - crate::doc::EMPTY_DOCS_INFO, - crate::doc::MISSING_ERRORS_DOC_INFO, - crate::doc::MISSING_PANICS_DOC_INFO, - crate::doc::MISSING_SAFETY_DOC_INFO, - crate::doc::NEEDLESS_DOCTEST_MAIN_INFO, - crate::doc::SUSPICIOUS_DOC_COMMENTS_INFO, - crate::doc::TEST_ATTR_IN_DOCTEST_INFO, - crate::doc::TOO_LONG_FIRST_DOC_PARAGRAPH_INFO, - crate::doc::UNNECESSARY_SAFETY_DOC_INFO, - crate::double_parens::DOUBLE_PARENS_INFO, - crate::drop_forget_ref::DROP_NON_DROP_INFO, - crate::drop_forget_ref::FORGET_NON_DROP_INFO, - crate::drop_forget_ref::MEM_FORGET_INFO, - crate::duplicate_mod::DUPLICATE_MOD_INFO, - crate::duration_suboptimal_units::DURATION_SUBOPTIMAL_UNITS_INFO, - crate::else_if_without_else::ELSE_IF_WITHOUT_ELSE_INFO, - crate::empty_drop::EMPTY_DROP_INFO, - crate::empty_enums::EMPTY_ENUMS_INFO, - crate::empty_line_after::EMPTY_LINE_AFTER_DOC_COMMENTS_INFO, - crate::empty_line_after::EMPTY_LINE_AFTER_OUTER_ATTR_INFO, - crate::empty_with_brackets::EMPTY_ENUM_VARIANTS_WITH_BRACKETS_INFO, - crate::empty_with_brackets::EMPTY_STRUCTS_WITH_BRACKETS_INFO, - crate::endian_bytes::BIG_ENDIAN_BYTES_INFO, - crate::endian_bytes::HOST_ENDIAN_BYTES_INFO, - crate::endian_bytes::LITTLE_ENDIAN_BYTES_INFO, - crate::entry::MAP_ENTRY_INFO, - crate::enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT_INFO, - crate::equatable_if_let::EQUATABLE_IF_LET_INFO, - crate::error_impl_error::ERROR_IMPL_ERROR_INFO, - crate::escape::BOXED_LOCAL_INFO, - crate::eta_reduction::REDUNDANT_CLOSURE_INFO, - crate::eta_reduction::REDUNDANT_CLOSURE_FOR_METHOD_CALLS_INFO, - crate::excessive_bools::FN_PARAMS_EXCESSIVE_BOOLS_INFO, - crate::excessive_bools::STRUCT_EXCESSIVE_BOOLS_INFO, - crate::excessive_nesting::EXCESSIVE_NESTING_INFO, - crate::exhaustive_items::EXHAUSTIVE_ENUMS_INFO, - crate::exhaustive_items::EXHAUSTIVE_STRUCTS_INFO, - crate::exit::EXIT_INFO, - crate::explicit_write::EXPLICIT_WRITE_INFO, - crate::extra_unused_type_parameters::EXTRA_UNUSED_TYPE_PARAMETERS_INFO, - crate::fallible_impl_from::FALLIBLE_IMPL_FROM_INFO, - crate::field_scoped_visibility_modifiers::FIELD_SCOPED_VISIBILITY_MODIFIERS_INFO, - crate::float_literal::EXCESSIVE_PRECISION_INFO, - crate::float_literal::LOSSY_FLOAT_LITERAL_INFO, - crate::floating_point_arithmetic::IMPRECISE_FLOPS_INFO, - crate::floating_point_arithmetic::SUBOPTIMAL_FLOPS_INFO, - crate::format::USELESS_FORMAT_INFO, - crate::format_args::FORMAT_IN_FORMAT_ARGS_INFO, - crate::format_args::POINTER_FORMAT_INFO, - crate::format_args::TO_STRING_IN_FORMAT_ARGS_INFO, - crate::format_args::UNINLINED_FORMAT_ARGS_INFO, - crate::format_args::UNNECESSARY_DEBUG_FORMATTING_INFO, - crate::format_args::UNNECESSARY_TRAILING_COMMA_INFO, - crate::format_args::UNUSED_FORMAT_SPECS_INFO, - crate::format_args::USELESS_BORROWS_IN_FORMATTING_INFO, - crate::format_impl::PRINT_IN_FORMAT_IMPL_INFO, - crate::format_impl::RECURSIVE_FORMAT_IMPL_INFO, - crate::format_push_string::FORMAT_PUSH_STRING_INFO, - crate::formatting::POSSIBLE_MISSING_COMMA_INFO, - crate::formatting::POSSIBLE_MISSING_ELSE_INFO, - crate::formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING_INFO, - crate::formatting::SUSPICIOUS_ELSE_FORMATTING_INFO, - crate::formatting::SUSPICIOUS_UNARY_OP_FORMATTING_INFO, - crate::four_forward_slashes::FOUR_FORWARD_SLASHES_INFO, - crate::from_over_into::FROM_OVER_INTO_INFO, - crate::from_raw_with_void_ptr::FROM_RAW_WITH_VOID_PTR_INFO, - crate::from_str_radix_10::FROM_STR_RADIX_10_INFO, - crate::functions::DOUBLE_MUST_USE_INFO, - crate::functions::DUPLICATE_UNDERSCORE_ARGUMENT_INFO, - crate::functions::IMPL_TRAIT_IN_PARAMS_INFO, - crate::functions::MISNAMED_GETTERS_INFO, - crate::functions::MUST_USE_CANDIDATE_INFO, - crate::functions::MUST_USE_UNIT_INFO, - crate::functions::NOT_UNSAFE_PTR_ARG_DEREF_INFO, - crate::functions::REF_OPTION_INFO, - crate::functions::RENAMED_FUNCTION_PARAMS_INFO, - crate::functions::RESULT_LARGE_ERR_INFO, - crate::functions::RESULT_UNIT_ERR_INFO, - crate::functions::TOO_MANY_ARGUMENTS_INFO, - crate::functions::TOO_MANY_LINES_INFO, - crate::future_not_send::FUTURE_NOT_SEND_INFO, - crate::if_let_mutex::IF_LET_MUTEX_INFO, - crate::if_not_else::IF_NOT_ELSE_INFO, - crate::if_then_some_else_none::IF_THEN_SOME_ELSE_NONE_INFO, - crate::ifs::BRANCHES_SHARING_CODE_INFO, - crate::ifs::IF_SAME_THEN_ELSE_INFO, - crate::ifs::IFS_SAME_COND_INFO, - crate::ifs::SAME_FUNCTIONS_IN_IF_CONDITION_INFO, - crate::ignored_unit_patterns::IGNORED_UNIT_PATTERNS_INFO, - crate::impl_hash_with_borrow_str_and_bytes::IMPL_HASH_BORROW_WITH_STR_AND_BYTES_INFO, - crate::implicit_hasher::IMPLICIT_HASHER_INFO, - crate::implicit_return::IMPLICIT_RETURN_INFO, - crate::implicit_saturating_add::IMPLICIT_SATURATING_ADD_INFO, - crate::implicit_saturating_sub::IMPLICIT_SATURATING_SUB_INFO, - crate::implicit_saturating_sub::INVERTED_SATURATING_SUB_INFO, - crate::implied_bounds_in_impls::IMPLIED_BOUNDS_IN_IMPLS_INFO, - crate::incompatible_msrv::INCOMPATIBLE_MSRV_INFO, - crate::inconsistent_struct_constructor::INCONSISTENT_STRUCT_CONSTRUCTOR_INFO, - crate::index_refutable_slice::INDEX_REFUTABLE_SLICE_INFO, - crate::indexing_slicing::INDEXING_SLICING_INFO, - crate::indexing_slicing::OUT_OF_BOUNDS_INDEXING_INFO, - crate::ineffective_open_options::INEFFECTIVE_OPEN_OPTIONS_INFO, - crate::infallible_try_from::INFALLIBLE_TRY_FROM_INFO, - crate::infinite_iter::INFINITE_ITER_INFO, - crate::infinite_iter::MAYBE_INFINITE_ITER_INFO, - crate::inherent_impl::MULTIPLE_INHERENT_IMPL_INFO, - crate::inherent_to_string::INHERENT_TO_STRING_INFO, - crate::inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY_INFO, - crate::init_numbered_fields::INIT_NUMBERED_FIELDS_INFO, - crate::inline_fn_without_body::INLINE_FN_WITHOUT_BODY_INFO, - crate::inline_trait_bounds::INLINE_TRAIT_BOUNDS_INFO, - crate::int_plus_one::INT_PLUS_ONE_INFO, - crate::item_name_repetitions::ENUM_VARIANT_NAMES_INFO, - crate::item_name_repetitions::MODULE_INCEPTION_INFO, - crate::item_name_repetitions::MODULE_NAME_REPETITIONS_INFO, - crate::item_name_repetitions::STRUCT_FIELD_NAMES_INFO, - crate::items_after_statements::ITEMS_AFTER_STATEMENTS_INFO, - crate::items_after_test_module::ITEMS_AFTER_TEST_MODULE_INFO, - crate::iter_not_returning_iterator::ITER_NOT_RETURNING_ITERATOR_INFO, - crate::iter_over_hash_type::ITER_OVER_HASH_TYPE_INFO, - crate::iter_without_into_iter::INTO_ITER_WITHOUT_ITER_INFO, - crate::iter_without_into_iter::ITER_WITHOUT_INTO_ITER_INFO, - crate::large_const_arrays::LARGE_CONST_ARRAYS_INFO, - crate::large_enum_variant::LARGE_ENUM_VARIANT_INFO, - crate::large_futures::LARGE_FUTURES_INFO, - crate::large_include_file::LARGE_INCLUDE_FILE_INFO, - crate::large_stack_arrays::LARGE_STACK_ARRAYS_INFO, - crate::large_stack_frames::LARGE_STACK_FRAMES_INFO, - crate::legacy_numeric_constants::LEGACY_NUMERIC_CONSTANTS_INFO, - crate::len_without_is_empty::LEN_WITHOUT_IS_EMPTY_INFO, - crate::len_zero::COMPARISON_TO_EMPTY_INFO, - crate::len_zero::LEN_ZERO_INFO, - crate::let_if_seq::USELESS_LET_IF_SEQ_INFO, - crate::let_underscore::LET_UNDERSCORE_FUTURE_INFO, - crate::let_underscore::LET_UNDERSCORE_LOCK_INFO, - crate::let_underscore::LET_UNDERSCORE_MUST_USE_INFO, - crate::let_underscore::LET_UNDERSCORE_UNTYPED_INFO, - crate::let_with_type_underscore::LET_WITH_TYPE_UNDERSCORE_INFO, - crate::lifetimes::ELIDABLE_LIFETIME_NAMES_INFO, - crate::lifetimes::EXTRA_UNUSED_LIFETIMES_INFO, - crate::lifetimes::NEEDLESS_LIFETIMES_INFO, - crate::literal_representation::DECIMAL_LITERAL_REPRESENTATION_INFO, - crate::literal_representation::INCONSISTENT_DIGIT_GROUPING_INFO, - crate::literal_representation::LARGE_DIGIT_GROUPS_INFO, - crate::literal_representation::MISTYPED_LITERAL_SUFFIXES_INFO, - crate::literal_representation::UNREADABLE_LITERAL_INFO, - crate::literal_representation::UNUSUAL_BYTE_GROUPINGS_INFO, - crate::literal_string_with_formatting_args::LITERAL_STRING_WITH_FORMATTING_ARGS_INFO, - crate::loops::CHAR_INDICES_AS_BYTE_INDICES_INFO, - crate::loops::EMPTY_LOOP_INFO, - crate::loops::EXPLICIT_COUNTER_LOOP_INFO, - crate::loops::EXPLICIT_INTO_ITER_LOOP_INFO, - crate::loops::EXPLICIT_ITER_LOOP_INFO, - crate::loops::FOR_KV_MAP_INFO, - crate::loops::FOR_UNBOUNDED_RANGE_INFO, - crate::loops::INFINITE_LOOP_INFO, - crate::loops::ITER_NEXT_LOOP_INFO, - crate::loops::MANUAL_FIND_INFO, - crate::loops::MANUAL_FLATTEN_INFO, - crate::loops::MANUAL_MEMCPY_INFO, - crate::loops::MANUAL_SLICE_FILL_INFO, - crate::loops::MANUAL_WHILE_LET_SOME_INFO, - crate::loops::MISSING_SPIN_LOOP_INFO, - crate::loops::MUT_RANGE_BOUND_INFO, - crate::loops::NEEDLESS_RANGE_LOOP_INFO, - crate::loops::NEVER_LOOP_INFO, - crate::loops::SAME_ITEM_PUSH_INFO, - crate::loops::SINGLE_ELEMENT_LOOP_INFO, - crate::loops::UNUSED_ENUMERATE_INDEX_INFO, - crate::loops::WHILE_FLOAT_INFO, - crate::loops::WHILE_IMMUTABLE_CONDITION_INFO, - crate::loops::WHILE_LET_LOOP_INFO, - crate::loops::WHILE_LET_ON_ITERATOR_INFO, - crate::macro_metavars_in_unsafe::MACRO_METAVARS_IN_UNSAFE_INFO, - crate::macro_use::MACRO_USE_IMPORTS_INFO, - crate::main_recursion::MAIN_RECURSION_INFO, - crate::manual_abs_diff::MANUAL_ABS_DIFF_INFO, - crate::manual_assert::MANUAL_ASSERT_INFO, - crate::manual_assert_eq::MANUAL_ASSERT_EQ_INFO, - crate::manual_async_fn::MANUAL_ASYNC_FN_INFO, - crate::manual_bits::MANUAL_BITS_INFO, - crate::manual_checked_ops::MANUAL_CHECKED_OPS_INFO, - crate::manual_clamp::MANUAL_CLAMP_INFO, - crate::manual_float_methods::MANUAL_IS_FINITE_INFO, - crate::manual_float_methods::MANUAL_IS_INFINITE_INFO, - crate::manual_hash_one::MANUAL_HASH_ONE_INFO, - crate::manual_ignore_case_cmp::MANUAL_IGNORE_CASE_CMP_INFO, - crate::manual_ilog2::MANUAL_ILOG2_INFO, - crate::manual_is_ascii_check::MANUAL_IS_ASCII_CHECK_INFO, - crate::manual_is_power_of_two::MANUAL_IS_POWER_OF_TWO_INFO, - crate::manual_let_else::MANUAL_LET_ELSE_INFO, - crate::manual_main_separator_str::MANUAL_MAIN_SEPARATOR_STR_INFO, - crate::manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE_INFO, - crate::manual_noop_waker::MANUAL_NOOP_WAKER_INFO, - crate::manual_option_as_slice::MANUAL_OPTION_AS_SLICE_INFO, - crate::manual_pop_if::MANUAL_POP_IF_INFO, - crate::manual_range_patterns::MANUAL_RANGE_PATTERNS_INFO, - crate::manual_rem_euclid::MANUAL_REM_EUCLID_INFO, - crate::manual_retain::MANUAL_RETAIN_INFO, - crate::manual_rotate::MANUAL_ROTATE_INFO, - crate::manual_slice_size_calculation::MANUAL_SLICE_SIZE_CALCULATION_INFO, - crate::manual_string_new::MANUAL_STRING_NEW_INFO, - crate::manual_strip::MANUAL_STRIP_INFO, - crate::manual_take::MANUAL_TAKE_INFO, - crate::map_unit_fn::OPTION_MAP_UNIT_FN_INFO, - crate::map_unit_fn::RESULT_MAP_UNIT_FN_INFO, - crate::match_result_ok::MATCH_RESULT_OK_INFO, - crate::matches::COLLAPSIBLE_MATCH_INFO, - crate::matches::INFALLIBLE_DESTRUCTURING_MATCH_INFO, - crate::matches::MANUAL_FILTER_INFO, - crate::matches::MANUAL_MAP_INFO, - crate::matches::MANUAL_OK_ERR_INFO, - crate::matches::MANUAL_UNWRAP_OR_INFO, - crate::matches::MANUAL_UNWRAP_OR_DEFAULT_INFO, - crate::matches::MATCH_AS_REF_INFO, - crate::matches::MATCH_BOOL_INFO, - crate::matches::MATCH_LIKE_MATCHES_MACRO_INFO, - crate::matches::MATCH_OVERLAPPING_ARM_INFO, - crate::matches::MATCH_REF_PATS_INFO, - crate::matches::MATCH_SAME_ARMS_INFO, - crate::matches::MATCH_SINGLE_BINDING_INFO, - crate::matches::MATCH_STR_CASE_MISMATCH_INFO, - crate::matches::MATCH_WILD_ERR_ARM_INFO, - crate::matches::MATCH_WILDCARD_FOR_SINGLE_VARIANTS_INFO, - crate::matches::NEEDLESS_MATCH_INFO, - crate::matches::REDUNDANT_GUARDS_INFO, - crate::matches::REDUNDANT_PATTERN_MATCHING_INFO, - crate::matches::REST_PAT_IN_FULLY_BOUND_STRUCTS_INFO, - crate::matches::SIGNIFICANT_DROP_IN_SCRUTINEE_INFO, - crate::matches::SINGLE_MATCH_INFO, - crate::matches::SINGLE_MATCH_ELSE_INFO, - crate::matches::TRY_ERR_INFO, - crate::matches::WILDCARD_ENUM_MATCH_ARM_INFO, - crate::matches::WILDCARD_IN_OR_PATTERNS_INFO, - crate::mem_replace::MEM_REPLACE_OPTION_WITH_NONE_INFO, - crate::mem_replace::MEM_REPLACE_OPTION_WITH_SOME_INFO, - crate::mem_replace::MEM_REPLACE_WITH_DEFAULT_INFO, - crate::mem_replace::MEM_REPLACE_WITH_UNINIT_INFO, - crate::methods::BIND_INSTEAD_OF_MAP_INFO, - crate::methods::BY_REF_PEEKABLE_PEEK_INFO, - crate::methods::BYTES_COUNT_TO_LEN_INFO, - crate::methods::BYTES_NTH_INFO, - crate::methods::CASE_SENSITIVE_FILE_EXTENSION_COMPARISONS_INFO, - crate::methods::CHARS_LAST_CMP_INFO, - crate::methods::CHARS_NEXT_CMP_INFO, - crate::methods::CHUNKS_EXACT_TO_AS_CHUNKS_INFO, - crate::methods::CLEAR_WITH_DRAIN_INFO, - crate::methods::CLONE_ON_COPY_INFO, - crate::methods::CLONE_ON_REF_PTR_INFO, - crate::methods::CLONED_INSTEAD_OF_COPIED_INFO, - crate::methods::COLLAPSIBLE_STR_REPLACE_INFO, - crate::methods::CONST_IS_EMPTY_INFO, - crate::methods::DOUBLE_ENDED_ITERATOR_LAST_INFO, - crate::methods::DRAIN_COLLECT_INFO, - crate::methods::ERR_EXPECT_INFO, - crate::methods::EXPECT_FUN_CALL_INFO, - crate::methods::EXPECT_USED_INFO, - crate::methods::EXTEND_WITH_DRAIN_INFO, - crate::methods::FILETYPE_IS_FILE_INFO, - crate::methods::FILTER_MAP_BOOL_THEN_INFO, - crate::methods::FILTER_MAP_IDENTITY_INFO, - crate::methods::FILTER_MAP_NEXT_INFO, - crate::methods::FILTER_NEXT_INFO, - crate::methods::FLAT_MAP_IDENTITY_INFO, - crate::methods::FLAT_MAP_OPTION_INFO, - crate::methods::FORMAT_COLLECT_INFO, - crate::methods::GET_FIRST_INFO, - crate::methods::GET_LAST_WITH_LEN_INFO, - crate::methods::GET_UNWRAP_INFO, - crate::methods::IMPLICIT_CLONE_INFO, - crate::methods::INEFFICIENT_TO_STRING_INFO, - crate::methods::INSPECT_FOR_EACH_INFO, - crate::methods::INTO_ITER_ON_REF_INFO, - crate::methods::IO_OTHER_ERROR_INFO, - crate::methods::IP_CONSTANT_INFO, - crate::methods::IS_DIGIT_ASCII_RADIX_INFO, - crate::methods::ITER_CLONED_COLLECT_INFO, - crate::methods::ITER_COUNT_INFO, - crate::methods::ITER_FILTER_IS_OK_INFO, - crate::methods::ITER_FILTER_IS_SOME_INFO, - crate::methods::ITER_KV_MAP_INFO, - crate::methods::ITER_NEXT_SLICE_INFO, - crate::methods::ITER_NTH_INFO, - crate::methods::ITER_NTH_ZERO_INFO, - crate::methods::ITER_ON_EMPTY_COLLECTIONS_INFO, - crate::methods::ITER_ON_SINGLE_ITEMS_INFO, - crate::methods::ITER_OUT_OF_BOUNDS_INFO, - crate::methods::ITER_OVEREAGER_CLONED_INFO, - crate::methods::ITER_SKIP_NEXT_INFO, - crate::methods::ITER_SKIP_ZERO_INFO, - crate::methods::ITER_WITH_DRAIN_INFO, - crate::methods::ITERATOR_STEP_BY_ZERO_INFO, - crate::methods::JOIN_ABSOLUTE_PATHS_INFO, - crate::methods::LINES_FILTER_MAP_OK_INFO, - crate::methods::MANUAL_C_STR_LITERALS_INFO, - crate::methods::MANUAL_CLEAR_INFO, - crate::methods::MANUAL_CONTAINS_INFO, - crate::methods::MANUAL_FILTER_MAP_INFO, - crate::methods::MANUAL_FIND_MAP_INFO, - crate::methods::MANUAL_INSPECT_INFO, - crate::methods::MANUAL_IS_VARIANT_AND_INFO, - crate::methods::MANUAL_NEXT_BACK_INFO, - crate::methods::MANUAL_OK_OR_INFO, - crate::methods::MANUAL_OPTION_ZIP_INFO, - crate::methods::MANUAL_REPEAT_N_INFO, - crate::methods::MANUAL_SATURATING_ARITHMETIC_INFO, - crate::methods::MANUAL_SPLIT_ONCE_INFO, - crate::methods::MANUAL_STR_REPEAT_INFO, - crate::methods::MANUAL_TRY_FOLD_INFO, - crate::methods::MAP_ALL_ANY_IDENTITY_INFO, - crate::methods::MAP_CLONE_INFO, - crate::methods::MAP_COLLECT_RESULT_UNIT_INFO, - crate::methods::MAP_ERR_IGNORE_INFO, - crate::methods::MAP_FLATTEN_INFO, - crate::methods::MAP_IDENTITY_INFO, - crate::methods::MAP_OR_IDENTITY_INFO, - crate::methods::MAP_UNWRAP_OR_INFO, - crate::methods::MAP_WITH_UNUSED_ARGUMENT_OVER_RANGES_INFO, - crate::methods::MUT_MUTEX_LOCK_INFO, - crate::methods::NAIVE_BYTECOUNT_INFO, - crate::methods::NEEDLESS_AS_BYTES_INFO, - crate::methods::NEEDLESS_CHARACTER_ITERATION_INFO, - crate::methods::NEEDLESS_COLLECT_INFO, - crate::methods::NEEDLESS_OPTION_AS_DEREF_INFO, - crate::methods::NEEDLESS_OPTION_TAKE_INFO, - crate::methods::NEEDLESS_SPLITN_INFO, - crate::methods::NEW_RET_NO_SELF_INFO, - crate::methods::NO_EFFECT_REPLACE_INFO, - crate::methods::NONSENSICAL_OPEN_OPTIONS_INFO, - crate::methods::OBFUSCATED_IF_ELSE_INFO, - crate::methods::OK_EXPECT_INFO, - crate::methods::OPTION_AS_REF_CLONED_INFO, - crate::methods::OPTION_AS_REF_DEREF_INFO, - crate::methods::OPTION_FILTER_MAP_INFO, - crate::methods::OPTION_MAP_OR_NONE_INFO, - crate::methods::OPTION_ZIP_NONE_INFO, - crate::methods::OR_FUN_CALL_INFO, - crate::methods::OR_THEN_UNWRAP_INFO, - crate::methods::PATH_BUF_PUSH_OVERWRITE_INFO, - crate::methods::PATH_ENDS_WITH_EXT_INFO, - crate::methods::PTR_OFFSET_BY_LITERAL_INFO, - crate::methods::PTR_OFFSET_WITH_CAST_INFO, - crate::methods::RANGE_ZIP_WITH_LEN_INFO, - crate::methods::READ_LINE_WITHOUT_TRIM_INFO, - crate::methods::READONLY_WRITE_LOCK_INFO, - crate::methods::REDUNDANT_AS_STR_INFO, - crate::methods::REDUNDANT_ITER_CLONED_INFO, - crate::methods::REPEAT_ONCE_INFO, - crate::methods::RESULT_FILTER_MAP_INFO, - crate::methods::RESULT_MAP_OR_INTO_OPTION_INFO, - crate::methods::RETURN_AND_THEN_INFO, - crate::methods::SEARCH_IS_SOME_INFO, - crate::methods::SEEK_FROM_CURRENT_INFO, - crate::methods::SEEK_TO_START_INSTEAD_OF_REWIND_INFO, - crate::methods::SHOULD_IMPLEMENT_TRAIT_INFO, - crate::methods::SINGLE_CHAR_ADD_STR_INFO, - crate::methods::SKIP_WHILE_NEXT_INFO, - crate::methods::SLICED_STRING_AS_BYTES_INFO, - crate::methods::SOME_FILTER_INFO, - crate::methods::STABLE_SORT_PRIMITIVE_INFO, - crate::methods::STR_SPLIT_AT_NEWLINE_INFO, - crate::methods::STRING_EXTEND_CHARS_INFO, - crate::methods::STRING_LIT_CHARS_ANY_INFO, - crate::methods::SUSPICIOUS_COMMAND_ARG_SPACE_INFO, - crate::methods::SUSPICIOUS_MAP_INFO, - crate::methods::SUSPICIOUS_OPEN_OPTIONS_INFO, - crate::methods::SUSPICIOUS_SPLITN_INFO, - crate::methods::SUSPICIOUS_TO_OWNED_INFO, - crate::methods::SWAP_WITH_TEMPORARY_INFO, - crate::methods::TYPE_ID_ON_BOX_INFO, - crate::methods::UNBUFFERED_BYTES_INFO, - crate::methods::UNINIT_ASSUMED_INIT_INFO, - crate::methods::UNIT_HASH_INFO, - crate::methods::UNNECESSARY_FALLIBLE_CONVERSIONS_INFO, - crate::methods::UNNECESSARY_FILTER_MAP_INFO, - crate::methods::UNNECESSARY_FIND_MAP_INFO, - crate::methods::UNNECESSARY_FIRST_THEN_CHECK_INFO, - crate::methods::UNNECESSARY_FOLD_INFO, - crate::methods::UNNECESSARY_GET_THEN_CHECK_INFO, - crate::methods::UNNECESSARY_JOIN_INFO, - crate::methods::UNNECESSARY_LAZY_EVALUATIONS_INFO, - crate::methods::UNNECESSARY_LITERAL_UNWRAP_INFO, - crate::methods::UNNECESSARY_MAP_OR_INFO, - crate::methods::UNNECESSARY_MIN_OR_MAX_INFO, - crate::methods::UNNECESSARY_OPTION_MAP_OR_ELSE_INFO, - crate::methods::UNNECESSARY_RESULT_MAP_OR_ELSE_INFO, - crate::methods::UNNECESSARY_SORT_BY_INFO, - crate::methods::UNNECESSARY_TO_OWNED_INFO, - crate::methods::UNNECESSARY_UNWRAP_UNCHECKED_INFO, - crate::methods::UNWRAP_OR_DEFAULT_INFO, - crate::methods::UNWRAP_USED_INFO, - crate::methods::USELESS_ASREF_INFO, - crate::methods::USELESS_NONZERO_NEW_UNCHECKED_INFO, - crate::methods::VEC_RESIZE_TO_ZERO_INFO, - crate::methods::VERBOSE_FILE_READS_INFO, - crate::methods::WAKER_CLONE_WAKE_INFO, - crate::methods::WRONG_SELF_CONVENTION_INFO, - crate::methods::ZST_OFFSET_INFO, - crate::min_ident_chars::MIN_IDENT_CHARS_INFO, - crate::minmax::MIN_MAX_INFO, - crate::misc::SHORT_CIRCUIT_STATEMENT_INFO, - crate::misc::USED_UNDERSCORE_BINDING_INFO, - crate::misc::USED_UNDERSCORE_ITEMS_INFO, - crate::misc_early::BUILTIN_TYPE_SHADOW_INFO, - crate::misc_early::MIXED_CASE_HEX_LITERALS_INFO, - crate::misc_early::REDUNDANT_AT_REST_PATTERN_INFO, - crate::misc_early::REDUNDANT_PATTERN_INFO, - crate::misc_early::SEPARATED_LITERAL_SUFFIX_INFO, - crate::misc_early::UNNEEDED_FIELD_PATTERN_INFO, - crate::misc_early::UNNEEDED_WILDCARD_PATTERN_INFO, - crate::misc_early::UNSEPARATED_LITERAL_SUFFIX_INFO, - crate::misc_early::ZERO_PREFIXED_LITERAL_INFO, - crate::mismatching_type_param_order::MISMATCHING_TYPE_PARAM_ORDER_INFO, - crate::missing_assert_message::MISSING_ASSERT_MESSAGE_INFO, - crate::missing_asserts_for_indexing::MISSING_ASSERTS_FOR_INDEXING_INFO, - crate::missing_const_for_fn::MISSING_CONST_FOR_FN_INFO, - crate::missing_const_for_thread_local::MISSING_CONST_FOR_THREAD_LOCAL_INFO, - crate::missing_doc::MISSING_DOCS_IN_PRIVATE_ITEMS_INFO, - crate::missing_enforced_import_rename::MISSING_ENFORCED_IMPORT_RENAMES_INFO, - crate::missing_fields_in_debug::MISSING_FIELDS_IN_DEBUG_INFO, - crate::missing_inline::MISSING_INLINE_IN_PUBLIC_ITEMS_INFO, - crate::missing_trait_methods::MISSING_TRAIT_METHODS_INFO, - crate::mixed_read_write_in_expression::DIVERGING_SUB_EXPRESSION_INFO, - crate::mixed_read_write_in_expression::MIXED_READ_WRITE_IN_EXPRESSION_INFO, - crate::module_style::INLINE_MODULES_INFO, - crate::module_style::MOD_MODULE_FILES_INFO, - crate::module_style::SELF_NAMED_MODULE_FILES_INFO, - crate::multi_assignments::MULTI_ASSIGNMENTS_INFO, - crate::multiple_bound_locations::MULTIPLE_BOUND_LOCATIONS_INFO, - crate::multiple_unsafe_ops_per_block::MULTIPLE_UNSAFE_OPS_PER_BLOCK_INFO, - crate::mut_key::MUTABLE_KEY_TYPE_INFO, - crate::mut_mut::MUT_MUT_INFO, - crate::mutable_debug_assertion::DEBUG_ASSERT_WITH_MUT_CALL_INFO, - crate::mutex_atomic::MUTEX_ATOMIC_INFO, - crate::mutex_atomic::MUTEX_INTEGER_INFO, - crate::needless_arbitrary_self_type::NEEDLESS_ARBITRARY_SELF_TYPE_INFO, - crate::needless_bool::NEEDLESS_BOOL_INFO, - crate::needless_bool::NEEDLESS_BOOL_ASSIGN_INFO, - crate::needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE_INFO, - crate::needless_borrows_for_generic_args::NEEDLESS_BORROWS_FOR_GENERIC_ARGS_INFO, - crate::needless_continue::NEEDLESS_CONTINUE_INFO, - crate::needless_else::NEEDLESS_ELSE_INFO, - crate::needless_for_each::NEEDLESS_FOR_EACH_INFO, - crate::needless_ifs::NEEDLESS_IFS_INFO, - crate::needless_late_init::NEEDLESS_LATE_INIT_INFO, - crate::needless_maybe_sized::NEEDLESS_MAYBE_SIZED_INFO, - crate::needless_nonzero_get::NEEDLESS_NONZERO_GET_INFO, - crate::needless_parens_on_range_literals::NEEDLESS_PARENS_ON_RANGE_LITERALS_INFO, - crate::needless_pass_by_ref_mut::NEEDLESS_PASS_BY_REF_MUT_INFO, - crate::needless_pass_by_value::NEEDLESS_PASS_BY_VALUE_INFO, - crate::needless_question_mark::NEEDLESS_QUESTION_MARK_INFO, - crate::needless_update::NEEDLESS_UPDATE_INFO, - crate::neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD_INFO, - crate::neg_multiply::NEG_MULTIPLY_INFO, - crate::new_without_default::NEW_WITHOUT_DEFAULT_INFO, - crate::no_effect::NO_EFFECT_INFO, - crate::no_effect::NO_EFFECT_UNDERSCORE_BINDING_INFO, - crate::no_effect::UNNECESSARY_OPERATION_INFO, - crate::no_mangle_with_rust_abi::NO_MANGLE_WITH_RUST_ABI_INFO, - crate::non_canonical_impls::NON_CANONICAL_CLONE_IMPL_INFO, - crate::non_canonical_impls::NON_CANONICAL_PARTIAL_ORD_IMPL_INFO, - crate::non_copy_const::BORROW_INTERIOR_MUTABLE_CONST_INFO, - crate::non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST_INFO, - crate::non_expressive_names::JUST_UNDERSCORES_AND_DIGITS_INFO, - crate::non_expressive_names::MANY_SINGLE_CHAR_NAMES_INFO, - crate::non_expressive_names::SIMILAR_NAMES_INFO, - crate::non_octal_unix_permissions::NON_OCTAL_UNIX_PERMISSIONS_INFO, - crate::non_send_fields_in_send_ty::NON_SEND_FIELDS_IN_SEND_TY_INFO, - crate::non_std_lazy_statics::NON_STD_LAZY_STATICS_INFO, - crate::non_zero_suggestions::NON_ZERO_SUGGESTIONS_INFO, - crate::nonnull_unchecked_on_box_ptr::NONNULL_UNCHECKED_ON_BOX_PTR_INFO, - crate::nonstandard_macro_braces::NONSTANDARD_MACRO_BRACES_INFO, - crate::octal_escapes::OCTAL_ESCAPES_INFO, - crate::only_used_in_recursion::ONLY_USED_IN_RECURSION_INFO, - crate::only_used_in_recursion::SELF_ONLY_USED_IN_RECURSION_INFO, - crate::operators::ABSURD_EXTREME_COMPARISONS_INFO, - crate::operators::ARITHMETIC_SIDE_EFFECTS_INFO, - crate::operators::ASSIGN_OP_PATTERN_INFO, - crate::operators::BAD_BIT_MASK_INFO, - crate::operators::CMP_OWNED_INFO, - crate::operators::DECIMAL_BITWISE_OPERANDS_INFO, - crate::operators::DOUBLE_COMPARISONS_INFO, - crate::operators::DURATION_SUBSEC_INFO, - crate::operators::EQ_OP_INFO, - crate::operators::ERASING_OP_INFO, - crate::operators::FLOAT_ARITHMETIC_INFO, - crate::operators::FLOAT_CMP_INFO, - crate::operators::FLOAT_CMP_CONST_INFO, - crate::operators::FLOAT_EQUALITY_WITHOUT_ABS_INFO, - crate::operators::IDENTITY_OP_INFO, - crate::operators::IMPOSSIBLE_COMPARISONS_INFO, - crate::operators::INEFFECTIVE_BIT_MASK_INFO, - crate::operators::INTEGER_DIVISION_INFO, - crate::operators::INTEGER_DIVISION_REMAINDER_USED_INFO, - crate::operators::INVALID_UPCAST_COMPARISONS_INFO, - crate::operators::MANUAL_DIV_CEIL_INFO, - crate::operators::MANUAL_IS_MULTIPLE_OF_INFO, - crate::operators::MANUAL_ISOLATE_LOWEST_ONE_INFO, - crate::operators::MANUAL_MIDPOINT_INFO, - crate::operators::MISREFACTORED_ASSIGN_OP_INFO, - crate::operators::MODULO_ARITHMETIC_INFO, - crate::operators::MODULO_ONE_INFO, - crate::operators::NEEDLESS_BITWISE_BOOL_INFO, - crate::operators::OP_REF_INFO, - crate::operators::REDUNDANT_COMPARISONS_INFO, - crate::operators::SELF_ASSIGNMENT_INFO, - crate::operators::VERBOSE_BIT_MASK_INFO, - crate::option_env_unwrap::OPTION_ENV_UNWRAP_INFO, - crate::option_if_let_else::OPTION_IF_LET_ELSE_INFO, - crate::panic_in_result_fn::PANIC_IN_RESULT_FN_INFO, - crate::panic_unimplemented::PANIC_INFO, - crate::panic_unimplemented::TODO_INFO, - crate::panic_unimplemented::UNIMPLEMENTED_INFO, - crate::panic_unimplemented::UNREACHABLE_INFO, - crate::panicking_overflow_checks::PANICKING_OVERFLOW_CHECKS_INFO, - crate::partial_pub_fields::PARTIAL_PUB_FIELDS_INFO, - crate::partialeq_ne_impl::PARTIALEQ_NE_IMPL_INFO, - crate::partialeq_to_none::PARTIALEQ_TO_NONE_INFO, - crate::pass_by_ref_or_value::LARGE_TYPES_PASSED_BY_VALUE_INFO, - crate::pass_by_ref_or_value::TRIVIALLY_COPY_PASS_BY_REF_INFO, - crate::pathbuf_init_then_push::PATHBUF_INIT_THEN_PUSH_INFO, - crate::pattern_type_mismatch::PATTERN_TYPE_MISMATCH_INFO, - crate::permissions_set_readonly_false::PERMISSIONS_SET_READONLY_FALSE_INFO, - crate::pointers_in_nomem_asm_block::POINTERS_IN_NOMEM_ASM_BLOCK_INFO, - crate::precedence::PRECEDENCE_INFO, - crate::precedence::PRECEDENCE_BITS_INFO, - crate::ptr::CMP_NULL_INFO, - crate::ptr::MUT_FROM_REF_INFO, - crate::ptr::PTR_ARG_INFO, - crate::ptr::PTR_EQ_INFO, - crate::pub_underscore_fields::PUB_UNDERSCORE_FIELDS_INFO, - crate::pub_use::PUB_USE_INFO, - crate::question_mark::QUESTION_MARK_INFO, - crate::question_mark_used::QUESTION_MARK_USED_INFO, - crate::ranges::MANUAL_RANGE_CONTAINS_INFO, - crate::ranges::RANGE_MINUS_ONE_INFO, - crate::ranges::RANGE_PLUS_ONE_INFO, - crate::ranges::REVERSED_EMPTY_RANGES_INFO, - crate::raw_strings::NEEDLESS_RAW_STRING_HASHES_INFO, - crate::raw_strings::NEEDLESS_RAW_STRINGS_INFO, - crate::rc_clone_in_vec_init::RC_CLONE_IN_VEC_INIT_INFO, - crate::read_zero_byte_vec::READ_ZERO_BYTE_VEC_INFO, - crate::redundant_async_block::REDUNDANT_ASYNC_BLOCK_INFO, - crate::redundant_clone::REDUNDANT_CLONE_INFO, - crate::redundant_closure_call::REDUNDANT_CLOSURE_CALL_INFO, - crate::redundant_else::REDUNDANT_ELSE_INFO, - crate::redundant_field_names::REDUNDANT_FIELD_NAMES_INFO, - crate::redundant_locals::REDUNDANT_LOCALS_INFO, - crate::redundant_pub_crate::REDUNDANT_PUB_CRATE_INFO, - crate::redundant_slicing::DEREF_BY_SLICING_INFO, - crate::redundant_slicing::REDUNDANT_SLICING_INFO, - crate::redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES_INFO, - crate::redundant_test_prefix::REDUNDANT_TEST_PREFIX_INFO, - crate::redundant_type_annotations::REDUNDANT_TYPE_ANNOTATIONS_INFO, - crate::ref_option_ref::REF_OPTION_REF_INFO, - crate::ref_patterns::REF_PATTERNS_INFO, - crate::reference::DEREF_ADDROF_INFO, - crate::regex::INVALID_REGEX_INFO, - crate::regex::REGEX_CREATION_IN_LOOPS_INFO, - crate::regex::TRIVIAL_REGEX_INFO, - crate::repeat_vec_with_capacity::REPEAT_VEC_WITH_CAPACITY_INFO, - crate::replace_box::REPLACE_BOX_INFO, - crate::reserve_after_initialization::RESERVE_AFTER_INITIALIZATION_INFO, - crate::rest_when_destructuring_struct::REST_PATTERN_ACCESSIBLE_FIELD_INFO, - crate::rest_when_destructuring_struct::UNNECESSARY_REST_PATTERN_INFO, - crate::return_self_not_must_use::RETURN_SELF_NOT_MUST_USE_INFO, - crate::returns::LET_AND_RETURN_INFO, - crate::returns::NEEDLESS_RETURN_INFO, - crate::returns::NEEDLESS_RETURN_WITH_QUESTION_MARK_INFO, - crate::same_length_and_capacity::SAME_LENGTH_AND_CAPACITY_INFO, - crate::same_name_method::SAME_NAME_METHOD_INFO, - crate::self_named_constructors::SELF_NAMED_CONSTRUCTORS_INFO, - crate::semicolon_block::SEMICOLON_INSIDE_BLOCK_INFO, - crate::semicolon_block::SEMICOLON_OUTSIDE_BLOCK_INFO, - crate::semicolon_if_nothing_returned::SEMICOLON_IF_NOTHING_RETURNED_INFO, - crate::serde_api::SERDE_API_MISUSE_INFO, - crate::set_contains_or_insert::SET_CONTAINS_OR_INSERT_INFO, - crate::shadow::SHADOW_REUSE_INFO, - crate::shadow::SHADOW_SAME_INFO, - crate::shadow::SHADOW_UNRELATED_INFO, - crate::significant_drop_tightening::SIGNIFICANT_DROP_TIGHTENING_INFO, - crate::single_call_fn::SINGLE_CALL_FN_INFO, - crate::single_char_lifetime_names::SINGLE_CHAR_LIFETIME_NAMES_INFO, - crate::single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS_INFO, - crate::single_option_map::SINGLE_OPTION_MAP_INFO, - crate::single_range_in_vec_init::SINGLE_RANGE_IN_VEC_INIT_INFO, - crate::size_of_in_element_count::SIZE_OF_IN_ELEMENT_COUNT_INFO, - crate::size_of_ref::SIZE_OF_REF_INFO, - crate::slow_vector_initialization::SLOW_VECTOR_INITIALIZATION_INFO, - crate::std_instead_of_core::ALLOC_INSTEAD_OF_CORE_INFO, - crate::std_instead_of_core::STD_INSTEAD_OF_ALLOC_INFO, - crate::std_instead_of_core::STD_INSTEAD_OF_CORE_INFO, - crate::string_patterns::MANUAL_PATTERN_CHAR_COMPARISON_INFO, - crate::string_patterns::SINGLE_CHAR_PATTERN_INFO, - crate::strings::STR_TO_STRING_INFO, - crate::strings::STRING_ADD_INFO, - crate::strings::STRING_ADD_ASSIGN_INFO, - crate::strings::STRING_FROM_UTF8_AS_BYTES_INFO, - crate::strings::STRING_LIT_AS_BYTES_INFO, - crate::strings::STRING_SLICE_INFO, - crate::strings::TRIM_SPLIT_WHITESPACE_INFO, - crate::strlen_on_c_strings::STRLEN_ON_C_STRINGS_INFO, - crate::suspicious_operation_groupings::SUSPICIOUS_OPERATION_GROUPINGS_INFO, - crate::suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL_INFO, - crate::suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL_INFO, - crate::suspicious_xor_used_as_pow::SUSPICIOUS_XOR_USED_AS_POW_INFO, - crate::swap::ALMOST_SWAPPED_INFO, - crate::swap::MANUAL_SWAP_INFO, - crate::swap_ptr_to_ref::SWAP_PTR_TO_REF_INFO, - crate::tabs_in_doc_comments::TABS_IN_DOC_COMMENTS_INFO, - crate::temporary_assignment::TEMPORARY_ASSIGNMENT_INFO, - crate::tests_outside_test_module::TESTS_OUTSIDE_TEST_MODULE_INFO, - crate::time_subtraction::MANUAL_INSTANT_ELAPSED_INFO, - crate::time_subtraction::UNCHECKED_TIME_SUBTRACTION_INFO, - crate::to_digit_is_some::TO_DIGIT_IS_SOME_INFO, - crate::to_string_trait_impl::TO_STRING_TRAIT_IMPL_INFO, - crate::toplevel_ref_arg::TOPLEVEL_REF_ARG_INFO, - crate::trailing_empty_array::TRAILING_EMPTY_ARRAY_INFO, - crate::trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS_INFO, - crate::trait_bounds::TYPE_REPETITION_IN_BOUNDS_INFO, - crate::transmute::CROSSPOINTER_TRANSMUTE_INFO, - crate::transmute::EAGER_TRANSMUTE_INFO, - crate::transmute::MISSING_TRANSMUTE_ANNOTATIONS_INFO, - crate::transmute::TRANSMUTE_BYTES_TO_STR_INFO, - crate::transmute::TRANSMUTE_INT_TO_BOOL_INFO, - crate::transmute::TRANSMUTE_INT_TO_NON_ZERO_INFO, - crate::transmute::TRANSMUTE_NULL_TO_FN_INFO, - crate::transmute::TRANSMUTE_PTR_TO_PTR_INFO, - crate::transmute::TRANSMUTE_PTR_TO_REF_INFO, - crate::transmute::TRANSMUTE_UNDEFINED_REPR_INFO, - crate::transmute::TRANSMUTES_EXPRESSIBLE_AS_PTR_CASTS_INFO, - crate::transmute::TRANSMUTING_NULL_INFO, - crate::transmute::UNSOUND_COLLECTION_TRANSMUTE_INFO, - crate::transmute::USELESS_TRANSMUTE_INFO, - crate::transmute::WRONG_TRANSMUTE_INFO, - crate::tuple_array_conversions::TUPLE_ARRAY_CONVERSIONS_INFO, - crate::types::BORROWED_BOX_INFO, - crate::types::BOX_COLLECTION_INFO, - crate::types::LINKEDLIST_INFO, - crate::types::OPTION_OPTION_INFO, - crate::types::OWNED_COW_INFO, - crate::types::RC_BUFFER_INFO, - crate::types::RC_MUTEX_INFO, - crate::types::REDUNDANT_ALLOCATION_INFO, - crate::types::TYPE_COMPLEXITY_INFO, - crate::types::VEC_BOX_INFO, - crate::unconditional_recursion::UNCONDITIONAL_RECURSION_INFO, - crate::undocumented_unsafe_blocks::UNDOCUMENTED_UNSAFE_BLOCKS_INFO, - crate::undocumented_unsafe_blocks::UNNECESSARY_SAFETY_COMMENT_INFO, - crate::unicode::INVISIBLE_CHARACTERS_INFO, - crate::unicode::NON_ASCII_LITERAL_INFO, - crate::unicode::UNICODE_NOT_NFC_INFO, - crate::uninhabited_references::UNINHABITED_REFERENCES_INFO, - crate::uninit_vec::UNINIT_VEC_INFO, - crate::unit_return_expecting_ord::UNIT_RETURN_EXPECTING_ORD_INFO, - crate::unit_types::LET_UNIT_VALUE_INFO, - crate::unit_types::UNIT_ARG_INFO, - crate::unit_types::UNIT_CMP_INFO, - crate::unnecessary_box_returns::UNNECESSARY_BOX_RETURNS_INFO, - crate::unnecessary_literal_bound::UNNECESSARY_LITERAL_BOUND_INFO, - crate::unnecessary_map_on_constructor::UNNECESSARY_MAP_ON_CONSTRUCTOR_INFO, - crate::unnecessary_mut_passed::UNNECESSARY_MUT_PASSED_INFO, - crate::unnecessary_owned_empty_strings::UNNECESSARY_OWNED_EMPTY_STRINGS_INFO, - crate::unnecessary_self_imports::UNNECESSARY_SELF_IMPORTS_INFO, - crate::unnecessary_semicolon::UNNECESSARY_SEMICOLON_INFO, - crate::unnecessary_struct_initialization::UNNECESSARY_STRUCT_INITIALIZATION_INFO, - crate::unnecessary_wraps::UNNECESSARY_WRAPS_INFO, - crate::unneeded_struct_pattern::UNNEEDED_STRUCT_PATTERN_INFO, - crate::unnested_or_patterns::UNNESTED_OR_PATTERNS_INFO, - crate::unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME_INFO, - crate::unused_async::UNUSED_ASYNC_INFO, - crate::unused_async::UNUSED_ASYNC_TRAIT_IMPL_INFO, - crate::unused_io_amount::UNUSED_IO_AMOUNT_INFO, - crate::unused_peekable::UNUSED_PEEKABLE_INFO, - crate::unused_result_ok::UNUSED_RESULT_OK_INFO, - crate::unused_rounding::UNUSED_ROUNDING_INFO, - crate::unused_self::UNUSED_SELF_INFO, - crate::unused_trait_names::UNUSED_TRAIT_NAMES_INFO, - crate::unused_unit::UNUSED_UNIT_INFO, - crate::unwrap::PANICKING_UNWRAP_INFO, - crate::unwrap::UNNECESSARY_UNWRAP_INFO, - crate::unwrap_in_result::UNWRAP_IN_RESULT_INFO, - crate::upper_case_acronyms::UPPER_CASE_ACRONYMS_INFO, - crate::use_self::USE_SELF_INFO, - crate::useless_concat::USELESS_CONCAT_INFO, - crate::useless_conversion::USELESS_CONVERSION_INFO, - crate::useless_vec::USELESS_VEC_INFO, - crate::vec_init_then_push::VEC_INIT_THEN_PUSH_INFO, - crate::visibility::NEEDLESS_PUB_SELF_INFO, - crate::visibility::PUB_WITH_SHORTHAND_INFO, - crate::visibility::PUB_WITHOUT_SHORTHAND_INFO, - crate::volatile_composites::VOLATILE_COMPOSITES_INFO, - crate::wildcard_imports::ENUM_GLOB_USE_INFO, - crate::wildcard_imports::WILDCARD_IMPORTS_INFO, - crate::with_capacity_zero::WITH_CAPACITY_ZERO_INFO, - crate::write::PRINT_LITERAL_INFO, - crate::write::PRINT_STDERR_INFO, - crate::write::PRINT_STDOUT_INFO, - crate::write::PRINT_WITH_NEWLINE_INFO, - crate::write::PRINTLN_EMPTY_STRING_INFO, - crate::write::USE_DEBUG_INFO, - crate::write::WRITE_LITERAL_INFO, - crate::write::WRITE_WITH_NEWLINE_INFO, - crate::write::WRITELN_EMPTY_STRING_INFO, - crate::zero_div_zero::ZERO_DIVIDED_BY_ZERO_INFO, - crate::zero_repeat_side_effects::ZERO_REPEAT_SIDE_EFFECTS_INFO, - crate::zero_sized_map_values::ZERO_SIZED_MAP_VALUES_INFO, - crate::zombie_processes::ZOMBIE_PROCESSES_INFO, -]; diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 5f4f626dddca..214d236db00d 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -404,6 +404,3 @@ pub mod zero_div_zero; pub mod zero_repeat_side_effects; pub mod zero_sized_map_values; pub mod zombie_processes; - -pub mod declared_lints; -pub mod deprecated_lints; diff --git a/declare_clippy_lint/src/lib.rs b/declare_clippy_lint/src/lib.rs index 6b1e46404b10..2421f43e638d 100644 --- a/declare_clippy_lint/src/lib.rs +++ b/declare_clippy_lint/src/lib.rs @@ -137,7 +137,7 @@ macro_rules! declare_clippy_lint_inner { $(, @eval_always = $eval_always)? } - pub(crate) static ${concat($lint_name, _INFO)}: &'static $crate::LintInfo = &$crate::LintInfo { + pub static ${concat($lint_name, _INFO)}: $crate::LintInfo = $crate::LintInfo { lint: $lint_name, category: $crate::LintCategory::$category, explanation: concat!($($docs,"\n",)*), diff --git a/clippy_lints/src/deprecated_lints.rs b/src/deprecated_lints.rs similarity index 100% rename from clippy_lints/src/deprecated_lints.rs rename to src/deprecated_lints.rs diff --git a/src/driver.rs b/src/driver.rs index 654874558b60..f0ef4cb71140 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -168,12 +168,12 @@ impl rustc_driver::Callbacks for ClippyCallbacks { } let mut list_builder = LintListBuilder::default(); - list_builder.insert(::clippy_lints::declared_lints::LINTS); + list_builder.insert(::clippy::LINTS); list_builder.register(lint_store); - for (old_name, new_name) in ::clippy_lints::deprecated_lints::RENAMED { + for (old_name, new_name) in ::clippy::RENAMED { lint_store.register_renamed(old_name, new_name); } - for (name, reason) in ::clippy_lints::deprecated_lints::DEPRECATED { + for (name, reason) in ::clippy::DEPRECATED { lint_store.register_removed(name, reason); } diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 000000000000..cfe3e786a0db --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,7 @@ +#![feature(rustc_private)] + +pub mod deprecated_lints; +pub mod lints; + +pub use deprecated_lints::{DEPRECATED, DEPRECATED_VERSION, RENAMED, RENAMED_VERSION}; +pub use lints::LINTS; diff --git a/src/lints.rs b/src/lints.rs new file mode 100644 index 000000000000..69ade5e21446 --- /dev/null +++ b/src/lints.rs @@ -0,0 +1,839 @@ +// This file was generated by `cargo dev update_lints`. +// Use that command to update this file and do not edit by hand. +// Manual edits will be overwritten. + +#[rustfmt::skip] +pub static LINTS: &[&::declare_clippy_lint::LintInfo] = &[ + &::clippy_lints::absolute_paths::ABSOLUTE_PATHS_INFO, + &::clippy_lints::almost_complete_range::ALMOST_COMPLETE_RANGE_INFO, + &::clippy_lints::approx_const::APPROX_CONSTANT_INFO, + &::clippy_lints::arbitrary_source_item_ordering::ARBITRARY_SOURCE_ITEM_ORDERING_INFO, + &::clippy_lints::arc_with_non_send_sync::ARC_WITH_NON_SEND_SYNC_INFO, + &::clippy_lints::as_conversions::AS_CONVERSIONS_INFO, + &::clippy_lints::asm_syntax::INLINE_ASM_X86_ATT_SYNTAX_INFO, + &::clippy_lints::asm_syntax::INLINE_ASM_X86_INTEL_SYNTAX_INFO, + &::clippy_lints::assert_is_empty::ASSERT_IS_EMPTY_INFO, + &::clippy_lints::assertions_on_constants::ASSERTIONS_ON_CONSTANTS_INFO, + &::clippy_lints::assertions_on_result_states::ASSERTIONS_ON_RESULT_STATES_INFO, + &::clippy_lints::assigning_clones::ASSIGNING_CLONES_INFO, + &::clippy_lints::async_yields_async::ASYNC_YIELDS_ASYNC_INFO, + &::clippy_lints::attrs::ALLOW_ATTRIBUTES_INFO, + &::clippy_lints::attrs::ALLOW_ATTRIBUTES_WITHOUT_REASON_INFO, + &::clippy_lints::attrs::BLANKET_CLIPPY_RESTRICTION_LINTS_INFO, + &::clippy_lints::attrs::DEPRECATED_CFG_ATTR_INFO, + &::clippy_lints::attrs::DEPRECATED_CLIPPY_CFG_ATTR_INFO, + &::clippy_lints::attrs::DEPRECATED_SEMVER_INFO, + &::clippy_lints::attrs::DUPLICATED_ATTRIBUTES_INFO, + &::clippy_lints::attrs::IGNORE_WITHOUT_REASON_INFO, + &::clippy_lints::attrs::INLINE_ALWAYS_INFO, + &::clippy_lints::attrs::MIXED_ATTRIBUTES_STYLE_INFO, + &::clippy_lints::attrs::NON_MINIMAL_CFG_INFO, + &::clippy_lints::attrs::REPR_PACKED_WITHOUT_ABI_INFO, + &::clippy_lints::attrs::SHOULD_PANIC_WITHOUT_EXPECT_INFO, + &::clippy_lints::attrs::UNNECESSARY_CLIPPY_CFG_INFO, + &::clippy_lints::attrs::USELESS_ATTRIBUTE_INFO, + &::clippy_lints::await_holding_invalid::AWAIT_HOLDING_INVALID_TYPE_INFO, + &::clippy_lints::await_holding_invalid::AWAIT_HOLDING_LOCK_INFO, + &::clippy_lints::await_holding_invalid::AWAIT_HOLDING_REFCELL_REF_INFO, + &::clippy_lints::bit_width::MANUAL_BIT_WIDTH_INFO, + &::clippy_lints::bit_width::MISMATCHED_BIT_WIDTH_TYPE_INFO, + &::clippy_lints::block_scrutinee::BLOCK_SCRUTINEE_INFO, + &::clippy_lints::blocks_in_conditions::BLOCKS_IN_CONDITIONS_INFO, + &::clippy_lints::bool_assert_comparison::BOOL_ASSERT_COMPARISON_INFO, + &::clippy_lints::bool_comparison::BOOL_COMPARISON_INFO, + &::clippy_lints::bool_to_int_with_if::BOOL_TO_INT_WITH_IF_INFO, + &::clippy_lints::booleans::NONMINIMAL_BOOL_INFO, + &::clippy_lints::booleans::OVERLY_COMPLEX_BOOL_EXPR_INFO, + &::clippy_lints::borrow_deref_ref::BORROW_DEREF_REF_INFO, + &::clippy_lints::box_default::BOX_DEFAULT_INFO, + &::clippy_lints::byte_char_slices::BYTE_CHAR_SLICES_INFO, + &::clippy_lints::cargo::CARGO_COMMON_METADATA_INFO, + &::clippy_lints::cargo::LINT_GROUPS_PRIORITY_INFO, + &::clippy_lints::cargo::MULTIPLE_CRATE_VERSIONS_INFO, + &::clippy_lints::cargo::NEGATIVE_FEATURE_NAMES_INFO, + &::clippy_lints::cargo::REDUNDANT_FEATURE_NAMES_INFO, + &::clippy_lints::cargo::WILDCARD_DEPENDENCIES_INFO, + &::clippy_lints::casts::AS_POINTER_UNDERSCORE_INFO, + &::clippy_lints::casts::AS_PTR_CAST_MUT_INFO, + &::clippy_lints::casts::AS_UNDERSCORE_INFO, + &::clippy_lints::casts::BORROW_AS_PTR_INFO, + &::clippy_lints::casts::CAST_ABS_TO_UNSIGNED_INFO, + &::clippy_lints::casts::CAST_ENUM_CONSTRUCTOR_INFO, + &::clippy_lints::casts::CAST_ENUM_TRUNCATION_INFO, + &::clippy_lints::casts::CAST_LOSSLESS_INFO, + &::clippy_lints::casts::CAST_NAN_TO_INT_INFO, + &::clippy_lints::casts::CAST_POSSIBLE_TRUNCATION_INFO, + &::clippy_lints::casts::CAST_POSSIBLE_WRAP_INFO, + &::clippy_lints::casts::CAST_PRECISION_LOSS_INFO, + &::clippy_lints::casts::CAST_PTR_ALIGNMENT_INFO, + &::clippy_lints::casts::CAST_SIGN_LOSS_INFO, + &::clippy_lints::casts::CAST_SLICE_DIFFERENT_SIZES_INFO, + &::clippy_lints::casts::CAST_SLICE_FROM_RAW_PARTS_INFO, + &::clippy_lints::casts::CHAR_LIT_AS_U8_INFO, + &::clippy_lints::casts::CONFUSING_METHOD_TO_NUMERIC_CAST_INFO, + &::clippy_lints::casts::FN_TO_NUMERIC_CAST_INFO, + &::clippy_lints::casts::FN_TO_NUMERIC_CAST_ANY_INFO, + &::clippy_lints::casts::FN_TO_NUMERIC_CAST_WITH_TRUNCATION_INFO, + &::clippy_lints::casts::MANUAL_DANGLING_PTR_INFO, + &::clippy_lints::casts::NEEDLESS_TYPE_CAST_INFO, + &::clippy_lints::casts::PTR_AS_PTR_INFO, + &::clippy_lints::casts::PTR_CAST_CONSTNESS_INFO, + &::clippy_lints::casts::REF_AS_PTR_INFO, + &::clippy_lints::casts::UNNECESSARY_CAST_INFO, + &::clippy_lints::casts::ZERO_PTR_INFO, + &::clippy_lints::cfg_not_test::CFG_NOT_TEST_INFO, + &::clippy_lints::checked_conversions::CHECKED_CONVERSIONS_INFO, + &::clippy_lints::cloned_ref_to_slice_refs::CLONED_REF_TO_SLICE_REFS_INFO, + &::clippy_lints::coerce_container_to_any::COERCE_CONTAINER_TO_ANY_INFO, + &::clippy_lints::cognitive_complexity::COGNITIVE_COMPLEXITY_INFO, + &::clippy_lints::collapsible_if::COLLAPSIBLE_ELSE_IF_INFO, + &::clippy_lints::collapsible_if::COLLAPSIBLE_IF_INFO, + &::clippy_lints::collection_is_never_read::COLLECTION_IS_NEVER_READ_INFO, + &::clippy_lints::comparison_chain::COMPARISON_CHAIN_INFO, + &::clippy_lints::copy_iterator::COPY_ITERATOR_INFO, + &::clippy_lints::crate_in_macro_def::CRATE_IN_MACRO_DEF_INFO, + &::clippy_lints::create_dir::CREATE_DIR_INFO, + &::clippy_lints::dbg_macro::DBG_MACRO_INFO, + &::clippy_lints::default::DEFAULT_TRAIT_ACCESS_INFO, + &::clippy_lints::default::FIELD_REASSIGN_WITH_DEFAULT_INFO, + &::clippy_lints::default_constructed_unit_structs::DEFAULT_CONSTRUCTED_UNIT_STRUCTS_INFO, + &::clippy_lints::default_instead_of_iter_empty::DEFAULT_INSTEAD_OF_ITER_EMPTY_INFO, + &::clippy_lints::default_numeric_fallback::DEFAULT_NUMERIC_FALLBACK_INFO, + &::clippy_lints::default_union_representation::DEFAULT_UNION_REPRESENTATION_INFO, + &::clippy_lints::definition_in_module_root::DEFINITION_IN_MODULE_ROOT_INFO, + &::clippy_lints::dereference::EXPLICIT_AUTO_DEREF_INFO, + &::clippy_lints::dereference::EXPLICIT_DEREF_METHODS_INFO, + &::clippy_lints::dereference::NEEDLESS_BORROW_INFO, + &::clippy_lints::dereference::REF_BINDING_TO_REFERENCE_INFO, + &::clippy_lints::derivable_impls::DERIVABLE_IMPLS_INFO, + &::clippy_lints::derive::DERIVE_ORD_XOR_PARTIAL_ORD_INFO, + &::clippy_lints::derive::DERIVE_PARTIAL_EQ_WITHOUT_EQ_INFO, + &::clippy_lints::derive::DERIVED_HASH_WITH_MANUAL_EQ_INFO, + &::clippy_lints::derive::EXPL_IMPL_CLONE_ON_COPY_INFO, + &::clippy_lints::derive::UNSAFE_DERIVE_DESERIALIZE_INFO, + &::clippy_lints::disallowed_fields::DISALLOWED_FIELDS_INFO, + &::clippy_lints::disallowed_macros::DISALLOWED_MACROS_INFO, + &::clippy_lints::disallowed_methods::DISALLOWED_METHODS_INFO, + &::clippy_lints::disallowed_names::DISALLOWED_NAMES_INFO, + &::clippy_lints::disallowed_script_idents::DISALLOWED_SCRIPT_IDENTS_INFO, + &::clippy_lints::disallowed_types::DISALLOWED_TYPES_INFO, + &::clippy_lints::doc::DOC_BROKEN_LINK_INFO, + &::clippy_lints::doc::DOC_COMMENT_DOUBLE_SPACE_LINEBREAKS_INFO, + &::clippy_lints::doc::DOC_INCLUDE_WITHOUT_CFG_INFO, + &::clippy_lints::doc::DOC_LAZY_CONTINUATION_INFO, + &::clippy_lints::doc::DOC_LINK_CODE_INFO, + &::clippy_lints::doc::DOC_LINK_WITH_QUOTES_INFO, + &::clippy_lints::doc::DOC_MARKDOWN_INFO, + &::clippy_lints::doc::DOC_NESTED_REFDEFS_INFO, + &::clippy_lints::doc::DOC_OVERINDENTED_LIST_ITEMS_INFO, + &::clippy_lints::doc::DOC_PARAGRAPHS_MISSING_PUNCTUATION_INFO, + &::clippy_lints::doc::DOC_SUSPICIOUS_FOOTNOTES_INFO, + &::clippy_lints::doc::EMPTY_DOCS_INFO, + &::clippy_lints::doc::MISSING_ERRORS_DOC_INFO, + &::clippy_lints::doc::MISSING_PANICS_DOC_INFO, + &::clippy_lints::doc::MISSING_SAFETY_DOC_INFO, + &::clippy_lints::doc::NEEDLESS_DOCTEST_MAIN_INFO, + &::clippy_lints::doc::SUSPICIOUS_DOC_COMMENTS_INFO, + &::clippy_lints::doc::TEST_ATTR_IN_DOCTEST_INFO, + &::clippy_lints::doc::TOO_LONG_FIRST_DOC_PARAGRAPH_INFO, + &::clippy_lints::doc::UNNECESSARY_SAFETY_DOC_INFO, + &::clippy_lints::double_parens::DOUBLE_PARENS_INFO, + &::clippy_lints::drop_forget_ref::DROP_NON_DROP_INFO, + &::clippy_lints::drop_forget_ref::FORGET_NON_DROP_INFO, + &::clippy_lints::drop_forget_ref::MEM_FORGET_INFO, + &::clippy_lints::duplicate_mod::DUPLICATE_MOD_INFO, + &::clippy_lints::duration_suboptimal_units::DURATION_SUBOPTIMAL_UNITS_INFO, + &::clippy_lints::else_if_without_else::ELSE_IF_WITHOUT_ELSE_INFO, + &::clippy_lints::empty_drop::EMPTY_DROP_INFO, + &::clippy_lints::empty_enums::EMPTY_ENUMS_INFO, + &::clippy_lints::empty_line_after::EMPTY_LINE_AFTER_DOC_COMMENTS_INFO, + &::clippy_lints::empty_line_after::EMPTY_LINE_AFTER_OUTER_ATTR_INFO, + &::clippy_lints::empty_with_brackets::EMPTY_ENUM_VARIANTS_WITH_BRACKETS_INFO, + &::clippy_lints::empty_with_brackets::EMPTY_STRUCTS_WITH_BRACKETS_INFO, + &::clippy_lints::endian_bytes::BIG_ENDIAN_BYTES_INFO, + &::clippy_lints::endian_bytes::HOST_ENDIAN_BYTES_INFO, + &::clippy_lints::endian_bytes::LITTLE_ENDIAN_BYTES_INFO, + &::clippy_lints::entry::MAP_ENTRY_INFO, + &::clippy_lints::enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT_INFO, + &::clippy_lints::equatable_if_let::EQUATABLE_IF_LET_INFO, + &::clippy_lints::error_impl_error::ERROR_IMPL_ERROR_INFO, + &::clippy_lints::escape::BOXED_LOCAL_INFO, + &::clippy_lints::eta_reduction::REDUNDANT_CLOSURE_INFO, + &::clippy_lints::eta_reduction::REDUNDANT_CLOSURE_FOR_METHOD_CALLS_INFO, + &::clippy_lints::excessive_bools::FN_PARAMS_EXCESSIVE_BOOLS_INFO, + &::clippy_lints::excessive_bools::STRUCT_EXCESSIVE_BOOLS_INFO, + &::clippy_lints::excessive_nesting::EXCESSIVE_NESTING_INFO, + &::clippy_lints::exhaustive_items::EXHAUSTIVE_ENUMS_INFO, + &::clippy_lints::exhaustive_items::EXHAUSTIVE_STRUCTS_INFO, + &::clippy_lints::exit::EXIT_INFO, + &::clippy_lints::explicit_write::EXPLICIT_WRITE_INFO, + &::clippy_lints::extra_unused_type_parameters::EXTRA_UNUSED_TYPE_PARAMETERS_INFO, + &::clippy_lints::fallible_impl_from::FALLIBLE_IMPL_FROM_INFO, + &::clippy_lints::field_scoped_visibility_modifiers::FIELD_SCOPED_VISIBILITY_MODIFIERS_INFO, + &::clippy_lints::float_literal::EXCESSIVE_PRECISION_INFO, + &::clippy_lints::float_literal::LOSSY_FLOAT_LITERAL_INFO, + &::clippy_lints::floating_point_arithmetic::IMPRECISE_FLOPS_INFO, + &::clippy_lints::floating_point_arithmetic::SUBOPTIMAL_FLOPS_INFO, + &::clippy_lints::format::USELESS_FORMAT_INFO, + &::clippy_lints::format_args::FORMAT_IN_FORMAT_ARGS_INFO, + &::clippy_lints::format_args::POINTER_FORMAT_INFO, + &::clippy_lints::format_args::TO_STRING_IN_FORMAT_ARGS_INFO, + &::clippy_lints::format_args::UNINLINED_FORMAT_ARGS_INFO, + &::clippy_lints::format_args::UNNECESSARY_DEBUG_FORMATTING_INFO, + &::clippy_lints::format_args::UNNECESSARY_TRAILING_COMMA_INFO, + &::clippy_lints::format_args::UNUSED_FORMAT_SPECS_INFO, + &::clippy_lints::format_args::USELESS_BORROWS_IN_FORMATTING_INFO, + &::clippy_lints::format_impl::PRINT_IN_FORMAT_IMPL_INFO, + &::clippy_lints::format_impl::RECURSIVE_FORMAT_IMPL_INFO, + &::clippy_lints::format_push_string::FORMAT_PUSH_STRING_INFO, + &::clippy_lints::formatting::POSSIBLE_MISSING_COMMA_INFO, + &::clippy_lints::formatting::POSSIBLE_MISSING_ELSE_INFO, + &::clippy_lints::formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING_INFO, + &::clippy_lints::formatting::SUSPICIOUS_ELSE_FORMATTING_INFO, + &::clippy_lints::formatting::SUSPICIOUS_UNARY_OP_FORMATTING_INFO, + &::clippy_lints::four_forward_slashes::FOUR_FORWARD_SLASHES_INFO, + &::clippy_lints::from_over_into::FROM_OVER_INTO_INFO, + &::clippy_lints::from_raw_with_void_ptr::FROM_RAW_WITH_VOID_PTR_INFO, + &::clippy_lints::from_str_radix_10::FROM_STR_RADIX_10_INFO, + &::clippy_lints::functions::DOUBLE_MUST_USE_INFO, + &::clippy_lints::functions::DUPLICATE_UNDERSCORE_ARGUMENT_INFO, + &::clippy_lints::functions::IMPL_TRAIT_IN_PARAMS_INFO, + &::clippy_lints::functions::MISNAMED_GETTERS_INFO, + &::clippy_lints::functions::MUST_USE_CANDIDATE_INFO, + &::clippy_lints::functions::MUST_USE_UNIT_INFO, + &::clippy_lints::functions::NOT_UNSAFE_PTR_ARG_DEREF_INFO, + &::clippy_lints::functions::REF_OPTION_INFO, + &::clippy_lints::functions::RENAMED_FUNCTION_PARAMS_INFO, + &::clippy_lints::functions::RESULT_LARGE_ERR_INFO, + &::clippy_lints::functions::RESULT_UNIT_ERR_INFO, + &::clippy_lints::functions::TOO_MANY_ARGUMENTS_INFO, + &::clippy_lints::functions::TOO_MANY_LINES_INFO, + &::clippy_lints::future_not_send::FUTURE_NOT_SEND_INFO, + &::clippy_lints::if_let_mutex::IF_LET_MUTEX_INFO, + &::clippy_lints::if_not_else::IF_NOT_ELSE_INFO, + &::clippy_lints::if_then_some_else_none::IF_THEN_SOME_ELSE_NONE_INFO, + &::clippy_lints::ifs::BRANCHES_SHARING_CODE_INFO, + &::clippy_lints::ifs::IF_SAME_THEN_ELSE_INFO, + &::clippy_lints::ifs::IFS_SAME_COND_INFO, + &::clippy_lints::ifs::SAME_FUNCTIONS_IN_IF_CONDITION_INFO, + &::clippy_lints::ignored_unit_patterns::IGNORED_UNIT_PATTERNS_INFO, + &::clippy_lints::impl_hash_with_borrow_str_and_bytes::IMPL_HASH_BORROW_WITH_STR_AND_BYTES_INFO, + &::clippy_lints::implicit_hasher::IMPLICIT_HASHER_INFO, + &::clippy_lints::implicit_return::IMPLICIT_RETURN_INFO, + &::clippy_lints::implicit_saturating_add::IMPLICIT_SATURATING_ADD_INFO, + &::clippy_lints::implicit_saturating_sub::IMPLICIT_SATURATING_SUB_INFO, + &::clippy_lints::implicit_saturating_sub::INVERTED_SATURATING_SUB_INFO, + &::clippy_lints::implied_bounds_in_impls::IMPLIED_BOUNDS_IN_IMPLS_INFO, + &::clippy_lints::incompatible_msrv::INCOMPATIBLE_MSRV_INFO, + &::clippy_lints::inconsistent_struct_constructor::INCONSISTENT_STRUCT_CONSTRUCTOR_INFO, + &::clippy_lints::index_refutable_slice::INDEX_REFUTABLE_SLICE_INFO, + &::clippy_lints::indexing_slicing::INDEXING_SLICING_INFO, + &::clippy_lints::indexing_slicing::OUT_OF_BOUNDS_INDEXING_INFO, + &::clippy_lints::ineffective_open_options::INEFFECTIVE_OPEN_OPTIONS_INFO, + &::clippy_lints::infallible_try_from::INFALLIBLE_TRY_FROM_INFO, + &::clippy_lints::infinite_iter::INFINITE_ITER_INFO, + &::clippy_lints::infinite_iter::MAYBE_INFINITE_ITER_INFO, + &::clippy_lints::inherent_impl::MULTIPLE_INHERENT_IMPL_INFO, + &::clippy_lints::inherent_to_string::INHERENT_TO_STRING_INFO, + &::clippy_lints::inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY_INFO, + &::clippy_lints::init_numbered_fields::INIT_NUMBERED_FIELDS_INFO, + &::clippy_lints::inline_fn_without_body::INLINE_FN_WITHOUT_BODY_INFO, + &::clippy_lints::inline_trait_bounds::INLINE_TRAIT_BOUNDS_INFO, + &::clippy_lints::int_plus_one::INT_PLUS_ONE_INFO, + &::clippy_lints::item_name_repetitions::ENUM_VARIANT_NAMES_INFO, + &::clippy_lints::item_name_repetitions::MODULE_INCEPTION_INFO, + &::clippy_lints::item_name_repetitions::MODULE_NAME_REPETITIONS_INFO, + &::clippy_lints::item_name_repetitions::STRUCT_FIELD_NAMES_INFO, + &::clippy_lints::items_after_statements::ITEMS_AFTER_STATEMENTS_INFO, + &::clippy_lints::items_after_test_module::ITEMS_AFTER_TEST_MODULE_INFO, + &::clippy_lints::iter_not_returning_iterator::ITER_NOT_RETURNING_ITERATOR_INFO, + &::clippy_lints::iter_over_hash_type::ITER_OVER_HASH_TYPE_INFO, + &::clippy_lints::iter_without_into_iter::INTO_ITER_WITHOUT_ITER_INFO, + &::clippy_lints::iter_without_into_iter::ITER_WITHOUT_INTO_ITER_INFO, + &::clippy_lints::large_const_arrays::LARGE_CONST_ARRAYS_INFO, + &::clippy_lints::large_enum_variant::LARGE_ENUM_VARIANT_INFO, + &::clippy_lints::large_futures::LARGE_FUTURES_INFO, + &::clippy_lints::large_include_file::LARGE_INCLUDE_FILE_INFO, + &::clippy_lints::large_stack_arrays::LARGE_STACK_ARRAYS_INFO, + &::clippy_lints::large_stack_frames::LARGE_STACK_FRAMES_INFO, + &::clippy_lints::legacy_numeric_constants::LEGACY_NUMERIC_CONSTANTS_INFO, + &::clippy_lints::len_without_is_empty::LEN_WITHOUT_IS_EMPTY_INFO, + &::clippy_lints::len_zero::COMPARISON_TO_EMPTY_INFO, + &::clippy_lints::len_zero::LEN_ZERO_INFO, + &::clippy_lints::let_if_seq::USELESS_LET_IF_SEQ_INFO, + &::clippy_lints::let_underscore::LET_UNDERSCORE_FUTURE_INFO, + &::clippy_lints::let_underscore::LET_UNDERSCORE_LOCK_INFO, + &::clippy_lints::let_underscore::LET_UNDERSCORE_MUST_USE_INFO, + &::clippy_lints::let_underscore::LET_UNDERSCORE_UNTYPED_INFO, + &::clippy_lints::let_with_type_underscore::LET_WITH_TYPE_UNDERSCORE_INFO, + &::clippy_lints::lifetimes::ELIDABLE_LIFETIME_NAMES_INFO, + &::clippy_lints::lifetimes::EXTRA_UNUSED_LIFETIMES_INFO, + &::clippy_lints::lifetimes::NEEDLESS_LIFETIMES_INFO, + &::clippy_lints::literal_representation::DECIMAL_LITERAL_REPRESENTATION_INFO, + &::clippy_lints::literal_representation::INCONSISTENT_DIGIT_GROUPING_INFO, + &::clippy_lints::literal_representation::LARGE_DIGIT_GROUPS_INFO, + &::clippy_lints::literal_representation::MISTYPED_LITERAL_SUFFIXES_INFO, + &::clippy_lints::literal_representation::UNREADABLE_LITERAL_INFO, + &::clippy_lints::literal_representation::UNUSUAL_BYTE_GROUPINGS_INFO, + &::clippy_lints::literal_string_with_formatting_args::LITERAL_STRING_WITH_FORMATTING_ARGS_INFO, + &::clippy_lints::loops::CHAR_INDICES_AS_BYTE_INDICES_INFO, + &::clippy_lints::loops::EMPTY_LOOP_INFO, + &::clippy_lints::loops::EXPLICIT_COUNTER_LOOP_INFO, + &::clippy_lints::loops::EXPLICIT_INTO_ITER_LOOP_INFO, + &::clippy_lints::loops::EXPLICIT_ITER_LOOP_INFO, + &::clippy_lints::loops::FOR_KV_MAP_INFO, + &::clippy_lints::loops::FOR_UNBOUNDED_RANGE_INFO, + &::clippy_lints::loops::INFINITE_LOOP_INFO, + &::clippy_lints::loops::ITER_NEXT_LOOP_INFO, + &::clippy_lints::loops::MANUAL_FIND_INFO, + &::clippy_lints::loops::MANUAL_FLATTEN_INFO, + &::clippy_lints::loops::MANUAL_MEMCPY_INFO, + &::clippy_lints::loops::MANUAL_SLICE_FILL_INFO, + &::clippy_lints::loops::MANUAL_WHILE_LET_SOME_INFO, + &::clippy_lints::loops::MISSING_SPIN_LOOP_INFO, + &::clippy_lints::loops::MUT_RANGE_BOUND_INFO, + &::clippy_lints::loops::NEEDLESS_RANGE_LOOP_INFO, + &::clippy_lints::loops::NEVER_LOOP_INFO, + &::clippy_lints::loops::SAME_ITEM_PUSH_INFO, + &::clippy_lints::loops::SINGLE_ELEMENT_LOOP_INFO, + &::clippy_lints::loops::UNUSED_ENUMERATE_INDEX_INFO, + &::clippy_lints::loops::WHILE_FLOAT_INFO, + &::clippy_lints::loops::WHILE_IMMUTABLE_CONDITION_INFO, + &::clippy_lints::loops::WHILE_LET_LOOP_INFO, + &::clippy_lints::loops::WHILE_LET_ON_ITERATOR_INFO, + &::clippy_lints::macro_metavars_in_unsafe::MACRO_METAVARS_IN_UNSAFE_INFO, + &::clippy_lints::macro_use::MACRO_USE_IMPORTS_INFO, + &::clippy_lints::main_recursion::MAIN_RECURSION_INFO, + &::clippy_lints::manual_abs_diff::MANUAL_ABS_DIFF_INFO, + &::clippy_lints::manual_assert::MANUAL_ASSERT_INFO, + &::clippy_lints::manual_assert_eq::MANUAL_ASSERT_EQ_INFO, + &::clippy_lints::manual_async_fn::MANUAL_ASYNC_FN_INFO, + &::clippy_lints::manual_bits::MANUAL_BITS_INFO, + &::clippy_lints::manual_checked_ops::MANUAL_CHECKED_OPS_INFO, + &::clippy_lints::manual_clamp::MANUAL_CLAMP_INFO, + &::clippy_lints::manual_float_methods::MANUAL_IS_FINITE_INFO, + &::clippy_lints::manual_float_methods::MANUAL_IS_INFINITE_INFO, + &::clippy_lints::manual_hash_one::MANUAL_HASH_ONE_INFO, + &::clippy_lints::manual_ignore_case_cmp::MANUAL_IGNORE_CASE_CMP_INFO, + &::clippy_lints::manual_ilog2::MANUAL_ILOG2_INFO, + &::clippy_lints::manual_is_ascii_check::MANUAL_IS_ASCII_CHECK_INFO, + &::clippy_lints::manual_is_power_of_two::MANUAL_IS_POWER_OF_TWO_INFO, + &::clippy_lints::manual_let_else::MANUAL_LET_ELSE_INFO, + &::clippy_lints::manual_main_separator_str::MANUAL_MAIN_SEPARATOR_STR_INFO, + &::clippy_lints::manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE_INFO, + &::clippy_lints::manual_noop_waker::MANUAL_NOOP_WAKER_INFO, + &::clippy_lints::manual_option_as_slice::MANUAL_OPTION_AS_SLICE_INFO, + &::clippy_lints::manual_pop_if::MANUAL_POP_IF_INFO, + &::clippy_lints::manual_range_patterns::MANUAL_RANGE_PATTERNS_INFO, + &::clippy_lints::manual_rem_euclid::MANUAL_REM_EUCLID_INFO, + &::clippy_lints::manual_retain::MANUAL_RETAIN_INFO, + &::clippy_lints::manual_rotate::MANUAL_ROTATE_INFO, + &::clippy_lints::manual_slice_size_calculation::MANUAL_SLICE_SIZE_CALCULATION_INFO, + &::clippy_lints::manual_string_new::MANUAL_STRING_NEW_INFO, + &::clippy_lints::manual_strip::MANUAL_STRIP_INFO, + &::clippy_lints::manual_take::MANUAL_TAKE_INFO, + &::clippy_lints::map_unit_fn::OPTION_MAP_UNIT_FN_INFO, + &::clippy_lints::map_unit_fn::RESULT_MAP_UNIT_FN_INFO, + &::clippy_lints::match_result_ok::MATCH_RESULT_OK_INFO, + &::clippy_lints::matches::COLLAPSIBLE_MATCH_INFO, + &::clippy_lints::matches::INFALLIBLE_DESTRUCTURING_MATCH_INFO, + &::clippy_lints::matches::MANUAL_FILTER_INFO, + &::clippy_lints::matches::MANUAL_MAP_INFO, + &::clippy_lints::matches::MANUAL_OK_ERR_INFO, + &::clippy_lints::matches::MANUAL_UNWRAP_OR_INFO, + &::clippy_lints::matches::MANUAL_UNWRAP_OR_DEFAULT_INFO, + &::clippy_lints::matches::MATCH_AS_REF_INFO, + &::clippy_lints::matches::MATCH_BOOL_INFO, + &::clippy_lints::matches::MATCH_LIKE_MATCHES_MACRO_INFO, + &::clippy_lints::matches::MATCH_OVERLAPPING_ARM_INFO, + &::clippy_lints::matches::MATCH_REF_PATS_INFO, + &::clippy_lints::matches::MATCH_SAME_ARMS_INFO, + &::clippy_lints::matches::MATCH_SINGLE_BINDING_INFO, + &::clippy_lints::matches::MATCH_STR_CASE_MISMATCH_INFO, + &::clippy_lints::matches::MATCH_WILD_ERR_ARM_INFO, + &::clippy_lints::matches::MATCH_WILDCARD_FOR_SINGLE_VARIANTS_INFO, + &::clippy_lints::matches::NEEDLESS_MATCH_INFO, + &::clippy_lints::matches::REDUNDANT_GUARDS_INFO, + &::clippy_lints::matches::REDUNDANT_PATTERN_MATCHING_INFO, + &::clippy_lints::matches::REST_PAT_IN_FULLY_BOUND_STRUCTS_INFO, + &::clippy_lints::matches::SIGNIFICANT_DROP_IN_SCRUTINEE_INFO, + &::clippy_lints::matches::SINGLE_MATCH_INFO, + &::clippy_lints::matches::SINGLE_MATCH_ELSE_INFO, + &::clippy_lints::matches::TRY_ERR_INFO, + &::clippy_lints::matches::WILDCARD_ENUM_MATCH_ARM_INFO, + &::clippy_lints::matches::WILDCARD_IN_OR_PATTERNS_INFO, + &::clippy_lints::mem_replace::MEM_REPLACE_OPTION_WITH_NONE_INFO, + &::clippy_lints::mem_replace::MEM_REPLACE_OPTION_WITH_SOME_INFO, + &::clippy_lints::mem_replace::MEM_REPLACE_WITH_DEFAULT_INFO, + &::clippy_lints::mem_replace::MEM_REPLACE_WITH_UNINIT_INFO, + &::clippy_lints::methods::BIND_INSTEAD_OF_MAP_INFO, + &::clippy_lints::methods::BY_REF_PEEKABLE_PEEK_INFO, + &::clippy_lints::methods::BYTES_COUNT_TO_LEN_INFO, + &::clippy_lints::methods::BYTES_NTH_INFO, + &::clippy_lints::methods::CASE_SENSITIVE_FILE_EXTENSION_COMPARISONS_INFO, + &::clippy_lints::methods::CHARS_LAST_CMP_INFO, + &::clippy_lints::methods::CHARS_NEXT_CMP_INFO, + &::clippy_lints::methods::CHUNKS_EXACT_TO_AS_CHUNKS_INFO, + &::clippy_lints::methods::CLEAR_WITH_DRAIN_INFO, + &::clippy_lints::methods::CLONE_ON_COPY_INFO, + &::clippy_lints::methods::CLONE_ON_REF_PTR_INFO, + &::clippy_lints::methods::CLONED_INSTEAD_OF_COPIED_INFO, + &::clippy_lints::methods::COLLAPSIBLE_STR_REPLACE_INFO, + &::clippy_lints::methods::CONST_IS_EMPTY_INFO, + &::clippy_lints::methods::DOUBLE_ENDED_ITERATOR_LAST_INFO, + &::clippy_lints::methods::DRAIN_COLLECT_INFO, + &::clippy_lints::methods::ERR_EXPECT_INFO, + &::clippy_lints::methods::EXPECT_FUN_CALL_INFO, + &::clippy_lints::methods::EXPECT_USED_INFO, + &::clippy_lints::methods::EXTEND_WITH_DRAIN_INFO, + &::clippy_lints::methods::FILETYPE_IS_FILE_INFO, + &::clippy_lints::methods::FILTER_MAP_BOOL_THEN_INFO, + &::clippy_lints::methods::FILTER_MAP_IDENTITY_INFO, + &::clippy_lints::methods::FILTER_MAP_NEXT_INFO, + &::clippy_lints::methods::FILTER_NEXT_INFO, + &::clippy_lints::methods::FLAT_MAP_IDENTITY_INFO, + &::clippy_lints::methods::FLAT_MAP_OPTION_INFO, + &::clippy_lints::methods::FORMAT_COLLECT_INFO, + &::clippy_lints::methods::GET_FIRST_INFO, + &::clippy_lints::methods::GET_LAST_WITH_LEN_INFO, + &::clippy_lints::methods::GET_UNWRAP_INFO, + &::clippy_lints::methods::IMPLICIT_CLONE_INFO, + &::clippy_lints::methods::INEFFICIENT_TO_STRING_INFO, + &::clippy_lints::methods::INSPECT_FOR_EACH_INFO, + &::clippy_lints::methods::INTO_ITER_ON_REF_INFO, + &::clippy_lints::methods::IO_OTHER_ERROR_INFO, + &::clippy_lints::methods::IP_CONSTANT_INFO, + &::clippy_lints::methods::IS_DIGIT_ASCII_RADIX_INFO, + &::clippy_lints::methods::ITER_CLONED_COLLECT_INFO, + &::clippy_lints::methods::ITER_COUNT_INFO, + &::clippy_lints::methods::ITER_FILTER_IS_OK_INFO, + &::clippy_lints::methods::ITER_FILTER_IS_SOME_INFO, + &::clippy_lints::methods::ITER_KV_MAP_INFO, + &::clippy_lints::methods::ITER_NEXT_SLICE_INFO, + &::clippy_lints::methods::ITER_NTH_INFO, + &::clippy_lints::methods::ITER_NTH_ZERO_INFO, + &::clippy_lints::methods::ITER_ON_EMPTY_COLLECTIONS_INFO, + &::clippy_lints::methods::ITER_ON_SINGLE_ITEMS_INFO, + &::clippy_lints::methods::ITER_OUT_OF_BOUNDS_INFO, + &::clippy_lints::methods::ITER_OVEREAGER_CLONED_INFO, + &::clippy_lints::methods::ITER_SKIP_NEXT_INFO, + &::clippy_lints::methods::ITER_SKIP_ZERO_INFO, + &::clippy_lints::methods::ITER_WITH_DRAIN_INFO, + &::clippy_lints::methods::ITERATOR_STEP_BY_ZERO_INFO, + &::clippy_lints::methods::JOIN_ABSOLUTE_PATHS_INFO, + &::clippy_lints::methods::LINES_FILTER_MAP_OK_INFO, + &::clippy_lints::methods::MANUAL_C_STR_LITERALS_INFO, + &::clippy_lints::methods::MANUAL_CLEAR_INFO, + &::clippy_lints::methods::MANUAL_CONTAINS_INFO, + &::clippy_lints::methods::MANUAL_FILTER_MAP_INFO, + &::clippy_lints::methods::MANUAL_FIND_MAP_INFO, + &::clippy_lints::methods::MANUAL_INSPECT_INFO, + &::clippy_lints::methods::MANUAL_IS_VARIANT_AND_INFO, + &::clippy_lints::methods::MANUAL_NEXT_BACK_INFO, + &::clippy_lints::methods::MANUAL_OK_OR_INFO, + &::clippy_lints::methods::MANUAL_OPTION_ZIP_INFO, + &::clippy_lints::methods::MANUAL_REPEAT_N_INFO, + &::clippy_lints::methods::MANUAL_SATURATING_ARITHMETIC_INFO, + &::clippy_lints::methods::MANUAL_SPLIT_ONCE_INFO, + &::clippy_lints::methods::MANUAL_STR_REPEAT_INFO, + &::clippy_lints::methods::MANUAL_TRY_FOLD_INFO, + &::clippy_lints::methods::MAP_ALL_ANY_IDENTITY_INFO, + &::clippy_lints::methods::MAP_CLONE_INFO, + &::clippy_lints::methods::MAP_COLLECT_RESULT_UNIT_INFO, + &::clippy_lints::methods::MAP_ERR_IGNORE_INFO, + &::clippy_lints::methods::MAP_FLATTEN_INFO, + &::clippy_lints::methods::MAP_IDENTITY_INFO, + &::clippy_lints::methods::MAP_OR_IDENTITY_INFO, + &::clippy_lints::methods::MAP_UNWRAP_OR_INFO, + &::clippy_lints::methods::MAP_WITH_UNUSED_ARGUMENT_OVER_RANGES_INFO, + &::clippy_lints::methods::MUT_MUTEX_LOCK_INFO, + &::clippy_lints::methods::NAIVE_BYTECOUNT_INFO, + &::clippy_lints::methods::NEEDLESS_AS_BYTES_INFO, + &::clippy_lints::methods::NEEDLESS_CHARACTER_ITERATION_INFO, + &::clippy_lints::methods::NEEDLESS_COLLECT_INFO, + &::clippy_lints::methods::NEEDLESS_OPTION_AS_DEREF_INFO, + &::clippy_lints::methods::NEEDLESS_OPTION_TAKE_INFO, + &::clippy_lints::methods::NEEDLESS_SPLITN_INFO, + &::clippy_lints::methods::NEW_RET_NO_SELF_INFO, + &::clippy_lints::methods::NO_EFFECT_REPLACE_INFO, + &::clippy_lints::methods::NONSENSICAL_OPEN_OPTIONS_INFO, + &::clippy_lints::methods::OBFUSCATED_IF_ELSE_INFO, + &::clippy_lints::methods::OK_EXPECT_INFO, + &::clippy_lints::methods::OPTION_AS_REF_CLONED_INFO, + &::clippy_lints::methods::OPTION_AS_REF_DEREF_INFO, + &::clippy_lints::methods::OPTION_FILTER_MAP_INFO, + &::clippy_lints::methods::OPTION_MAP_OR_NONE_INFO, + &::clippy_lints::methods::OPTION_ZIP_NONE_INFO, + &::clippy_lints::methods::OR_FUN_CALL_INFO, + &::clippy_lints::methods::OR_THEN_UNWRAP_INFO, + &::clippy_lints::methods::PATH_BUF_PUSH_OVERWRITE_INFO, + &::clippy_lints::methods::PATH_ENDS_WITH_EXT_INFO, + &::clippy_lints::methods::PTR_OFFSET_BY_LITERAL_INFO, + &::clippy_lints::methods::PTR_OFFSET_WITH_CAST_INFO, + &::clippy_lints::methods::RANGE_ZIP_WITH_LEN_INFO, + &::clippy_lints::methods::READ_LINE_WITHOUT_TRIM_INFO, + &::clippy_lints::methods::READONLY_WRITE_LOCK_INFO, + &::clippy_lints::methods::REDUNDANT_AS_STR_INFO, + &::clippy_lints::methods::REDUNDANT_ITER_CLONED_INFO, + &::clippy_lints::methods::REPEAT_ONCE_INFO, + &::clippy_lints::methods::RESULT_FILTER_MAP_INFO, + &::clippy_lints::methods::RESULT_MAP_OR_INTO_OPTION_INFO, + &::clippy_lints::methods::RETURN_AND_THEN_INFO, + &::clippy_lints::methods::SEARCH_IS_SOME_INFO, + &::clippy_lints::methods::SEEK_FROM_CURRENT_INFO, + &::clippy_lints::methods::SEEK_TO_START_INSTEAD_OF_REWIND_INFO, + &::clippy_lints::methods::SHOULD_IMPLEMENT_TRAIT_INFO, + &::clippy_lints::methods::SINGLE_CHAR_ADD_STR_INFO, + &::clippy_lints::methods::SKIP_WHILE_NEXT_INFO, + &::clippy_lints::methods::SLICED_STRING_AS_BYTES_INFO, + &::clippy_lints::methods::SOME_FILTER_INFO, + &::clippy_lints::methods::STABLE_SORT_PRIMITIVE_INFO, + &::clippy_lints::methods::STR_SPLIT_AT_NEWLINE_INFO, + &::clippy_lints::methods::STRING_EXTEND_CHARS_INFO, + &::clippy_lints::methods::STRING_LIT_CHARS_ANY_INFO, + &::clippy_lints::methods::SUSPICIOUS_COMMAND_ARG_SPACE_INFO, + &::clippy_lints::methods::SUSPICIOUS_MAP_INFO, + &::clippy_lints::methods::SUSPICIOUS_OPEN_OPTIONS_INFO, + &::clippy_lints::methods::SUSPICIOUS_SPLITN_INFO, + &::clippy_lints::methods::SUSPICIOUS_TO_OWNED_INFO, + &::clippy_lints::methods::SWAP_WITH_TEMPORARY_INFO, + &::clippy_lints::methods::TYPE_ID_ON_BOX_INFO, + &::clippy_lints::methods::UNBUFFERED_BYTES_INFO, + &::clippy_lints::methods::UNINIT_ASSUMED_INIT_INFO, + &::clippy_lints::methods::UNIT_HASH_INFO, + &::clippy_lints::methods::UNNECESSARY_FALLIBLE_CONVERSIONS_INFO, + &::clippy_lints::methods::UNNECESSARY_FILTER_MAP_INFO, + &::clippy_lints::methods::UNNECESSARY_FIND_MAP_INFO, + &::clippy_lints::methods::UNNECESSARY_FIRST_THEN_CHECK_INFO, + &::clippy_lints::methods::UNNECESSARY_FOLD_INFO, + &::clippy_lints::methods::UNNECESSARY_GET_THEN_CHECK_INFO, + &::clippy_lints::methods::UNNECESSARY_JOIN_INFO, + &::clippy_lints::methods::UNNECESSARY_LAZY_EVALUATIONS_INFO, + &::clippy_lints::methods::UNNECESSARY_LITERAL_UNWRAP_INFO, + &::clippy_lints::methods::UNNECESSARY_MAP_OR_INFO, + &::clippy_lints::methods::UNNECESSARY_MIN_OR_MAX_INFO, + &::clippy_lints::methods::UNNECESSARY_OPTION_MAP_OR_ELSE_INFO, + &::clippy_lints::methods::UNNECESSARY_RESULT_MAP_OR_ELSE_INFO, + &::clippy_lints::methods::UNNECESSARY_SORT_BY_INFO, + &::clippy_lints::methods::UNNECESSARY_TO_OWNED_INFO, + &::clippy_lints::methods::UNNECESSARY_UNWRAP_UNCHECKED_INFO, + &::clippy_lints::methods::UNWRAP_OR_DEFAULT_INFO, + &::clippy_lints::methods::UNWRAP_USED_INFO, + &::clippy_lints::methods::USELESS_ASREF_INFO, + &::clippy_lints::methods::USELESS_NONZERO_NEW_UNCHECKED_INFO, + &::clippy_lints::methods::VEC_RESIZE_TO_ZERO_INFO, + &::clippy_lints::methods::VERBOSE_FILE_READS_INFO, + &::clippy_lints::methods::WAKER_CLONE_WAKE_INFO, + &::clippy_lints::methods::WRONG_SELF_CONVENTION_INFO, + &::clippy_lints::methods::ZST_OFFSET_INFO, + &::clippy_lints::min_ident_chars::MIN_IDENT_CHARS_INFO, + &::clippy_lints::minmax::MIN_MAX_INFO, + &::clippy_lints::misc::SHORT_CIRCUIT_STATEMENT_INFO, + &::clippy_lints::misc::USED_UNDERSCORE_BINDING_INFO, + &::clippy_lints::misc::USED_UNDERSCORE_ITEMS_INFO, + &::clippy_lints::misc_early::BUILTIN_TYPE_SHADOW_INFO, + &::clippy_lints::misc_early::MIXED_CASE_HEX_LITERALS_INFO, + &::clippy_lints::misc_early::REDUNDANT_AT_REST_PATTERN_INFO, + &::clippy_lints::misc_early::REDUNDANT_PATTERN_INFO, + &::clippy_lints::misc_early::SEPARATED_LITERAL_SUFFIX_INFO, + &::clippy_lints::misc_early::UNNEEDED_FIELD_PATTERN_INFO, + &::clippy_lints::misc_early::UNNEEDED_WILDCARD_PATTERN_INFO, + &::clippy_lints::misc_early::UNSEPARATED_LITERAL_SUFFIX_INFO, + &::clippy_lints::misc_early::ZERO_PREFIXED_LITERAL_INFO, + &::clippy_lints::mismatching_type_param_order::MISMATCHING_TYPE_PARAM_ORDER_INFO, + &::clippy_lints::missing_assert_message::MISSING_ASSERT_MESSAGE_INFO, + &::clippy_lints::missing_asserts_for_indexing::MISSING_ASSERTS_FOR_INDEXING_INFO, + &::clippy_lints::missing_const_for_fn::MISSING_CONST_FOR_FN_INFO, + &::clippy_lints::missing_const_for_thread_local::MISSING_CONST_FOR_THREAD_LOCAL_INFO, + &::clippy_lints::missing_doc::MISSING_DOCS_IN_PRIVATE_ITEMS_INFO, + &::clippy_lints::missing_enforced_import_rename::MISSING_ENFORCED_IMPORT_RENAMES_INFO, + &::clippy_lints::missing_fields_in_debug::MISSING_FIELDS_IN_DEBUG_INFO, + &::clippy_lints::missing_inline::MISSING_INLINE_IN_PUBLIC_ITEMS_INFO, + &::clippy_lints::missing_trait_methods::MISSING_TRAIT_METHODS_INFO, + &::clippy_lints::mixed_read_write_in_expression::DIVERGING_SUB_EXPRESSION_INFO, + &::clippy_lints::mixed_read_write_in_expression::MIXED_READ_WRITE_IN_EXPRESSION_INFO, + &::clippy_lints::module_style::INLINE_MODULES_INFO, + &::clippy_lints::module_style::MOD_MODULE_FILES_INFO, + &::clippy_lints::module_style::SELF_NAMED_MODULE_FILES_INFO, + &::clippy_lints::multi_assignments::MULTI_ASSIGNMENTS_INFO, + &::clippy_lints::multiple_bound_locations::MULTIPLE_BOUND_LOCATIONS_INFO, + &::clippy_lints::multiple_unsafe_ops_per_block::MULTIPLE_UNSAFE_OPS_PER_BLOCK_INFO, + &::clippy_lints::mut_key::MUTABLE_KEY_TYPE_INFO, + &::clippy_lints::mut_mut::MUT_MUT_INFO, + &::clippy_lints::mutable_debug_assertion::DEBUG_ASSERT_WITH_MUT_CALL_INFO, + &::clippy_lints::mutex_atomic::MUTEX_ATOMIC_INFO, + &::clippy_lints::mutex_atomic::MUTEX_INTEGER_INFO, + &::clippy_lints::needless_arbitrary_self_type::NEEDLESS_ARBITRARY_SELF_TYPE_INFO, + &::clippy_lints::needless_bool::NEEDLESS_BOOL_INFO, + &::clippy_lints::needless_bool::NEEDLESS_BOOL_ASSIGN_INFO, + &::clippy_lints::needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE_INFO, + &::clippy_lints::needless_borrows_for_generic_args::NEEDLESS_BORROWS_FOR_GENERIC_ARGS_INFO, + &::clippy_lints::needless_continue::NEEDLESS_CONTINUE_INFO, + &::clippy_lints::needless_else::NEEDLESS_ELSE_INFO, + &::clippy_lints::needless_for_each::NEEDLESS_FOR_EACH_INFO, + &::clippy_lints::needless_ifs::NEEDLESS_IFS_INFO, + &::clippy_lints::needless_late_init::NEEDLESS_LATE_INIT_INFO, + &::clippy_lints::needless_maybe_sized::NEEDLESS_MAYBE_SIZED_INFO, + &::clippy_lints::needless_nonzero_get::NEEDLESS_NONZERO_GET_INFO, + &::clippy_lints::needless_parens_on_range_literals::NEEDLESS_PARENS_ON_RANGE_LITERALS_INFO, + &::clippy_lints::needless_pass_by_ref_mut::NEEDLESS_PASS_BY_REF_MUT_INFO, + &::clippy_lints::needless_pass_by_value::NEEDLESS_PASS_BY_VALUE_INFO, + &::clippy_lints::needless_question_mark::NEEDLESS_QUESTION_MARK_INFO, + &::clippy_lints::needless_update::NEEDLESS_UPDATE_INFO, + &::clippy_lints::neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD_INFO, + &::clippy_lints::neg_multiply::NEG_MULTIPLY_INFO, + &::clippy_lints::new_without_default::NEW_WITHOUT_DEFAULT_INFO, + &::clippy_lints::no_effect::NO_EFFECT_INFO, + &::clippy_lints::no_effect::NO_EFFECT_UNDERSCORE_BINDING_INFO, + &::clippy_lints::no_effect::UNNECESSARY_OPERATION_INFO, + &::clippy_lints::no_mangle_with_rust_abi::NO_MANGLE_WITH_RUST_ABI_INFO, + &::clippy_lints::non_canonical_impls::NON_CANONICAL_CLONE_IMPL_INFO, + &::clippy_lints::non_canonical_impls::NON_CANONICAL_PARTIAL_ORD_IMPL_INFO, + &::clippy_lints::non_copy_const::BORROW_INTERIOR_MUTABLE_CONST_INFO, + &::clippy_lints::non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST_INFO, + &::clippy_lints::non_expressive_names::JUST_UNDERSCORES_AND_DIGITS_INFO, + &::clippy_lints::non_expressive_names::MANY_SINGLE_CHAR_NAMES_INFO, + &::clippy_lints::non_expressive_names::SIMILAR_NAMES_INFO, + &::clippy_lints::non_octal_unix_permissions::NON_OCTAL_UNIX_PERMISSIONS_INFO, + &::clippy_lints::non_send_fields_in_send_ty::NON_SEND_FIELDS_IN_SEND_TY_INFO, + &::clippy_lints::non_std_lazy_statics::NON_STD_LAZY_STATICS_INFO, + &::clippy_lints::non_zero_suggestions::NON_ZERO_SUGGESTIONS_INFO, + &::clippy_lints::nonnull_unchecked_on_box_ptr::NONNULL_UNCHECKED_ON_BOX_PTR_INFO, + &::clippy_lints::nonstandard_macro_braces::NONSTANDARD_MACRO_BRACES_INFO, + &::clippy_lints::octal_escapes::OCTAL_ESCAPES_INFO, + &::clippy_lints::only_used_in_recursion::ONLY_USED_IN_RECURSION_INFO, + &::clippy_lints::only_used_in_recursion::SELF_ONLY_USED_IN_RECURSION_INFO, + &::clippy_lints::operators::ABSURD_EXTREME_COMPARISONS_INFO, + &::clippy_lints::operators::ARITHMETIC_SIDE_EFFECTS_INFO, + &::clippy_lints::operators::ASSIGN_OP_PATTERN_INFO, + &::clippy_lints::operators::BAD_BIT_MASK_INFO, + &::clippy_lints::operators::CMP_OWNED_INFO, + &::clippy_lints::operators::DECIMAL_BITWISE_OPERANDS_INFO, + &::clippy_lints::operators::DOUBLE_COMPARISONS_INFO, + &::clippy_lints::operators::DURATION_SUBSEC_INFO, + &::clippy_lints::operators::EQ_OP_INFO, + &::clippy_lints::operators::ERASING_OP_INFO, + &::clippy_lints::operators::FLOAT_ARITHMETIC_INFO, + &::clippy_lints::operators::FLOAT_CMP_INFO, + &::clippy_lints::operators::FLOAT_CMP_CONST_INFO, + &::clippy_lints::operators::FLOAT_EQUALITY_WITHOUT_ABS_INFO, + &::clippy_lints::operators::IDENTITY_OP_INFO, + &::clippy_lints::operators::IMPOSSIBLE_COMPARISONS_INFO, + &::clippy_lints::operators::INEFFECTIVE_BIT_MASK_INFO, + &::clippy_lints::operators::INTEGER_DIVISION_INFO, + &::clippy_lints::operators::INTEGER_DIVISION_REMAINDER_USED_INFO, + &::clippy_lints::operators::INVALID_UPCAST_COMPARISONS_INFO, + &::clippy_lints::operators::MANUAL_DIV_CEIL_INFO, + &::clippy_lints::operators::MANUAL_IS_MULTIPLE_OF_INFO, + &::clippy_lints::operators::MANUAL_ISOLATE_LOWEST_ONE_INFO, + &::clippy_lints::operators::MANUAL_MIDPOINT_INFO, + &::clippy_lints::operators::MISREFACTORED_ASSIGN_OP_INFO, + &::clippy_lints::operators::MODULO_ARITHMETIC_INFO, + &::clippy_lints::operators::MODULO_ONE_INFO, + &::clippy_lints::operators::NEEDLESS_BITWISE_BOOL_INFO, + &::clippy_lints::operators::OP_REF_INFO, + &::clippy_lints::operators::REDUNDANT_COMPARISONS_INFO, + &::clippy_lints::operators::SELF_ASSIGNMENT_INFO, + &::clippy_lints::operators::VERBOSE_BIT_MASK_INFO, + &::clippy_lints::option_env_unwrap::OPTION_ENV_UNWRAP_INFO, + &::clippy_lints::option_if_let_else::OPTION_IF_LET_ELSE_INFO, + &::clippy_lints::panic_in_result_fn::PANIC_IN_RESULT_FN_INFO, + &::clippy_lints::panic_unimplemented::PANIC_INFO, + &::clippy_lints::panic_unimplemented::TODO_INFO, + &::clippy_lints::panic_unimplemented::UNIMPLEMENTED_INFO, + &::clippy_lints::panic_unimplemented::UNREACHABLE_INFO, + &::clippy_lints::panicking_overflow_checks::PANICKING_OVERFLOW_CHECKS_INFO, + &::clippy_lints::partial_pub_fields::PARTIAL_PUB_FIELDS_INFO, + &::clippy_lints::partialeq_ne_impl::PARTIALEQ_NE_IMPL_INFO, + &::clippy_lints::partialeq_to_none::PARTIALEQ_TO_NONE_INFO, + &::clippy_lints::pass_by_ref_or_value::LARGE_TYPES_PASSED_BY_VALUE_INFO, + &::clippy_lints::pass_by_ref_or_value::TRIVIALLY_COPY_PASS_BY_REF_INFO, + &::clippy_lints::pathbuf_init_then_push::PATHBUF_INIT_THEN_PUSH_INFO, + &::clippy_lints::pattern_type_mismatch::PATTERN_TYPE_MISMATCH_INFO, + &::clippy_lints::permissions_set_readonly_false::PERMISSIONS_SET_READONLY_FALSE_INFO, + &::clippy_lints::pointers_in_nomem_asm_block::POINTERS_IN_NOMEM_ASM_BLOCK_INFO, + &::clippy_lints::precedence::PRECEDENCE_INFO, + &::clippy_lints::precedence::PRECEDENCE_BITS_INFO, + &::clippy_lints::ptr::CMP_NULL_INFO, + &::clippy_lints::ptr::MUT_FROM_REF_INFO, + &::clippy_lints::ptr::PTR_ARG_INFO, + &::clippy_lints::ptr::PTR_EQ_INFO, + &::clippy_lints::pub_underscore_fields::PUB_UNDERSCORE_FIELDS_INFO, + &::clippy_lints::pub_use::PUB_USE_INFO, + &::clippy_lints::question_mark::QUESTION_MARK_INFO, + &::clippy_lints::question_mark_used::QUESTION_MARK_USED_INFO, + &::clippy_lints::ranges::MANUAL_RANGE_CONTAINS_INFO, + &::clippy_lints::ranges::RANGE_MINUS_ONE_INFO, + &::clippy_lints::ranges::RANGE_PLUS_ONE_INFO, + &::clippy_lints::ranges::REVERSED_EMPTY_RANGES_INFO, + &::clippy_lints::raw_strings::NEEDLESS_RAW_STRING_HASHES_INFO, + &::clippy_lints::raw_strings::NEEDLESS_RAW_STRINGS_INFO, + &::clippy_lints::rc_clone_in_vec_init::RC_CLONE_IN_VEC_INIT_INFO, + &::clippy_lints::read_zero_byte_vec::READ_ZERO_BYTE_VEC_INFO, + &::clippy_lints::redundant_async_block::REDUNDANT_ASYNC_BLOCK_INFO, + &::clippy_lints::redundant_clone::REDUNDANT_CLONE_INFO, + &::clippy_lints::redundant_closure_call::REDUNDANT_CLOSURE_CALL_INFO, + &::clippy_lints::redundant_else::REDUNDANT_ELSE_INFO, + &::clippy_lints::redundant_field_names::REDUNDANT_FIELD_NAMES_INFO, + &::clippy_lints::redundant_locals::REDUNDANT_LOCALS_INFO, + &::clippy_lints::redundant_pub_crate::REDUNDANT_PUB_CRATE_INFO, + &::clippy_lints::redundant_slicing::DEREF_BY_SLICING_INFO, + &::clippy_lints::redundant_slicing::REDUNDANT_SLICING_INFO, + &::clippy_lints::redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES_INFO, + &::clippy_lints::redundant_test_prefix::REDUNDANT_TEST_PREFIX_INFO, + &::clippy_lints::redundant_type_annotations::REDUNDANT_TYPE_ANNOTATIONS_INFO, + &::clippy_lints::ref_option_ref::REF_OPTION_REF_INFO, + &::clippy_lints::ref_patterns::REF_PATTERNS_INFO, + &::clippy_lints::reference::DEREF_ADDROF_INFO, + &::clippy_lints::regex::INVALID_REGEX_INFO, + &::clippy_lints::regex::REGEX_CREATION_IN_LOOPS_INFO, + &::clippy_lints::regex::TRIVIAL_REGEX_INFO, + &::clippy_lints::repeat_vec_with_capacity::REPEAT_VEC_WITH_CAPACITY_INFO, + &::clippy_lints::replace_box::REPLACE_BOX_INFO, + &::clippy_lints::reserve_after_initialization::RESERVE_AFTER_INITIALIZATION_INFO, + &::clippy_lints::rest_when_destructuring_struct::REST_PATTERN_ACCESSIBLE_FIELD_INFO, + &::clippy_lints::rest_when_destructuring_struct::UNNECESSARY_REST_PATTERN_INFO, + &::clippy_lints::return_self_not_must_use::RETURN_SELF_NOT_MUST_USE_INFO, + &::clippy_lints::returns::LET_AND_RETURN_INFO, + &::clippy_lints::returns::NEEDLESS_RETURN_INFO, + &::clippy_lints::returns::NEEDLESS_RETURN_WITH_QUESTION_MARK_INFO, + &::clippy_lints::same_length_and_capacity::SAME_LENGTH_AND_CAPACITY_INFO, + &::clippy_lints::same_name_method::SAME_NAME_METHOD_INFO, + &::clippy_lints::self_named_constructors::SELF_NAMED_CONSTRUCTORS_INFO, + &::clippy_lints::semicolon_block::SEMICOLON_INSIDE_BLOCK_INFO, + &::clippy_lints::semicolon_block::SEMICOLON_OUTSIDE_BLOCK_INFO, + &::clippy_lints::semicolon_if_nothing_returned::SEMICOLON_IF_NOTHING_RETURNED_INFO, + &::clippy_lints::serde_api::SERDE_API_MISUSE_INFO, + &::clippy_lints::set_contains_or_insert::SET_CONTAINS_OR_INSERT_INFO, + &::clippy_lints::shadow::SHADOW_REUSE_INFO, + &::clippy_lints::shadow::SHADOW_SAME_INFO, + &::clippy_lints::shadow::SHADOW_UNRELATED_INFO, + &::clippy_lints::significant_drop_tightening::SIGNIFICANT_DROP_TIGHTENING_INFO, + &::clippy_lints::single_call_fn::SINGLE_CALL_FN_INFO, + &::clippy_lints::single_char_lifetime_names::SINGLE_CHAR_LIFETIME_NAMES_INFO, + &::clippy_lints::single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS_INFO, + &::clippy_lints::single_option_map::SINGLE_OPTION_MAP_INFO, + &::clippy_lints::single_range_in_vec_init::SINGLE_RANGE_IN_VEC_INIT_INFO, + &::clippy_lints::size_of_in_element_count::SIZE_OF_IN_ELEMENT_COUNT_INFO, + &::clippy_lints::size_of_ref::SIZE_OF_REF_INFO, + &::clippy_lints::slow_vector_initialization::SLOW_VECTOR_INITIALIZATION_INFO, + &::clippy_lints::std_instead_of_core::ALLOC_INSTEAD_OF_CORE_INFO, + &::clippy_lints::std_instead_of_core::STD_INSTEAD_OF_ALLOC_INFO, + &::clippy_lints::std_instead_of_core::STD_INSTEAD_OF_CORE_INFO, + &::clippy_lints::string_patterns::MANUAL_PATTERN_CHAR_COMPARISON_INFO, + &::clippy_lints::string_patterns::SINGLE_CHAR_PATTERN_INFO, + &::clippy_lints::strings::STR_TO_STRING_INFO, + &::clippy_lints::strings::STRING_ADD_INFO, + &::clippy_lints::strings::STRING_ADD_ASSIGN_INFO, + &::clippy_lints::strings::STRING_FROM_UTF8_AS_BYTES_INFO, + &::clippy_lints::strings::STRING_LIT_AS_BYTES_INFO, + &::clippy_lints::strings::STRING_SLICE_INFO, + &::clippy_lints::strings::TRIM_SPLIT_WHITESPACE_INFO, + &::clippy_lints::strlen_on_c_strings::STRLEN_ON_C_STRINGS_INFO, + &::clippy_lints::suspicious_operation_groupings::SUSPICIOUS_OPERATION_GROUPINGS_INFO, + &::clippy_lints::suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL_INFO, + &::clippy_lints::suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL_INFO, + &::clippy_lints::suspicious_xor_used_as_pow::SUSPICIOUS_XOR_USED_AS_POW_INFO, + &::clippy_lints::swap::ALMOST_SWAPPED_INFO, + &::clippy_lints::swap::MANUAL_SWAP_INFO, + &::clippy_lints::swap_ptr_to_ref::SWAP_PTR_TO_REF_INFO, + &::clippy_lints::tabs_in_doc_comments::TABS_IN_DOC_COMMENTS_INFO, + &::clippy_lints::temporary_assignment::TEMPORARY_ASSIGNMENT_INFO, + &::clippy_lints::tests_outside_test_module::TESTS_OUTSIDE_TEST_MODULE_INFO, + &::clippy_lints::time_subtraction::MANUAL_INSTANT_ELAPSED_INFO, + &::clippy_lints::time_subtraction::UNCHECKED_TIME_SUBTRACTION_INFO, + &::clippy_lints::to_digit_is_some::TO_DIGIT_IS_SOME_INFO, + &::clippy_lints::to_string_trait_impl::TO_STRING_TRAIT_IMPL_INFO, + &::clippy_lints::toplevel_ref_arg::TOPLEVEL_REF_ARG_INFO, + &::clippy_lints::trailing_empty_array::TRAILING_EMPTY_ARRAY_INFO, + &::clippy_lints::trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS_INFO, + &::clippy_lints::trait_bounds::TYPE_REPETITION_IN_BOUNDS_INFO, + &::clippy_lints::transmute::CROSSPOINTER_TRANSMUTE_INFO, + &::clippy_lints::transmute::EAGER_TRANSMUTE_INFO, + &::clippy_lints::transmute::MISSING_TRANSMUTE_ANNOTATIONS_INFO, + &::clippy_lints::transmute::TRANSMUTE_BYTES_TO_STR_INFO, + &::clippy_lints::transmute::TRANSMUTE_INT_TO_BOOL_INFO, + &::clippy_lints::transmute::TRANSMUTE_INT_TO_NON_ZERO_INFO, + &::clippy_lints::transmute::TRANSMUTE_NULL_TO_FN_INFO, + &::clippy_lints::transmute::TRANSMUTE_PTR_TO_PTR_INFO, + &::clippy_lints::transmute::TRANSMUTE_PTR_TO_REF_INFO, + &::clippy_lints::transmute::TRANSMUTE_UNDEFINED_REPR_INFO, + &::clippy_lints::transmute::TRANSMUTES_EXPRESSIBLE_AS_PTR_CASTS_INFO, + &::clippy_lints::transmute::TRANSMUTING_NULL_INFO, + &::clippy_lints::transmute::UNSOUND_COLLECTION_TRANSMUTE_INFO, + &::clippy_lints::transmute::USELESS_TRANSMUTE_INFO, + &::clippy_lints::transmute::WRONG_TRANSMUTE_INFO, + &::clippy_lints::tuple_array_conversions::TUPLE_ARRAY_CONVERSIONS_INFO, + &::clippy_lints::types::BORROWED_BOX_INFO, + &::clippy_lints::types::BOX_COLLECTION_INFO, + &::clippy_lints::types::LINKEDLIST_INFO, + &::clippy_lints::types::OPTION_OPTION_INFO, + &::clippy_lints::types::OWNED_COW_INFO, + &::clippy_lints::types::RC_BUFFER_INFO, + &::clippy_lints::types::RC_MUTEX_INFO, + &::clippy_lints::types::REDUNDANT_ALLOCATION_INFO, + &::clippy_lints::types::TYPE_COMPLEXITY_INFO, + &::clippy_lints::types::VEC_BOX_INFO, + &::clippy_lints::unconditional_recursion::UNCONDITIONAL_RECURSION_INFO, + &::clippy_lints::undocumented_unsafe_blocks::UNDOCUMENTED_UNSAFE_BLOCKS_INFO, + &::clippy_lints::undocumented_unsafe_blocks::UNNECESSARY_SAFETY_COMMENT_INFO, + &::clippy_lints::unicode::INVISIBLE_CHARACTERS_INFO, + &::clippy_lints::unicode::NON_ASCII_LITERAL_INFO, + &::clippy_lints::unicode::UNICODE_NOT_NFC_INFO, + &::clippy_lints::uninhabited_references::UNINHABITED_REFERENCES_INFO, + &::clippy_lints::uninit_vec::UNINIT_VEC_INFO, + &::clippy_lints::unit_return_expecting_ord::UNIT_RETURN_EXPECTING_ORD_INFO, + &::clippy_lints::unit_types::LET_UNIT_VALUE_INFO, + &::clippy_lints::unit_types::UNIT_ARG_INFO, + &::clippy_lints::unit_types::UNIT_CMP_INFO, + &::clippy_lints::unnecessary_box_returns::UNNECESSARY_BOX_RETURNS_INFO, + &::clippy_lints::unnecessary_literal_bound::UNNECESSARY_LITERAL_BOUND_INFO, + &::clippy_lints::unnecessary_map_on_constructor::UNNECESSARY_MAP_ON_CONSTRUCTOR_INFO, + &::clippy_lints::unnecessary_mut_passed::UNNECESSARY_MUT_PASSED_INFO, + &::clippy_lints::unnecessary_owned_empty_strings::UNNECESSARY_OWNED_EMPTY_STRINGS_INFO, + &::clippy_lints::unnecessary_self_imports::UNNECESSARY_SELF_IMPORTS_INFO, + &::clippy_lints::unnecessary_semicolon::UNNECESSARY_SEMICOLON_INFO, + &::clippy_lints::unnecessary_struct_initialization::UNNECESSARY_STRUCT_INITIALIZATION_INFO, + &::clippy_lints::unnecessary_wraps::UNNECESSARY_WRAPS_INFO, + &::clippy_lints::unneeded_struct_pattern::UNNEEDED_STRUCT_PATTERN_INFO, + &::clippy_lints::unnested_or_patterns::UNNESTED_OR_PATTERNS_INFO, + &::clippy_lints::unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME_INFO, + &::clippy_lints::unused_async::UNUSED_ASYNC_INFO, + &::clippy_lints::unused_async::UNUSED_ASYNC_TRAIT_IMPL_INFO, + &::clippy_lints::unused_io_amount::UNUSED_IO_AMOUNT_INFO, + &::clippy_lints::unused_peekable::UNUSED_PEEKABLE_INFO, + &::clippy_lints::unused_result_ok::UNUSED_RESULT_OK_INFO, + &::clippy_lints::unused_rounding::UNUSED_ROUNDING_INFO, + &::clippy_lints::unused_self::UNUSED_SELF_INFO, + &::clippy_lints::unused_trait_names::UNUSED_TRAIT_NAMES_INFO, + &::clippy_lints::unused_unit::UNUSED_UNIT_INFO, + &::clippy_lints::unwrap::PANICKING_UNWRAP_INFO, + &::clippy_lints::unwrap::UNNECESSARY_UNWRAP_INFO, + &::clippy_lints::unwrap_in_result::UNWRAP_IN_RESULT_INFO, + &::clippy_lints::upper_case_acronyms::UPPER_CASE_ACRONYMS_INFO, + &::clippy_lints::use_self::USE_SELF_INFO, + &::clippy_lints::useless_concat::USELESS_CONCAT_INFO, + &::clippy_lints::useless_conversion::USELESS_CONVERSION_INFO, + &::clippy_lints::useless_vec::USELESS_VEC_INFO, + &::clippy_lints::vec_init_then_push::VEC_INIT_THEN_PUSH_INFO, + &::clippy_lints::visibility::NEEDLESS_PUB_SELF_INFO, + &::clippy_lints::visibility::PUB_WITH_SHORTHAND_INFO, + &::clippy_lints::visibility::PUB_WITHOUT_SHORTHAND_INFO, + &::clippy_lints::volatile_composites::VOLATILE_COMPOSITES_INFO, + &::clippy_lints::wildcard_imports::ENUM_GLOB_USE_INFO, + &::clippy_lints::wildcard_imports::WILDCARD_IMPORTS_INFO, + &::clippy_lints::with_capacity_zero::WITH_CAPACITY_ZERO_INFO, + &::clippy_lints::write::PRINT_LITERAL_INFO, + &::clippy_lints::write::PRINT_STDERR_INFO, + &::clippy_lints::write::PRINT_STDOUT_INFO, + &::clippy_lints::write::PRINT_WITH_NEWLINE_INFO, + &::clippy_lints::write::PRINTLN_EMPTY_STRING_INFO, + &::clippy_lints::write::USE_DEBUG_INFO, + &::clippy_lints::write::WRITE_LITERAL_INFO, + &::clippy_lints::write::WRITE_WITH_NEWLINE_INFO, + &::clippy_lints::write::WRITELN_EMPTY_STRING_INFO, + &::clippy_lints::zero_div_zero::ZERO_DIVIDED_BY_ZERO_INFO, + &::clippy_lints::zero_repeat_side_effects::ZERO_REPEAT_SIDE_EFFECTS_INFO, + &::clippy_lints::zero_sized_map_values::ZERO_SIZED_MAP_VALUES_INFO, + &::clippy_lints::zombie_processes::ZOMBIE_PROCESSES_INFO, +]; diff --git a/src/main.rs b/src/main.rs index 0a1981e0f910..5254a11785bb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,6 @@ extern crate rustc_driver; use clippy_config::{Conf, sanitize_explanation}; -use clippy_lints::declared_lints; use std::env; use std::io::Write as _; use std::path::PathBuf; @@ -28,7 +27,7 @@ fn show_version() { fn explain(name: &str) -> i32 { let target = format!("clippy::{}", name.to_ascii_uppercase()); - if let Some(&info) = declared_lints::LINTS.iter().find(|info| info.lint.name == target) { + if let Some(&info) = ::clippy::LINTS.iter().find(|&&info| info.lint.name == target) { println!("{}", sanitize_explanation(info.explanation)); // Check if the lint has configuration let mut mdconf = Conf::get_metadata(); diff --git a/tests/compile-test.rs b/tests/compile-test.rs index 03a74f0b3325..9d6c304e5a31 100644 --- a/tests/compile-test.rs +++ b/tests/compile-test.rs @@ -7,8 +7,6 @@ use askama::filters::Safe; use cargo_metadata::Message; use cargo_metadata::diagnostic::{Applicability, Diagnostic}; use clippy_config::ConfMetadata; -use clippy_lints::declared_lints::LINTS; -use clippy_lints::deprecated_lints::{DEPRECATED, DEPRECATED_VERSION, RENAMED}; use declare_clippy_lint::LintInfo; use pulldown_cmark::{Options, Parser, html}; use serde::Deserialize; @@ -554,12 +552,12 @@ impl DiagnosticCollector { } let configs = clippy_config::Conf::get_metadata(); - let mut metadata: Vec = LINTS + let mut metadata: Vec = ::clippy::LINTS .iter() - .map(|lint| LintMetadata::new(lint, &applicabilities, &configs)) + .map(|&lint| LintMetadata::new(lint, &applicabilities, &configs)) .chain( - iter::zip(DEPRECATED, DEPRECATED_VERSION) - .map(|((lint, reason), version)| LintMetadata::new_deprecated(lint, reason, version)), + iter::zip(::clippy::DEPRECATED, ::clippy::DEPRECATED_VERSION) + .map(|(&(lint, reason), &version)| LintMetadata::new_deprecated(lint, reason, version)), ) .collect(); @@ -568,7 +566,7 @@ impl DiagnosticCollector { fs::write( "util/gh-pages/index.html", Renderer { - count: LINTS.len(), + count: ::clippy::LINTS.len(), lints: &metadata, } .render() @@ -631,10 +629,10 @@ impl LintMetadata { .get(&name) .cloned() .unwrap_or(Applicability::Unspecified); - let past_names = RENAMED + let past_names = ::clippy::RENAMED .iter() - .filter(|(_, new_name)| new_name.strip_prefix("clippy::") == Some(&name)) - .map(|(old_name, _)| old_name.strip_prefix("clippy::").unwrap()) + .filter(|&&(_, new_name)| new_name.strip_prefix("clippy::") == Some(&name)) + .map(|&(old_name, _)| old_name.strip_prefix("clippy::").unwrap()) .collect::>(); let mut docs = lint.explanation.to_string(); if !past_names.is_empty() { diff --git a/tests/config-consistency.rs b/tests/config-consistency.rs index f60d72a45687..75a5bc545a1f 100644 --- a/tests/config-consistency.rs +++ b/tests/config-consistency.rs @@ -14,7 +14,7 @@ fn config_consistency() { return; } - let lint_names: HashSet = clippy_lints::declared_lints::LINTS + let lint_names: HashSet = ::clippy::LINTS .iter() .map(|lint_info| lint_info.lint.name.strip_prefix("clippy::").unwrap().to_lowercase()) .collect();