Store deprecated lints as an array of tuples.

Remove legacy deprecations.
Remove "View Source" link for deprecated lints.
This commit is contained in:
Jason Newcomb 2024-07-29 12:37:50 -04:00
parent 1672d5d4ed
commit 2c34d58159
20 changed files with 547 additions and 946 deletions

View file

@ -5830,6 +5830,7 @@ Released 2018-09-13
[`result_unit_err`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [`result_unit_err`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err
[`result_unwrap_used`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_unwrap_used [`result_unwrap_used`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_unwrap_used
[`return_self_not_must_use`]: https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use [`return_self_not_must_use`]: https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
[`reverse_range_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#reverse_range_loop
[`reversed_empty_ranges`]: https://rust-lang.github.io/rust-clippy/master/index.html#reversed_empty_ranges [`reversed_empty_ranges`]: https://rust-lang.github.io/rust-clippy/master/index.html#reversed_empty_ranges
[`same_functions_in_if_condition`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_functions_in_if_condition [`same_functions_in_if_condition`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_functions_in_if_condition
[`same_item_push`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push [`same_item_push`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push

View file

@ -3,6 +3,12 @@ use std::process::Command;
use std::time::{Duration, SystemTime}; use std::time::{Duration, SystemTime};
use std::{env, thread}; use std::{env, thread};
#[cfg(windows)]
const PYTHON: &str = "python";
#[cfg(not(windows))]
const PYTHON: &str = "python3";
/// # Panics /// # Panics
/// ///
/// Panics if the python commands could not be spawned /// Panics if the python commands could not be spawned
@ -23,7 +29,7 @@ pub fn run(port: u16, lint: Option<String>) -> ! {
} }
if let Some(url) = url.take() { if let Some(url) = url.take() {
thread::spawn(move || { thread::spawn(move || {
Command::new("python3") Command::new(PYTHON)
.arg("-m") .arg("-m")
.arg("http.server") .arg("http.server")
.arg(port.to_string()) .arg(port.to_string())

View file

@ -1,13 +1,12 @@
use crate::clippy_project_root; use crate::clippy_project_root;
use aho_corasick::AhoCorasickBuilder; use aho_corasick::AhoCorasickBuilder;
use indoc::writedoc;
use itertools::Itertools; use itertools::Itertools;
use rustc_lexer::{tokenize, unescape, LiteralKind, TokenKind}; use rustc_lexer::{tokenize, unescape, LiteralKind, TokenKind};
use std::collections::{HashMap, HashSet}; use std::collections::{HashMap, HashSet};
use std::ffi::OsStr; use std::ffi::OsStr;
use std::fmt::{self, Write}; use std::fmt::{self, Write};
use std::fs::{self, OpenOptions}; use std::fs::{self, OpenOptions};
use std::io::{self, Read, Seek, SeekFrom, Write as _}; use std::io::{self, Read, Seek, Write as _};
use std::ops::Range; use std::ops::Range;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use walkdir::{DirEntry, WalkDir}; use walkdir::{DirEntry, WalkDir};
@ -77,12 +76,8 @@ fn generate_lint_files(
for lint in usable_lints for lint in usable_lints
.iter() .iter()
.map(|l| &*l.name) .map(|l| &*l.name)
.chain(deprecated_lints.iter().map(|l| &*l.name)) .chain(deprecated_lints.iter().filter_map(|l| l.name.strip_prefix("clippy::")))
.chain( .chain(renamed_lints.iter().filter_map(|l| l.old_name.strip_prefix("clippy::")))
renamed_lints
.iter()
.map(|l| l.old_name.strip_prefix("clippy::").unwrap_or(&l.old_name)),
)
.sorted() .sorted()
{ {
writeln!(res, "[`{lint}`]: {DOCS_LINK}#{lint}").unwrap(); writeln!(res, "[`{lint}`]: {DOCS_LINK}#{lint}").unwrap();
@ -108,11 +103,6 @@ fn generate_lint_files(
update_mode, update_mode,
&gen_declared_lints(internal_lints.iter(), usable_lints.iter()), &gen_declared_lints(internal_lints.iter(), usable_lints.iter()),
); );
process_file(
"clippy_lints/src/lib.deprecated.rs",
update_mode,
&gen_deprecated(deprecated_lints),
);
let content = gen_deprecated_lints_test(deprecated_lints); let content = gen_deprecated_lints_test(deprecated_lints);
process_file("tests/ui/deprecated.rs", update_mode, &content); process_file("tests/ui/deprecated.rs", update_mode, &content);
@ -205,7 +195,7 @@ pub fn rename(old_name: &str, new_name: &str, uplift: bool) {
let ext = f.path().extension(); let ext = f.path().extension();
(ext == Some(OsStr::new("rs")) || ext == Some(OsStr::new("fixed"))) (ext == Some(OsStr::new("rs")) || ext == Some(OsStr::new("fixed")))
&& name != Some(OsStr::new("rename.rs")) && name != Some(OsStr::new("rename.rs"))
&& name != Some(OsStr::new("renamed_lints.rs")) && name != Some(OsStr::new("deprecated_lints.rs"))
}) })
{ {
rewrite_file(file.path(), |s| { rewrite_file(file.path(), |s| {
@ -213,6 +203,19 @@ pub fn rename(old_name: &str, new_name: &str, uplift: bool) {
}); });
} }
let version = crate::new_lint::get_stabilization_version();
rewrite_file(Path::new("clippy_lints/src/deprecated_lints.rs"), |s| {
insert_at_marker(
s,
"// end renamed lints. used by `cargo dev rename_lint`",
&format!(
"#[clippy::version = \"{version}\"]\n \
(\"{}\", \"{}\"),\n ",
lint.old_name, lint.new_name,
),
)
});
renamed_lints.push(lint); renamed_lints.push(lint);
renamed_lints.sort_by(|lhs, rhs| { renamed_lints.sort_by(|lhs, rhs| {
lhs.new_name lhs.new_name
@ -222,11 +225,6 @@ pub fn rename(old_name: &str, new_name: &str, uplift: bool) {
.then_with(|| lhs.old_name.cmp(&rhs.old_name)) .then_with(|| lhs.old_name.cmp(&rhs.old_name))
}); });
write_file(
Path::new("clippy_lints/src/renamed_lints.rs"),
&gen_renamed_lints_list(&renamed_lints),
);
if uplift { if uplift {
write_file(Path::new("tests/ui/rename.rs"), &gen_renamed_lints_test(&renamed_lints)); write_file(Path::new("tests/ui/rename.rs"), &gen_renamed_lints_test(&renamed_lints));
println!( println!(
@ -293,7 +291,8 @@ pub fn rename(old_name: &str, new_name: &str, uplift: bool) {
// Don't change `clippy_utils/src/renamed_lints.rs` here as it would try to edit the lint being // Don't change `clippy_utils/src/renamed_lints.rs` here as it would try to edit the lint being
// renamed. // renamed.
for (_, file) in clippy_lints_src_files().filter(|(rel_path, _)| rel_path != OsStr::new("renamed_lints.rs")) { for (_, file) in clippy_lints_src_files().filter(|(rel_path, _)| rel_path != OsStr::new("deprecated_lints.rs"))
{
rewrite_file(file.path(), |s| replace_ident_like(s, replacements)); rewrite_file(file.path(), |s| replace_ident_like(s, replacements));
} }
@ -315,32 +314,16 @@ const DEFAULT_DEPRECATION_REASON: &str = "default deprecation note";
/// ///
/// If a file path could not read from or written to /// If a file path could not read from or written to
pub fn deprecate(name: &str, reason: Option<&str>) { pub fn deprecate(name: &str, reason: Option<&str>) {
fn finish(
(lints, mut deprecated_lints, renamed_lints): (Vec<Lint>, Vec<DeprecatedLint>, Vec<RenamedLint>),
name: &str,
reason: &str,
) {
deprecated_lints.push(DeprecatedLint {
name: name.to_string(),
reason: reason.to_string(),
declaration_range: Range::default(),
});
generate_lint_files(UpdateMode::Change, &lints, &deprecated_lints, &renamed_lints);
println!("info: `{name}` has successfully been deprecated");
if reason == DEFAULT_DEPRECATION_REASON {
println!("note: the deprecation reason must be updated in `clippy_lints/src/deprecated_lints.rs`");
}
println!("note: you must run `cargo uitest` to update the test results");
}
let reason = reason.unwrap_or(DEFAULT_DEPRECATION_REASON); let reason = reason.unwrap_or(DEFAULT_DEPRECATION_REASON);
let name_lower = name.to_lowercase(); let prefixed_name = if name.starts_with("clippy::") {
let name_upper = name.to_uppercase(); name.to_owned()
} else {
format!("clippy::{name}")
};
let stripped_name = &prefixed_name[8..];
let (mut lints, deprecated_lints, renamed_lints) = gather_all(); let (mut lints, mut deprecated_lints, renamed_lints) = gather_all();
let Some(lint) = lints.iter().find(|l| l.name == name_lower) else { let Some(lint) = lints.iter().find(|l| l.name == stripped_name) else {
eprintln!("error: failed to find lint `{name}`"); eprintln!("error: failed to find lint `{name}`");
return; return;
}; };
@ -357,13 +340,31 @@ pub fn deprecate(name: &str, reason: Option<&str>) {
let deprecated_lints_path = &*clippy_project_root().join("clippy_lints/src/deprecated_lints.rs"); let deprecated_lints_path = &*clippy_project_root().join("clippy_lints/src/deprecated_lints.rs");
if remove_lint_declaration(&name_lower, &mod_path, &mut lints).unwrap_or(false) { if remove_lint_declaration(stripped_name, &mod_path, &mut lints).unwrap_or(false) {
declare_deprecated(&name_upper, deprecated_lints_path, reason).unwrap(); let version = crate::new_lint::get_stabilization_version();
finish((lints, deprecated_lints, renamed_lints), name, reason); rewrite_file(deprecated_lints_path, |s| {
return; insert_at_marker(
} s,
"// end deprecated lints. used by `cargo dev deprecate_lint`",
&format!("#[clippy::version = \"{version}\"]\n (\"{prefixed_name}\", \"{reason}\"),\n ",),
)
});
eprintln!("error: lint not found"); deprecated_lints.push(DeprecatedLint {
name: prefixed_name,
reason: reason.into(),
});
generate_lint_files(UpdateMode::Change, &lints, &deprecated_lints, &renamed_lints);
println!("info: `{name}` has successfully been deprecated");
if reason == DEFAULT_DEPRECATION_REASON {
println!("note: the deprecation reason must be updated in `clippy_lints/src/deprecated_lints.rs`");
}
println!("note: you must run `cargo uitest` to update the test results");
} else {
eprintln!("error: lint not found");
}
} }
fn remove_lint_declaration(name: &str, path: &Path, lints: &mut Vec<Lint>) -> io::Result<bool> { fn remove_lint_declaration(name: &str, path: &Path, lints: &mut Vec<Lint>) -> io::Result<bool> {
@ -465,37 +466,6 @@ fn remove_lint_declaration(name: &str, path: &Path, lints: &mut Vec<Lint>) -> io
Ok(false) Ok(false)
} }
fn declare_deprecated(name: &str, path: &Path, reason: &str) -> io::Result<()> {
let mut file = OpenOptions::new().write(true).open(path)?;
file.seek(SeekFrom::End(0))?;
let version = crate::new_lint::get_stabilization_version();
let deprecation_reason = if reason == DEFAULT_DEPRECATION_REASON {
"TODO"
} else {
reason
};
writedoc!(
file,
"
declare_deprecated_lint! {{
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// {deprecation_reason}
#[clippy::version = \"{version}\"]
pub {name},
\"{reason}\"
}}
"
)
}
/// Replace substrings if they aren't bordered by identifier characters. Returns `None` if there /// Replace substrings if they aren't bordered by identifier characters. Returns `None` if there
/// were no replacements. /// were no replacements.
fn replace_ident_like(contents: &str, replacements: &[(&str, &str)]) -> Option<String> { fn replace_ident_like(contents: &str, replacements: &[(&str, &str)]) -> Option<String> {
@ -604,14 +574,12 @@ impl Lint {
struct DeprecatedLint { struct DeprecatedLint {
name: String, name: String,
reason: String, reason: String,
declaration_range: Range<usize>,
} }
impl DeprecatedLint { impl DeprecatedLint {
fn new(name: &str, reason: &str, declaration_range: Range<usize>) -> Self { fn new(name: &str, reason: &str) -> Self {
Self { Self {
name: name.to_lowercase(), name: remove_line_splices(name),
reason: remove_line_splices(reason), reason: remove_line_splices(reason),
declaration_range,
} }
} }
} }
@ -629,28 +597,6 @@ impl RenamedLint {
} }
} }
/// Generates the `register_removed` code
#[must_use]
fn gen_deprecated(lints: &[DeprecatedLint]) -> String {
let mut output = GENERATED_FILE_COMMENT.to_string();
output.push_str("{\n");
for lint in lints {
let _: fmt::Result = write!(
output,
concat!(
" store.register_removed(\n",
" \"clippy::{}\",\n",
" \"{}\",\n",
" );\n"
),
lint.name, lint.reason,
);
}
output.push_str("}\n");
output
}
/// Generates the code for registering lints /// Generates the code for registering lints
#[must_use] #[must_use]
fn gen_declared_lints<'a>( fn gen_declared_lints<'a>(
@ -680,7 +626,7 @@ fn gen_declared_lints<'a>(
fn gen_deprecated_lints_test(lints: &[DeprecatedLint]) -> String { fn gen_deprecated_lints_test(lints: &[DeprecatedLint]) -> String {
let mut res: String = GENERATED_FILE_COMMENT.into(); let mut res: String = GENERATED_FILE_COMMENT.into();
for lint in lints { for lint in lints {
writeln!(res, "#![warn(clippy::{})]", lint.name).unwrap(); writeln!(res, "#![warn({})] //~ ERROR: lint `{}`", lint.name, lint.name).unwrap();
} }
res.push_str("\nfn main() {}\n"); res.push_str("\nfn main() {}\n");
res res
@ -699,27 +645,13 @@ fn gen_renamed_lints_test(lints: &[RenamedLint]) -> String {
seen_lints.clear(); seen_lints.clear();
for lint in lints { for lint in lints {
if seen_lints.insert(&lint.old_name) { if seen_lints.insert(&lint.old_name) {
writeln!(res, "#![warn({})]", lint.old_name).unwrap(); writeln!(res, "#![warn({})] //~ ERROR: lint `{}`", lint.old_name, lint.old_name).unwrap();
} }
} }
res.push_str("\nfn main() {}\n"); res.push_str("\nfn main() {}\n");
res res
} }
fn gen_renamed_lints_list(lints: &[RenamedLint]) -> String {
const HEADER: &str = "\
// This file is managed by `cargo dev rename_lint`. Prefer using that when possible.\n\n\
#[rustfmt::skip]\n\
pub static RENAMED_LINTS: &[(&str, &str)] = &[\n";
let mut res = String::from(HEADER);
for lint in lints {
writeln!(res, " (\"{}\", \"{}\"),", lint.old_name, lint.new_name).unwrap();
}
res.push_str("];\n");
res
}
/// Gathers all lints defined in `clippy_lints/src` /// Gathers all lints defined in `clippy_lints/src`
fn gather_all() -> (Vec<Lint>, Vec<DeprecatedLint>, Vec<RenamedLint>) { fn gather_all() -> (Vec<Lint>, Vec<DeprecatedLint>, Vec<RenamedLint>) {
let mut lints = Vec::with_capacity(1000); let mut lints = Vec::with_capacity(1000);
@ -744,10 +676,10 @@ fn gather_all() -> (Vec<Lint>, Vec<DeprecatedLint>, Vec<RenamedLint>) {
module.strip_suffix(".rs").unwrap_or(&module) module.strip_suffix(".rs").unwrap_or(&module)
}; };
match module { if module == "deprecated_lints" {
"deprecated_lints" => parse_deprecated_contents(&contents, &mut deprecated_lints), parse_deprecated_contents(&contents, &mut deprecated_lints, &mut renamed_lints);
"renamed_lints" => parse_renamed_contents(&contents, &mut renamed_lints), } else {
_ => parse_contents(&contents, module, &mut lints), parse_contents(&contents, module, &mut lints);
} }
} }
(lints, deprecated_lints, renamed_lints) (lints, deprecated_lints, renamed_lints)
@ -848,54 +780,37 @@ fn parse_contents(contents: &str, module: &str, lints: &mut Vec<Lint>) {
} }
/// Parse a source file looking for `declare_deprecated_lint` macro invocations. /// Parse a source file looking for `declare_deprecated_lint` macro invocations.
fn parse_deprecated_contents(contents: &str, lints: &mut Vec<DeprecatedLint>) { fn parse_deprecated_contents(contents: &str, deprecated: &mut Vec<DeprecatedLint>, renamed: &mut Vec<RenamedLint>) {
let mut offset = 0usize; let Some((_, contents)) = contents.split_once("\ndeclare_with_version! { DEPRECATED") else {
let mut iter = tokenize(contents).map(|t| { return;
let range = offset..offset + t.len as usize; };
offset = range.end; let Some((deprecated_src, renamed_src)) = contents.split_once("\ndeclare_with_version! { RENAMED") else {
return;
};
LintDeclSearchResult { for line in deprecated_src.lines() {
token_kind: t.kind, let mut offset = 0usize;
content: &contents[range.clone()], let mut iter = tokenize(line).map(|t| {
range, let range = offset..offset + t.len as usize;
} offset = range.end;
});
while let Some(LintDeclSearchResult { range, .. }) = iter.find( LintDeclSearchResult {
|LintDeclSearchResult { token_kind: t.kind,
token_kind, content, .. content: &line[range.clone()],
}| token_kind == &TokenKind::Ident && *content == "declare_deprecated_lint", range,
) { }
let start = range.start;
let mut iter = iter.by_ref().filter(|LintDeclSearchResult { ref token_kind, .. }| {
!matches!(token_kind, TokenKind::Whitespace | TokenKind::LineComment { .. })
}); });
let (name, reason) = match_tokens!( let (name, reason) = match_tokens!(
iter, iter,
// !{ // ("old_name",
Bang OpenBrace Whitespace OpenParen Literal{kind: LiteralKind::Str{..},..}(name) Comma
// #[clippy::version = "version"] // "new_name"),
Pound OpenBracket Ident Colon Colon Ident Eq Literal{..} CloseBracket Whitespace Literal{kind: LiteralKind::Str{..},..}(reason) CloseParen Comma
// pub LINT_NAME,
Ident Ident(name) Comma
// "description"
Literal{kind: LiteralKind::Str{..},..}(reason)
); );
deprecated.push(DeprecatedLint::new(name, reason));
if let Some(LintDeclSearchResult {
token_kind: TokenKind::CloseBrace,
range,
..
}) = iter.next()
{
lints.push(DeprecatedLint::new(name, reason, start..range.end));
}
} }
} for line in renamed_src.lines() {
fn parse_renamed_contents(contents: &str, lints: &mut Vec<RenamedLint>) {
for line in contents.lines() {
let mut offset = 0usize; let mut offset = 0usize;
let mut iter = tokenize(line).map(|t| { let mut iter = tokenize(line).map(|t| {
let range = offset..offset + t.len as usize; let range = offset..offset + t.len as usize;
@ -915,7 +830,7 @@ fn parse_renamed_contents(contents: &str, lints: &mut Vec<RenamedLint>) {
// "new_name"), // "new_name"),
Whitespace Literal{kind: LiteralKind::Str{..},..}(new_name) CloseParen Comma Whitespace Literal{kind: LiteralKind::Str{..},..}(new_name) CloseParen Comma
); );
lints.push(RenamedLint::new(old_name, new_name)); renamed.push(RenamedLint::new(old_name, new_name));
} }
} }
@ -1015,6 +930,12 @@ fn panic_file(error: io::Error, name: &Path, action: &str) -> ! {
panic!("failed to {action} file `{}`: {error}", name.display()) panic!("failed to {action} file `{}`: {error}", name.display())
} }
fn insert_at_marker(text: &str, marker: &str, new_text: &str) -> Option<String> {
let i = text.find(marker)?;
let (pre, post) = text.split_at(i);
Some([pre, new_text, post].into_iter().collect())
}
fn rewrite_file(path: &Path, f: impl FnOnce(&str) -> Option<String>) { fn rewrite_file(path: &Path, f: impl FnOnce(&str) -> Option<String>) {
let mut file = OpenOptions::new() let mut file = OpenOptions::new()
.write(true) .write(true)
@ -1084,31 +1005,6 @@ mod tests {
assert_eq!(expected, result); assert_eq!(expected, result);
} }
#[test]
fn test_parse_deprecated_contents() {
static DEPRECATED_CONTENTS: &str = r#"
/// some doc comment
declare_deprecated_lint! {
#[clippy::version = "I'm a version"]
pub SHOULD_ASSERT_EQ,
"`assert!()` will be more flexible with RFC 2011"
}
"#;
let mut result = Vec::new();
parse_deprecated_contents(DEPRECATED_CONTENTS, &mut result);
for r in &mut result {
r.declaration_range = Range::default();
}
let expected = vec![DeprecatedLint::new(
"should_assert_eq",
"\"`assert!()` will be more flexible with RFC 2011\"",
Range::default(),
)];
assert_eq!(expected, result);
}
#[test] #[test]
fn test_usable_lints() { fn test_usable_lints() {
let lints = vec![ let lints = vec![
@ -1177,34 +1073,4 @@ mod tests {
); );
assert_eq!(expected, Lint::by_lint_group(lints.into_iter())); assert_eq!(expected, Lint::by_lint_group(lints.into_iter()));
} }
#[test]
fn test_gen_deprecated() {
let lints = vec![
DeprecatedLint::new(
"should_assert_eq",
"\"has been superseded by should_assert_eq2\"",
Range::default(),
),
DeprecatedLint::new("another_deprecated", "\"will be removed\"", Range::default()),
];
let expected = GENERATED_FILE_COMMENT.to_string()
+ &[
"{",
" store.register_removed(",
" \"clippy::should_assert_eq\",",
" \"has been superseded by should_assert_eq2\",",
" );",
" store.register_removed(",
" \"clippy::another_deprecated\",",
" \"will be removed\",",
" );",
"}",
]
.join("\n")
+ "\n";
assert_eq!(expected, gen_deprecated(&lints));
}
} }

View file

@ -1,180 +1,181 @@
// NOTE: Entries should be created with `cargo dev deprecate` // This file is managed by `cargo dev rename_lint` and `cargo dev deprecate_lint`.
// Prefer to use those when possible.
/// This struct fakes the `Lint` declaration that is usually created by `declare_lint!`. This macro_rules! declare_with_version {
/// enables the simple extraction of the metadata without changing the current deprecation ($name:ident($name_version:ident): &[$ty:ty] = &[$(
/// declaration. #[clippy::version = $version:literal]
pub struct ClippyDeprecatedLint { $e:expr,
#[allow(dead_code)] )*]) => {
pub desc: &'static str, pub static $name: &[$ty] = &[$($e),*];
#[allow(unused)]
pub static $name_version: &[&str] = &[$($version),*];
};
} }
#[macro_export] #[rustfmt::skip]
macro_rules! declare_deprecated_lint { declare_with_version! { DEPRECATED(DEPRECATED_VERSION): &[(&str, &str)] = &[
{ $(#[$attr:meta])* pub $name: ident, $reason: literal} => {
$(#[$attr])*
#[allow(dead_code)]
pub static $name: ClippyDeprecatedLint = ClippyDeprecatedLint {
desc: $reason
};
}
}
declare_deprecated_lint! {
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// This used to check for `assert!(a == b)` and recommend
/// replacement with `assert_eq!(a, b)`, but this is no longer needed after RFC 2011.
#[clippy::version = "pre 1.29.0"] #[clippy::version = "pre 1.29.0"]
pub SHOULD_ASSERT_EQ, ("clippy::should_assert_eq", "`assert!(a == b)` can now print the values the same way `assert_eq!(a, b) can"),
"`assert!()` will be more flexible with RFC 2011"
}
declare_deprecated_lint! {
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// This used to check for `Vec::extend`, which was slower than
/// `Vec::extend_from_slice`. Thanks to specialization, this is no longer true.
#[clippy::version = "pre 1.29.0"] #[clippy::version = "pre 1.29.0"]
pub EXTEND_FROM_SLICE, ("clippy::extend_from_slice", "`Vec::extend_from_slice` is no longer faster than `Vec::extend` due to specialization"),
"`.extend_from_slice(_)` is a faster way to extend a Vec by a slice"
}
declare_deprecated_lint! {
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// `Range::step_by(0)` used to be linted since it's
/// an infinite iterator, which is better expressed by `iter::repeat`,
/// but the method has been removed for `Iterator::step_by` which panics
/// if given a zero
#[clippy::version = "pre 1.29.0"] #[clippy::version = "pre 1.29.0"]
pub RANGE_STEP_BY_ZERO, ("clippy::range_step_by_zero", "`Iterator::step_by(0)` now panics and is no longer an infinite iterator"),
"`iterator.step_by(0)` panics nowadays"
}
declare_deprecated_lint! {
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// This used to check for `Vec::as_slice`, which was unstable with good
/// stable alternatives. `Vec::as_slice` has now been stabilized.
#[clippy::version = "pre 1.29.0"] #[clippy::version = "pre 1.29.0"]
pub UNSTABLE_AS_SLICE, ("clippy::unstable_as_slice", "`Vec::as_slice` is now stable"),
"`Vec::as_slice` has been stabilized in 1.7"
}
declare_deprecated_lint! {
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// This used to check for `Vec::as_mut_slice`, which was unstable with good
/// stable alternatives. `Vec::as_mut_slice` has now been stabilized.
#[clippy::version = "pre 1.29.0"] #[clippy::version = "pre 1.29.0"]
pub UNSTABLE_AS_MUT_SLICE, ("clippy::unstable_as_mut_slice", "`Vec::as_mut_slice` is now stable"),
"`Vec::as_mut_slice` has been stabilized in 1.7"
}
declare_deprecated_lint! {
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// This lint should never have applied to non-pointer types, as transmuting
/// between non-pointer types of differing alignment is well-defined behavior (it's semantically
/// equivalent to a memcpy). This lint has thus been refactored into two separate lints:
/// cast_ptr_alignment and transmute_ptr_to_ptr.
#[clippy::version = "pre 1.29.0"] #[clippy::version = "pre 1.29.0"]
pub MISALIGNED_TRANSMUTE, ("clippy::misaligned_transmute", "split into `clippy::cast_ptr_alignment` and `clippy::transmute_ptr_to_ptr`"),
"this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr"
}
declare_deprecated_lint! {
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// This lint is too subjective, not having a good reason for being in clippy.
/// Additionally, compound assignment operators may be overloaded separately from their non-assigning
/// counterparts, so this lint may suggest a change in behavior or the code may not compile.
#[clippy::version = "1.30.0"] #[clippy::version = "1.30.0"]
pub ASSIGN_OPS, ("clippy::assign_ops", "compound operators are harmless and linting on them is not in scope for clippy"),
"using compound assignment operators (e.g., `+=`) is harmless"
}
declare_deprecated_lint! {
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// This lint used to suggest replacing `let mut vec =
/// Vec::with_capacity(n); vec.set_len(n);` with `let vec = vec![0; n];`. The
/// replacement has very different performance characteristics so the lint is
/// deprecated.
#[clippy::version = "pre 1.29.0"] #[clippy::version = "pre 1.29.0"]
pub UNSAFE_VECTOR_INITIALIZATION, ("clippy::unsafe_vector_initialization", "the suggested alternative could be substantially slower"),
"the replacement suggested by this lint had substantially different behavior"
}
declare_deprecated_lint! {
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// This lint has been superseded by #[must_use] in rustc.
#[clippy::version = "1.39.0"] #[clippy::version = "1.39.0"]
pub UNUSED_COLLECT, ("clippy::unused_collect", "`Iterator::collect` is now marked as `#[must_use]`"),
"`collect` has been marked as #[must_use] in rustc and that covers all cases of this lint"
}
declare_deprecated_lint! {
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// Associated-constants are now preferred.
#[clippy::version = "1.44.0"] #[clippy::version = "1.44.0"]
pub REPLACE_CONSTS, ("clippy::replace_consts", "`min_value` and `max_value` are now deprecated"),
"associated-constants `MIN`/`MAX` of integers are preferred to `{min,max}_value()` and module constants"
}
declare_deprecated_lint! {
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// The regex! macro does not exist anymore.
#[clippy::version = "1.47.0"] #[clippy::version = "1.47.0"]
pub REGEX_MACRO, ("clippy::regex_macro", "the `regex!` macro was removed from the regex crate in 2018"),
"the regex! macro has been removed from the regex crate in 2018"
}
declare_deprecated_lint! {
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// The `avoid_breaking_exported_api` config option was added, which
/// enables the `enum_variant_names` lint for public items.
#[clippy::version = "1.54.0"] #[clippy::version = "1.54.0"]
pub PUB_ENUM_VARIANT_NAMES, ("clippy::pub_enum_variant_names", "`clippy::enum_variant_names` now covers this case via the `avoid-breaking-exported-api` config"),
"set the `avoid-breaking-exported-api` config option to `false` to enable the `enum_variant_names` lint for public items"
}
declare_deprecated_lint! {
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// The `avoid_breaking_exported_api` config option was added, which
/// enables the `wrong_self_conversion` lint for public items.
#[clippy::version = "1.54.0"] #[clippy::version = "1.54.0"]
pub WRONG_PUB_SELF_CONVENTION, ("clippy::wrong_pub_self_convention", "`clippy::wrong_self_convention` now covers this case via the `avoid-breaking-exported-api` config"),
"set the `avoid-breaking-exported-api` config option to `false` to enable the `wrong_self_convention` lint for public items" // end deprecated lints. used by `cargo dev deprecate_lint`
} ]}
#[rustfmt::skip]
declare_with_version! { RENAMED(RENAMED_VERSION): &[(&str, &str)] = &[
#[clippy::version = ""]
("clippy::almost_complete_letter_range", "clippy::almost_complete_range"),
#[clippy::version = ""]
("clippy::blacklisted_name", "clippy::disallowed_names"),
#[clippy::version = ""]
("clippy::block_in_if_condition_expr", "clippy::blocks_in_conditions"),
#[clippy::version = ""]
("clippy::block_in_if_condition_stmt", "clippy::blocks_in_conditions"),
#[clippy::version = ""]
("clippy::blocks_in_if_conditions", "clippy::blocks_in_conditions"),
#[clippy::version = ""]
("clippy::box_vec", "clippy::box_collection"),
#[clippy::version = ""]
("clippy::const_static_lifetime", "clippy::redundant_static_lifetimes"),
#[clippy::version = ""]
("clippy::cyclomatic_complexity", "clippy::cognitive_complexity"),
#[clippy::version = ""]
("clippy::derive_hash_xor_eq", "clippy::derived_hash_with_manual_eq"),
#[clippy::version = ""]
("clippy::disallowed_method", "clippy::disallowed_methods"),
#[clippy::version = ""]
("clippy::disallowed_type", "clippy::disallowed_types"),
#[clippy::version = ""]
("clippy::eval_order_dependence", "clippy::mixed_read_write_in_expression"),
#[clippy::version = "1.51.0"]
("clippy::find_map", "clippy::manual_find_map"),
#[clippy::version = "1.53.0"]
("clippy::filter_map", "clippy::manual_filter_map"),
#[clippy::version = ""]
("clippy::identity_conversion", "clippy::useless_conversion"),
#[clippy::version = "pre 1.29.0"]
("clippy::if_let_redundant_pattern_matching", "clippy::redundant_pattern_matching"),
#[clippy::version = ""]
("clippy::if_let_some_result", "clippy::match_result_ok"),
#[clippy::version = ""]
("clippy::incorrect_clone_impl_on_copy_type", "clippy::non_canonical_clone_impl"),
#[clippy::version = ""]
("clippy::incorrect_partial_ord_impl_on_ord_type", "clippy::non_canonical_partial_ord_impl"),
#[clippy::version = ""]
("clippy::integer_arithmetic", "clippy::arithmetic_side_effects"),
#[clippy::version = ""]
("clippy::logic_bug", "clippy::overly_complex_bool_expr"),
#[clippy::version = ""]
("clippy::new_without_default_derive", "clippy::new_without_default"),
#[clippy::version = ""]
("clippy::option_and_then_some", "clippy::bind_instead_of_map"),
#[clippy::version = ""]
("clippy::option_expect_used", "clippy::expect_used"),
#[clippy::version = ""]
("clippy::option_map_unwrap_or", "clippy::map_unwrap_or"),
#[clippy::version = ""]
("clippy::option_map_unwrap_or_else", "clippy::map_unwrap_or"),
#[clippy::version = ""]
("clippy::option_unwrap_used", "clippy::unwrap_used"),
#[clippy::version = ""]
("clippy::overflow_check_conditional", "clippy::panicking_overflow_checks"),
#[clippy::version = ""]
("clippy::ref_in_deref", "clippy::needless_borrow"),
#[clippy::version = ""]
("clippy::result_expect_used", "clippy::expect_used"),
#[clippy::version = ""]
("clippy::result_map_unwrap_or_else", "clippy::map_unwrap_or"),
#[clippy::version = ""]
("clippy::result_unwrap_used", "clippy::unwrap_used"),
#[clippy::version = ""]
("clippy::single_char_push_str", "clippy::single_char_add_str"),
#[clippy::version = ""]
("clippy::stutter", "clippy::module_name_repetitions"),
#[clippy::version = ""]
("clippy::thread_local_initializer_can_be_made_const", "clippy::missing_const_for_thread_local"),
#[clippy::version = ""]
("clippy::to_string_in_display", "clippy::recursive_format_impl"),
#[clippy::version = ""]
("clippy::unwrap_or_else_default", "clippy::unwrap_or_default"),
#[clippy::version = ""]
("clippy::zero_width_space", "clippy::invisible_characters"),
#[clippy::version = ""]
("clippy::cast_ref_to_mut", "invalid_reference_casting"),
#[clippy::version = ""]
("clippy::clone_double_ref", "suspicious_double_ref_op"),
#[clippy::version = ""]
("clippy::cmp_nan", "invalid_nan_comparisons"),
#[clippy::version = ""]
("clippy::drop_bounds", "drop_bounds"),
#[clippy::version = ""]
("clippy::drop_copy", "dropping_copy_types"),
#[clippy::version = ""]
("clippy::drop_ref", "dropping_references"),
#[clippy::version = ""]
("clippy::fn_null_check", "useless_ptr_null_checks"),
#[clippy::version = ""]
("clippy::for_loop_over_option", "for_loops_over_fallibles"),
#[clippy::version = ""]
("clippy::for_loop_over_result", "for_loops_over_fallibles"),
#[clippy::version = ""]
("clippy::for_loops_over_fallibles", "for_loops_over_fallibles"),
#[clippy::version = ""]
("clippy::forget_copy", "forgetting_copy_types"),
#[clippy::version = ""]
("clippy::forget_ref", "forgetting_references"),
#[clippy::version = ""]
("clippy::into_iter_on_array", "array_into_iter"),
#[clippy::version = ""]
("clippy::invalid_atomic_ordering", "invalid_atomic_ordering"),
#[clippy::version = ""]
("clippy::invalid_ref", "invalid_value"),
#[clippy::version = ""]
("clippy::invalid_utf8_in_unchecked", "invalid_from_utf8_unchecked"),
#[clippy::version = ""]
("clippy::let_underscore_drop", "let_underscore_drop"),
#[clippy::version = "1.80.0"]
("clippy::maybe_misused_cfg", "unexpected_cfgs"),
#[clippy::version = ""]
("clippy::mem_discriminant_non_enum", "enum_intrinsics_non_enums"),
#[clippy::version = "1.80.0"]
("clippy::mismatched_target_os", "unexpected_cfgs"),
#[clippy::version = ""]
("clippy::panic_params", "non_fmt_panics"),
#[clippy::version = ""]
("clippy::positional_named_format_parameters", "named_arguments_used_positionally"),
#[clippy::version = ""]
("clippy::temporary_cstring_as_ptr", "temporary_cstring_as_ptr"),
#[clippy::version = ""]
("clippy::undropped_manually_drops", "undropped_manually_drops"),
#[clippy::version = ""]
("clippy::unknown_clippy_lints", "unknown_lints"),
#[clippy::version = ""]
("clippy::unused_label", "unused_labels"),
#[clippy::version = ""]
("clippy::vtable_address_comparisons", "ambiguous_wide_pointer_comparisons"),
#[clippy::version = ""]
("clippy::reverse_range_loop", "clippy::reversed_empty_ranges"),
// end renamed lints. used by `cargo dev rename_lint`
]}

View file

@ -1,58 +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.
{
store.register_removed(
"clippy::should_assert_eq",
"`assert!()` will be more flexible with RFC 2011",
);
store.register_removed(
"clippy::extend_from_slice",
"`.extend_from_slice(_)` is a faster way to extend a Vec by a slice",
);
store.register_removed(
"clippy::range_step_by_zero",
"`iterator.step_by(0)` panics nowadays",
);
store.register_removed(
"clippy::unstable_as_slice",
"`Vec::as_slice` has been stabilized in 1.7",
);
store.register_removed(
"clippy::unstable_as_mut_slice",
"`Vec::as_mut_slice` has been stabilized in 1.7",
);
store.register_removed(
"clippy::misaligned_transmute",
"this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr",
);
store.register_removed(
"clippy::assign_ops",
"using compound assignment operators (e.g., `+=`) is harmless",
);
store.register_removed(
"clippy::unsafe_vector_initialization",
"the replacement suggested by this lint had substantially different behavior",
);
store.register_removed(
"clippy::unused_collect",
"`collect` has been marked as #[must_use] in rustc and that covers all cases of this lint",
);
store.register_removed(
"clippy::replace_consts",
"associated-constants `MIN`/`MAX` of integers are preferred to `{min,max}_value()` and module constants",
);
store.register_removed(
"clippy::regex_macro",
"the regex! macro has been removed from the regex crate in 2018",
);
store.register_removed(
"clippy::pub_enum_variant_names",
"set the `avoid-breaking-exported-api` config option to `false` to enable the `enum_variant_names` lint for public items",
);
store.register_removed(
"clippy::wrong_pub_self_convention",
"set the `avoid-breaking-exported-api` config option to `false` to enable the `wrong_self_convention` lint for public items",
);
}

View file

@ -65,13 +65,11 @@ extern crate clippy_utils;
#[macro_use] #[macro_use]
extern crate declare_clippy_lint; extern crate declare_clippy_lint;
#[cfg(feature = "internal")]
pub mod deprecated_lints;
#[cfg_attr(feature = "internal", allow(clippy::missing_clippy_version_attribute))] #[cfg_attr(feature = "internal", allow(clippy::missing_clippy_version_attribute))]
mod utils; mod utils;
mod declared_lints; mod declared_lints;
mod renamed_lints; mod deprecated_lints;
// begin lints modules, do not remove this comment, its used in `update_lints` // begin lints modules, do not remove this comment, its used in `update_lints`
mod absolute_paths; mod absolute_paths;
@ -532,10 +530,14 @@ fn register_categories(store: &mut rustc_lint::LintStore) {
/// Used in `./src/driver.rs`. /// Used in `./src/driver.rs`.
#[expect(clippy::too_many_lines)] #[expect(clippy::too_many_lines)]
pub fn register_lints(store: &mut rustc_lint::LintStore, conf: &'static Conf) { pub fn register_lints(store: &mut rustc_lint::LintStore, conf: &'static Conf) {
register_removed_non_tool_lints(store);
register_categories(store); register_categories(store);
include!("lib.deprecated.rs"); 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);
}
#[cfg(feature = "internal")] #[cfg(feature = "internal")]
{ {
@ -913,56 +915,3 @@ pub fn register_lints(store: &mut rustc_lint::LintStore, conf: &'static Conf) {
store.register_early_pass(|| Box::new(cfg_not_test::CfgNotTest)); store.register_early_pass(|| Box::new(cfg_not_test::CfgNotTest));
// add lints here, do not remove this comment, it's used in `new_lint` // add lints here, do not remove this comment, it's used in `new_lint`
} }
#[rustfmt::skip]
fn register_removed_non_tool_lints(store: &mut rustc_lint::LintStore) {
store.register_removed(
"should_assert_eq",
"`assert!()` will be more flexible with RFC 2011",
);
store.register_removed(
"extend_from_slice",
"`.extend_from_slice(_)` is a faster way to extend a Vec by a slice",
);
store.register_removed(
"range_step_by_zero",
"`iterator.step_by(0)` panics nowadays",
);
store.register_removed(
"unstable_as_slice",
"`Vec::as_slice` has been stabilized in 1.7",
);
store.register_removed(
"unstable_as_mut_slice",
"`Vec::as_mut_slice` has been stabilized in 1.7",
);
store.register_removed(
"misaligned_transmute",
"this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr",
);
store.register_removed(
"assign_ops",
"using compound assignment operators (e.g., `+=`) is harmless",
);
store.register_removed(
"if_let_redundant_pattern_matching",
"this lint has been changed to redundant_pattern_matching",
);
store.register_removed(
"unsafe_vector_initialization",
"the replacement suggested by this lint had substantially different behavior",
);
store.register_removed(
"reverse_range_loop",
"this lint is now included in reversed_empty_ranges",
);
}
/// Register renamed lints.
///
/// Used in `./src/driver.rs`.
pub fn register_renamed(ls: &mut rustc_lint::LintStore) {
for (old_name, new_name) in renamed_lints::RENAMED_LINTS {
ls.register_renamed(old_name, new_name);
}
}

View file

@ -1,70 +0,0 @@
// This file is managed by `cargo dev rename_lint`. Prefer using that when possible.
#[rustfmt::skip]
pub static RENAMED_LINTS: &[(&str, &str)] = &[
("clippy::almost_complete_letter_range", "clippy::almost_complete_range"),
("clippy::blacklisted_name", "clippy::disallowed_names"),
("clippy::block_in_if_condition_expr", "clippy::blocks_in_conditions"),
("clippy::block_in_if_condition_stmt", "clippy::blocks_in_conditions"),
("clippy::blocks_in_if_conditions", "clippy::blocks_in_conditions"),
("clippy::box_vec", "clippy::box_collection"),
("clippy::const_static_lifetime", "clippy::redundant_static_lifetimes"),
("clippy::cyclomatic_complexity", "clippy::cognitive_complexity"),
("clippy::derive_hash_xor_eq", "clippy::derived_hash_with_manual_eq"),
("clippy::disallowed_method", "clippy::disallowed_methods"),
("clippy::disallowed_type", "clippy::disallowed_types"),
("clippy::eval_order_dependence", "clippy::mixed_read_write_in_expression"),
("clippy::find_map", "clippy::manual_find_map"),
("clippy::filter_map", "clippy::manual_filter_map"),
("clippy::identity_conversion", "clippy::useless_conversion"),
("clippy::if_let_redundant_pattern_matching", "clippy::redundant_pattern_matching"),
("clippy::if_let_some_result", "clippy::match_result_ok"),
("clippy::incorrect_clone_impl_on_copy_type", "clippy::non_canonical_clone_impl"),
("clippy::incorrect_partial_ord_impl_on_ord_type", "clippy::non_canonical_partial_ord_impl"),
("clippy::integer_arithmetic", "clippy::arithmetic_side_effects"),
("clippy::logic_bug", "clippy::overly_complex_bool_expr"),
("clippy::new_without_default_derive", "clippy::new_without_default"),
("clippy::option_and_then_some", "clippy::bind_instead_of_map"),
("clippy::option_expect_used", "clippy::expect_used"),
("clippy::option_map_unwrap_or", "clippy::map_unwrap_or"),
("clippy::option_map_unwrap_or_else", "clippy::map_unwrap_or"),
("clippy::option_unwrap_used", "clippy::unwrap_used"),
("clippy::overflow_check_conditional", "clippy::panicking_overflow_checks"),
("clippy::ref_in_deref", "clippy::needless_borrow"),
("clippy::result_expect_used", "clippy::expect_used"),
("clippy::result_map_unwrap_or_else", "clippy::map_unwrap_or"),
("clippy::result_unwrap_used", "clippy::unwrap_used"),
("clippy::single_char_push_str", "clippy::single_char_add_str"),
("clippy::stutter", "clippy::module_name_repetitions"),
("clippy::thread_local_initializer_can_be_made_const", "clippy::missing_const_for_thread_local"),
("clippy::to_string_in_display", "clippy::recursive_format_impl"),
("clippy::unwrap_or_else_default", "clippy::unwrap_or_default"),
("clippy::zero_width_space", "clippy::invisible_characters"),
("clippy::cast_ref_to_mut", "invalid_reference_casting"),
("clippy::clone_double_ref", "suspicious_double_ref_op"),
("clippy::cmp_nan", "invalid_nan_comparisons"),
("clippy::drop_bounds", "drop_bounds"),
("clippy::drop_copy", "dropping_copy_types"),
("clippy::drop_ref", "dropping_references"),
("clippy::fn_null_check", "useless_ptr_null_checks"),
("clippy::for_loop_over_option", "for_loops_over_fallibles"),
("clippy::for_loop_over_result", "for_loops_over_fallibles"),
("clippy::for_loops_over_fallibles", "for_loops_over_fallibles"),
("clippy::forget_copy", "forgetting_copy_types"),
("clippy::forget_ref", "forgetting_references"),
("clippy::into_iter_on_array", "array_into_iter"),
("clippy::invalid_atomic_ordering", "invalid_atomic_ordering"),
("clippy::invalid_ref", "invalid_value"),
("clippy::invalid_utf8_in_unchecked", "invalid_from_utf8_unchecked"),
("clippy::let_underscore_drop", "let_underscore_drop"),
("clippy::maybe_misused_cfg", "unexpected_cfgs"),
("clippy::mem_discriminant_non_enum", "enum_intrinsics_non_enums"),
("clippy::mismatched_target_os", "unexpected_cfgs"),
("clippy::panic_params", "non_fmt_panics"),
("clippy::positional_named_format_parameters", "named_arguments_used_positionally"),
("clippy::temporary_cstring_as_ptr", "temporary_cstring_as_ptr"),
("clippy::undropped_manually_drops", "undropped_manually_drops"),
("clippy::unknown_clippy_lints", "unknown_lints"),
("clippy::unused_label", "unused_labels"),
("clippy::vtable_address_comparisons", "ambiguous_wide_pointer_comparisons"),
];

View file

@ -1,4 +1,3 @@
use crate::utils::internal_lints::metadata_collector::is_deprecated_lint;
use clippy_utils::diagnostics::{span_lint, span_lint_and_help}; use clippy_utils::diagnostics::{span_lint, span_lint_and_help};
use clippy_utils::macros::root_macro_call_first_node; use clippy_utils::macros::root_macro_call_first_node;
use clippy_utils::{is_lint_allowed, match_def_path, paths}; use clippy_utils::{is_lint_allowed, match_def_path, paths};
@ -144,25 +143,17 @@ impl<'tcx> LateLintPass<'tcx> for LintWithoutLintPass {
} }
if let hir::ItemKind::Static(ty, Mutability::Not, body_id) = item.kind { if let hir::ItemKind::Static(ty, Mutability::Not, body_id) = item.kind {
let is_lint_ref_ty = is_lint_ref_type(cx, ty); if is_lint_ref_type(cx, ty) {
if is_deprecated_lint(cx, ty) || is_lint_ref_ty {
check_invalid_clippy_version_attribute(cx, item); check_invalid_clippy_version_attribute(cx, item);
let expr = &cx.tcx.hir().body(body_id).value; let expr = &cx.tcx.hir().body(body_id).value;
let fields; let fields = if let ExprKind::AddrOf(_, _, inner_exp) = expr.kind
if is_lint_ref_ty { && let ExprKind::Struct(_, struct_fields, _) = inner_exp.kind
if let ExprKind::AddrOf(_, _, inner_exp) = expr.kind {
&& let ExprKind::Struct(_, struct_fields, _) = inner_exp.kind struct_fields
{
fields = struct_fields;
} else {
return;
}
} else if let ExprKind::Struct(_, struct_fields, _) = expr.kind {
fields = struct_fields;
} else { } else {
return; return;
} };
let field = fields let field = fields
.iter() .iter()
@ -175,25 +166,15 @@ impl<'tcx> LateLintPass<'tcx> for LintWithoutLintPass {
}) = field.expr.kind }) = field.expr.kind
{ {
let sym_str = sym.as_str(); let sym_str = sym.as_str();
if is_lint_ref_ty { if sym_str == "default lint description" {
if sym_str == "default lint description" {
span_lint(
cx,
DEFAULT_LINT,
item.span,
format!("the lint `{}` has the default lint description", item.ident.name),
);
}
self.declared_lints.insert(item.ident.name, item.span);
} else if sym_str == "default deprecation note" {
span_lint( span_lint(
cx, cx,
DEFAULT_DEPRECATION_REASON, DEFAULT_LINT,
item.span, item.span,
format!("the lint `{}` has the default deprecation reason", item.ident.name), format!("the lint `{}` has the default lint description", item.ident.name),
); );
} }
self.declared_lints.insert(item.ident.name, item.span);
} }
} }
} else if let Some(macro_call) = root_macro_call_first_node(cx, item) { } else if let Some(macro_call) = root_macro_call_first_node(cx, item) {

View file

@ -7,13 +7,12 @@
//! during any comparison or mapping. (Please take care of this, it's not fun to spend time on such //! during any comparison or mapping. (Please take care of this, it's not fun to spend time on such
//! a simple mistake) //! a simple mistake)
use crate::renamed_lints::RENAMED_LINTS;
use crate::utils::internal_lints::lint_without_lint_pass::{extract_clippy_version_value, is_lint_ref_type}; use crate::utils::internal_lints::lint_without_lint_pass::{extract_clippy_version_value, is_lint_ref_type};
use clippy_config::{get_configuration_metadata, ClippyConfiguration}; use clippy_config::{get_configuration_metadata, ClippyConfiguration};
use clippy_utils::diagnostics::span_lint; use clippy_utils::diagnostics::span_lint;
use clippy_utils::ty::{match_type, walk_ptrs_ty_depth}; use clippy_utils::ty::{match_type, walk_ptrs_ty_depth};
use clippy_utils::{last_path_segment, match_def_path, match_function_call, match_path, paths}; use clippy_utils::{last_path_segment, match_function_call, match_path, paths};
use itertools::Itertools; use itertools::Itertools;
use rustc_ast as ast; use rustc_ast as ast;
use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::fx::FxHashMap;
@ -85,7 +84,6 @@ const SUGGESTION_DIAG_METHODS: [(&str, bool); 9] = [
("tool_only_multipart_suggestion", true), ("tool_only_multipart_suggestion", true),
("span_suggestions", true), ("span_suggestions", true),
]; ];
const DEPRECATED_LINT_TYPE: [&str; 3] = ["clippy_lints", "deprecated_lints", "ClippyDeprecatedLint"];
/// The index of the applicability name of `paths::APPLICABILITY_VALUES` /// The index of the applicability name of `paths::APPLICABILITY_VALUES`
const APPLICABILITY_NAME_INDEX: usize = 2; const APPLICABILITY_NAME_INDEX: usize = 2;
@ -212,6 +210,13 @@ impl Drop for MetadataCollector {
let mut applicability_info = std::mem::take(&mut self.applicability_info); let mut applicability_info = std::mem::take(&mut self.applicability_info);
// Add deprecated lints
self.lints.extend(
crate::deprecated_lints::DEPRECATED
.iter()
.zip(crate::deprecated_lints::DEPRECATED_VERSION)
.filter_map(|((lint, reason), version)| LintMetadata::new_deprecated(lint, reason, version)),
);
// Mapping the final data // Mapping the final data
let mut lints = std::mem::take(&mut self.lints).into_sorted_vec(); let mut lints = std::mem::take(&mut self.lints).into_sorted_vec();
for x in &mut lints { for x in &mut lints {
@ -257,7 +262,7 @@ Please use that command to update the file and do not edit it by hand.
#[derive(Debug, Clone, Serialize, PartialEq, Eq, PartialOrd, Ord)] #[derive(Debug, Clone, Serialize, PartialEq, Eq, PartialOrd, Ord)]
struct LintMetadata { struct LintMetadata {
id: String, id: String,
id_span: SerializableSpan, id_span: Option<SerializableSpan>,
group: String, group: String,
level: String, level: String,
docs: String, docs: String,
@ -281,7 +286,7 @@ impl LintMetadata {
) -> Self { ) -> Self {
Self { Self {
id, id,
id_span, id_span: Some(id_span),
group, group,
level: level.to_string(), level: level.to_string(),
version, version,
@ -290,6 +295,29 @@ impl LintMetadata {
former_ids: BTreeSet::new(), former_ids: BTreeSet::new(),
} }
} }
fn new_deprecated(name: &str, reason: &str, version: &str) -> Option<Self> {
// The reason starts with a lowercase letter and end without a period.
// This needs to be fixed for the website.
let mut reason = reason.to_owned();
if let Some(reason) = reason.get_mut(0..1) {
reason.make_ascii_uppercase();
}
name.strip_prefix("clippy::").map(|name| Self {
id: name.into(),
id_span: None,
group: DEPRECATED_LINT_GROUP_STR.into(),
level: DEPRECATED_LINT_LEVEL.into(),
version: version.into(),
docs: format!(
"### What it does\n\n\
Nothing. This lint has been deprecated\n\n\
### Deprecation reason\n\n{reason}.\n",
),
applicability: None,
former_ids: BTreeSet::new(),
})
}
} }
fn replace_produces(lint_name: &str, docs: &mut String, clippy_project_root: &Path) { fn replace_produces(lint_name: &str, docs: &mut String, clippy_project_root: &Path) {
@ -560,24 +588,6 @@ impl<'hir> LateLintPass<'hir> for MetadataCollector {
raw_docs, raw_docs,
)); ));
} }
if is_deprecated_lint(cx, ty)
// disallow check
&& let lint_name = sym_to_string(item.ident.name).to_ascii_lowercase()
// Metadata the little we can get from a deprecated lint
&& let Some(raw_docs) = extract_attr_docs_or_lint(cx, item)
{
let version = get_lint_version(cx, item);
self.lints.push(LintMetadata::new(
lint_name,
SerializableSpan::from_item(cx, item),
DEPRECATED_LINT_GROUP_STR.to_string(),
DEPRECATED_LINT_LEVEL,
version,
raw_docs,
));
}
} }
} }
@ -767,16 +777,6 @@ fn get_lint_level_from_group(lint_group: &str) -> Option<&'static str> {
.find_map(|(group_name, group_level)| (*group_name == lint_group).then_some(*group_level)) .find_map(|(group_name, group_level)| (*group_name == lint_group).then_some(*group_level))
} }
pub(super) fn is_deprecated_lint(cx: &LateContext<'_>, ty: &hir::Ty<'_>) -> bool {
if let hir::TyKind::Path(ref path) = ty.kind {
if let hir::def::Res::Def(DefKind::Struct, def_id) = cx.qpath_res(path, ty.hir_id) {
return match_def_path(cx, def_id, &DEPRECATED_LINT_TYPE);
}
}
false
}
fn collect_renames(lints: &mut Vec<LintMetadata>) { fn collect_renames(lints: &mut Vec<LintMetadata>) {
for lint in lints { for lint in lints {
let mut collected = String::new(); let mut collected = String::new();
@ -784,7 +784,7 @@ fn collect_renames(lints: &mut Vec<LintMetadata>) {
loop { loop {
if let Some(lint_name) = names.pop() { if let Some(lint_name) = names.pop() {
for (k, v) in RENAMED_LINTS { for (k, v) in crate::deprecated_lints::RENAMED {
if let Some(name) = v.strip_prefix(CLIPPY_LINT_GROUP_PREFIX) if let Some(name) = v.strip_prefix(CLIPPY_LINT_GROUP_PREFIX)
&& name == lint_name && name == lint_name
&& let Some(past_name) = k.strip_prefix(CLIPPY_LINT_GROUP_PREFIX) && let Some(past_name) = k.strip_prefix(CLIPPY_LINT_GROUP_PREFIX)

View file

@ -151,7 +151,6 @@ impl rustc_driver::Callbacks for ClippyCallbacks {
let conf = clippy_config::Conf::read(sess, &conf_path); let conf = clippy_config::Conf::read(sess, &conf_path);
clippy_lints::register_lints(lint_store, conf); clippy_lints::register_lints(lint_store, conf);
clippy_lints::register_pre_expansion_lints(lint_store, conf); clippy_lints::register_pre_expansion_lints(lint_store, conf);
clippy_lints::register_renamed(lint_store);
})); }));
// FIXME: #4825; This is required, because Clippy lints that are based on MIR have to be // FIXME: #4825; This is required, because Clippy lints that are based on MIR have to be

View file

@ -1,30 +0,0 @@
#![deny(clippy::internal)]
#![feature(rustc_private)]
#[macro_use]
extern crate clippy_lints;
use clippy_lints::deprecated_lints::ClippyDeprecatedLint;
declare_deprecated_lint! {
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// TODO
#[clippy::version = "1.63.0"]
pub COOL_LINT_DEFAULT,
"default deprecation note"
}
declare_deprecated_lint! {
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// This lint has been replaced by `cooler_lint`
#[clippy::version = "1.63.0"]
pub COOL_LINT,
"this lint has been replaced by `cooler_lint`"
}
fn main() {}

View file

@ -1,22 +0,0 @@
error: the lint `COOL_LINT_DEFAULT` has the default deprecation reason
--> tests/ui-internal/default_deprecation_reason.rs:8:1
|
LL | / declare_deprecated_lint! {
LL | | /// ### What it does
LL | | /// Nothing. This lint has been deprecated.
LL | | ///
... |
LL | | "default deprecation note"
LL | | }
| |_^
|
note: the lint level is defined here
--> tests/ui-internal/default_deprecation_reason.rs:1:9
|
LL | #![deny(clippy::internal)]
| ^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::default_deprecation_reason)]` implied by `#[deny(clippy::internal)]`
= note: this error originates in the macro `declare_deprecated_lint` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 1 previous error

View file

@ -2,18 +2,18 @@
// Use that command to update this file and do not edit by hand. // Use that command to update this file and do not edit by hand.
// Manual edits will be overwritten. // Manual edits will be overwritten.
#![warn(clippy::should_assert_eq)] #![warn(clippy::should_assert_eq)] //~ ERROR: lint `clippy::should_assert_eq`
#![warn(clippy::extend_from_slice)] #![warn(clippy::extend_from_slice)] //~ ERROR: lint `clippy::extend_from_slice`
#![warn(clippy::range_step_by_zero)] #![warn(clippy::range_step_by_zero)] //~ ERROR: lint `clippy::range_step_by_zero`
#![warn(clippy::unstable_as_slice)] #![warn(clippy::unstable_as_slice)] //~ ERROR: lint `clippy::unstable_as_slice`
#![warn(clippy::unstable_as_mut_slice)] #![warn(clippy::unstable_as_mut_slice)] //~ ERROR: lint `clippy::unstable_as_mut_slice`
#![warn(clippy::misaligned_transmute)] #![warn(clippy::misaligned_transmute)] //~ ERROR: lint `clippy::misaligned_transmute`
#![warn(clippy::assign_ops)] #![warn(clippy::assign_ops)] //~ ERROR: lint `clippy::assign_ops`
#![warn(clippy::unsafe_vector_initialization)] #![warn(clippy::unsafe_vector_initialization)] //~ ERROR: lint `clippy::unsafe_vector_initialization`
#![warn(clippy::unused_collect)] #![warn(clippy::unused_collect)] //~ ERROR: lint `clippy::unused_collect`
#![warn(clippy::replace_consts)] #![warn(clippy::replace_consts)] //~ ERROR: lint `clippy::replace_consts`
#![warn(clippy::regex_macro)] #![warn(clippy::regex_macro)] //~ ERROR: lint `clippy::regex_macro`
#![warn(clippy::pub_enum_variant_names)] #![warn(clippy::pub_enum_variant_names)] //~ ERROR: lint `clippy::pub_enum_variant_names`
#![warn(clippy::wrong_pub_self_convention)] #![warn(clippy::wrong_pub_self_convention)] //~ ERROR: lint `clippy::wrong_pub_self_convention`
fn main() {} fn main() {}

View file

@ -1,4 +1,4 @@
error: lint `clippy::should_assert_eq` has been removed: `assert!()` will be more flexible with RFC 2011 error: lint `clippy::should_assert_eq` has been removed: `assert!(a == b)` can now print the values the same way `assert_eq!(a, b) can
--> tests/ui/deprecated.rs:5:9 --> tests/ui/deprecated.rs:5:9
| |
LL | #![warn(clippy::should_assert_eq)] LL | #![warn(clippy::should_assert_eq)]
@ -7,73 +7,73 @@ LL | #![warn(clippy::should_assert_eq)]
= note: `-D renamed-and-removed-lints` implied by `-D warnings` = note: `-D renamed-and-removed-lints` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(renamed_and_removed_lints)]` = help: to override `-D warnings` add `#[allow(renamed_and_removed_lints)]`
error: lint `clippy::extend_from_slice` has been removed: `.extend_from_slice(_)` is a faster way to extend a Vec by a slice error: lint `clippy::extend_from_slice` has been removed: `Vec::extend_from_slice` is no longer faster than `Vec::extend` due to specialization
--> tests/ui/deprecated.rs:6:9 --> tests/ui/deprecated.rs:6:9
| |
LL | #![warn(clippy::extend_from_slice)] LL | #![warn(clippy::extend_from_slice)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
error: lint `clippy::range_step_by_zero` has been removed: `iterator.step_by(0)` panics nowadays error: lint `clippy::range_step_by_zero` has been removed: `Iterator::step_by(0)` now panics and is no longer an infinite iterator
--> tests/ui/deprecated.rs:7:9 --> tests/ui/deprecated.rs:7:9
| |
LL | #![warn(clippy::range_step_by_zero)] LL | #![warn(clippy::range_step_by_zero)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: lint `clippy::unstable_as_slice` has been removed: `Vec::as_slice` has been stabilized in 1.7 error: lint `clippy::unstable_as_slice` has been removed: `Vec::as_slice` is now stable
--> tests/ui/deprecated.rs:8:9 --> tests/ui/deprecated.rs:8:9
| |
LL | #![warn(clippy::unstable_as_slice)] LL | #![warn(clippy::unstable_as_slice)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
error: lint `clippy::unstable_as_mut_slice` has been removed: `Vec::as_mut_slice` has been stabilized in 1.7 error: lint `clippy::unstable_as_mut_slice` has been removed: `Vec::as_mut_slice` is now stable
--> tests/ui/deprecated.rs:9:9 --> tests/ui/deprecated.rs:9:9
| |
LL | #![warn(clippy::unstable_as_mut_slice)] LL | #![warn(clippy::unstable_as_mut_slice)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: lint `clippy::misaligned_transmute` has been removed: this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr error: lint `clippy::misaligned_transmute` has been removed: split into `clippy::cast_ptr_alignment` and `clippy::transmute_ptr_to_ptr`
--> tests/ui/deprecated.rs:10:9 --> tests/ui/deprecated.rs:10:9
| |
LL | #![warn(clippy::misaligned_transmute)] LL | #![warn(clippy::misaligned_transmute)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: lint `clippy::assign_ops` has been removed: using compound assignment operators (e.g., `+=`) is harmless error: lint `clippy::assign_ops` has been removed: compound operators are harmless and linting on them is not in scope for clippy
--> tests/ui/deprecated.rs:11:9 --> tests/ui/deprecated.rs:11:9
| |
LL | #![warn(clippy::assign_ops)] LL | #![warn(clippy::assign_ops)]
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
error: lint `clippy::unsafe_vector_initialization` has been removed: the replacement suggested by this lint had substantially different behavior error: lint `clippy::unsafe_vector_initialization` has been removed: the suggested alternative could be substantially slower
--> tests/ui/deprecated.rs:12:9 --> tests/ui/deprecated.rs:12:9
| |
LL | #![warn(clippy::unsafe_vector_initialization)] LL | #![warn(clippy::unsafe_vector_initialization)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: lint `clippy::unused_collect` has been removed: `collect` has been marked as #[must_use] in rustc and that covers all cases of this lint error: lint `clippy::unused_collect` has been removed: `Iterator::collect` is now marked as `#[must_use]`
--> tests/ui/deprecated.rs:13:9 --> tests/ui/deprecated.rs:13:9
| |
LL | #![warn(clippy::unused_collect)] LL | #![warn(clippy::unused_collect)]
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error: lint `clippy::replace_consts` has been removed: associated-constants `MIN`/`MAX` of integers are preferred to `{min,max}_value()` and module constants error: lint `clippy::replace_consts` has been removed: `min_value` and `max_value` are now deprecated
--> tests/ui/deprecated.rs:14:9 --> tests/ui/deprecated.rs:14:9
| |
LL | #![warn(clippy::replace_consts)] LL | #![warn(clippy::replace_consts)]
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error: lint `clippy::regex_macro` has been removed: the regex! macro has been removed from the regex crate in 2018 error: lint `clippy::regex_macro` has been removed: the `regex!` macro was removed from the regex crate in 2018
--> tests/ui/deprecated.rs:15:9 --> tests/ui/deprecated.rs:15:9
| |
LL | #![warn(clippy::regex_macro)] LL | #![warn(clippy::regex_macro)]
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: lint `clippy::pub_enum_variant_names` has been removed: set the `avoid-breaking-exported-api` config option to `false` to enable the `enum_variant_names` lint for public items error: lint `clippy::pub_enum_variant_names` has been removed: `clippy::enum_variant_names` now covers this case via the `avoid-breaking-exported-api` config
--> tests/ui/deprecated.rs:16:9 --> tests/ui/deprecated.rs:16:9
| |
LL | #![warn(clippy::pub_enum_variant_names)] LL | #![warn(clippy::pub_enum_variant_names)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: lint `clippy::wrong_pub_self_convention` has been removed: set the `avoid-breaking-exported-api` config option to `false` to enable the `wrong_self_convention` lint for public items error: lint `clippy::wrong_pub_self_convention` has been removed: `clippy::wrong_self_convention` now covers this case via the `avoid-breaking-exported-api` config
--> tests/ui/deprecated.rs:17:9 --> tests/ui/deprecated.rs:17:9
| |
LL | #![warn(clippy::wrong_pub_self_convention)] LL | #![warn(clippy::wrong_pub_self_convention)]

View file

@ -1,9 +0,0 @@
#[warn(unstable_as_slice)]
//~^ ERROR: lint `unstable_as_slice` has been removed: `Vec::as_slice` has been stabilized
//~| NOTE: `-D renamed-and-removed-lints` implied by `-D warnings`
#[warn(unstable_as_mut_slice)]
//~^ ERROR: lint `unstable_as_mut_slice` has been removed: `Vec::as_mut_slice` has been st
#[warn(misaligned_transmute)]
//~^ ERROR: lint `misaligned_transmute` has been removed: this lint has been split into ca
fn main() {}

View file

@ -1,23 +0,0 @@
error: lint `unstable_as_slice` has been removed: `Vec::as_slice` has been stabilized in 1.7
--> tests/ui/deprecated_old.rs:1:8
|
LL | #[warn(unstable_as_slice)]
| ^^^^^^^^^^^^^^^^^
|
= note: `-D renamed-and-removed-lints` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(renamed_and_removed_lints)]`
error: lint `unstable_as_mut_slice` has been removed: `Vec::as_mut_slice` has been stabilized in 1.7
--> tests/ui/deprecated_old.rs:4:8
|
LL | #[warn(unstable_as_mut_slice)]
| ^^^^^^^^^^^^^^^^^^^^^
error: lint `misaligned_transmute` has been removed: this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr
--> tests/ui/deprecated_old.rs:6:8
|
LL | #[warn(misaligned_transmute)]
| ^^^^^^^^^^^^^^^^^^^^
error: aborting due to 3 previous errors

View file

@ -59,70 +59,72 @@
#![allow(unknown_lints)] #![allow(unknown_lints)]
#![allow(unused_labels)] #![allow(unused_labels)]
#![allow(ambiguous_wide_pointer_comparisons)] #![allow(ambiguous_wide_pointer_comparisons)]
#![warn(clippy::almost_complete_range)] #![allow(clippy::reversed_empty_ranges)]
#![warn(clippy::disallowed_names)] #![warn(clippy::almost_complete_range)] //~ ERROR: lint `clippy::almost_complete_letter_range`
#![warn(clippy::blocks_in_conditions)] #![warn(clippy::disallowed_names)] //~ ERROR: lint `clippy::blacklisted_name`
#![warn(clippy::blocks_in_conditions)] #![warn(clippy::blocks_in_conditions)] //~ ERROR: lint `clippy::block_in_if_condition_expr`
#![warn(clippy::blocks_in_conditions)] #![warn(clippy::blocks_in_conditions)] //~ ERROR: lint `clippy::block_in_if_condition_stmt`
#![warn(clippy::box_collection)] #![warn(clippy::blocks_in_conditions)] //~ ERROR: lint `clippy::blocks_in_if_conditions`
#![warn(clippy::redundant_static_lifetimes)] #![warn(clippy::box_collection)] //~ ERROR: lint `clippy::box_vec`
#![warn(clippy::cognitive_complexity)] #![warn(clippy::redundant_static_lifetimes)] //~ ERROR: lint `clippy::const_static_lifetime`
#![warn(clippy::derived_hash_with_manual_eq)] #![warn(clippy::cognitive_complexity)] //~ ERROR: lint `clippy::cyclomatic_complexity`
#![warn(clippy::disallowed_methods)] #![warn(clippy::derived_hash_with_manual_eq)] //~ ERROR: lint `clippy::derive_hash_xor_eq`
#![warn(clippy::disallowed_types)] #![warn(clippy::disallowed_methods)] //~ ERROR: lint `clippy::disallowed_method`
#![warn(clippy::mixed_read_write_in_expression)] #![warn(clippy::disallowed_types)] //~ ERROR: lint `clippy::disallowed_type`
#![warn(clippy::manual_find_map)] #![warn(clippy::mixed_read_write_in_expression)] //~ ERROR: lint `clippy::eval_order_dependence`
#![warn(clippy::manual_filter_map)] #![warn(clippy::manual_find_map)] //~ ERROR: lint `clippy::find_map`
#![warn(clippy::useless_conversion)] #![warn(clippy::manual_filter_map)] //~ ERROR: lint `clippy::filter_map`
#![warn(clippy::redundant_pattern_matching)] #![warn(clippy::useless_conversion)] //~ ERROR: lint `clippy::identity_conversion`
#![warn(clippy::match_result_ok)] #![warn(clippy::redundant_pattern_matching)] //~ ERROR: lint `clippy::if_let_redundant_pattern_matching`
#![warn(clippy::non_canonical_clone_impl)] #![warn(clippy::match_result_ok)] //~ ERROR: lint `clippy::if_let_some_result`
#![warn(clippy::non_canonical_partial_ord_impl)] #![warn(clippy::non_canonical_clone_impl)] //~ ERROR: lint `clippy::incorrect_clone_impl_on_copy_type`
#![warn(clippy::arithmetic_side_effects)] #![warn(clippy::non_canonical_partial_ord_impl)] //~ ERROR: lint `clippy::incorrect_partial_ord_impl_on_ord_type`
#![warn(clippy::overly_complex_bool_expr)] #![warn(clippy::arithmetic_side_effects)] //~ ERROR: lint `clippy::integer_arithmetic`
#![warn(clippy::new_without_default)] #![warn(clippy::overly_complex_bool_expr)] //~ ERROR: lint `clippy::logic_bug`
#![warn(clippy::bind_instead_of_map)] #![warn(clippy::new_without_default)] //~ ERROR: lint `clippy::new_without_default_derive`
#![warn(clippy::expect_used)] #![warn(clippy::bind_instead_of_map)] //~ ERROR: lint `clippy::option_and_then_some`
#![warn(clippy::map_unwrap_or)] #![warn(clippy::expect_used)] //~ ERROR: lint `clippy::option_expect_used`
#![warn(clippy::map_unwrap_or)] #![warn(clippy::map_unwrap_or)] //~ ERROR: lint `clippy::option_map_unwrap_or`
#![warn(clippy::unwrap_used)] #![warn(clippy::map_unwrap_or)] //~ ERROR: lint `clippy::option_map_unwrap_or_else`
#![warn(clippy::panicking_overflow_checks)] #![warn(clippy::unwrap_used)] //~ ERROR: lint `clippy::option_unwrap_used`
#![warn(clippy::needless_borrow)] #![warn(clippy::panicking_overflow_checks)] //~ ERROR: lint `clippy::overflow_check_conditional`
#![warn(clippy::expect_used)] #![warn(clippy::needless_borrow)] //~ ERROR: lint `clippy::ref_in_deref`
#![warn(clippy::map_unwrap_or)] #![warn(clippy::expect_used)] //~ ERROR: lint `clippy::result_expect_used`
#![warn(clippy::unwrap_used)] #![warn(clippy::map_unwrap_or)] //~ ERROR: lint `clippy::result_map_unwrap_or_else`
#![warn(clippy::single_char_add_str)] #![warn(clippy::unwrap_used)] //~ ERROR: lint `clippy::result_unwrap_used`
#![warn(clippy::module_name_repetitions)] #![warn(clippy::single_char_add_str)] //~ ERROR: lint `clippy::single_char_push_str`
#![warn(clippy::missing_const_for_thread_local)] #![warn(clippy::module_name_repetitions)] //~ ERROR: lint `clippy::stutter`
#![warn(clippy::recursive_format_impl)] #![warn(clippy::missing_const_for_thread_local)] //~ ERROR: lint `clippy::thread_local_initializer_can_be_made_const`
#![warn(clippy::unwrap_or_default)] #![warn(clippy::recursive_format_impl)] //~ ERROR: lint `clippy::to_string_in_display`
#![warn(clippy::invisible_characters)] #![warn(clippy::unwrap_or_default)] //~ ERROR: lint `clippy::unwrap_or_else_default`
#![warn(invalid_reference_casting)] #![warn(clippy::invisible_characters)] //~ ERROR: lint `clippy::zero_width_space`
#![warn(suspicious_double_ref_op)] #![warn(invalid_reference_casting)] //~ ERROR: lint `clippy::cast_ref_to_mut`
#![warn(invalid_nan_comparisons)] #![warn(suspicious_double_ref_op)] //~ ERROR: lint `clippy::clone_double_ref`
#![warn(drop_bounds)] #![warn(invalid_nan_comparisons)] //~ ERROR: lint `clippy::cmp_nan`
#![warn(dropping_copy_types)] #![warn(drop_bounds)] //~ ERROR: lint `clippy::drop_bounds`
#![warn(dropping_references)] #![warn(dropping_copy_types)] //~ ERROR: lint `clippy::drop_copy`
#![warn(useless_ptr_null_checks)] #![warn(dropping_references)] //~ ERROR: lint `clippy::drop_ref`
#![warn(for_loops_over_fallibles)] #![warn(useless_ptr_null_checks)] //~ ERROR: lint `clippy::fn_null_check`
#![warn(for_loops_over_fallibles)] #![warn(for_loops_over_fallibles)] //~ ERROR: lint `clippy::for_loop_over_option`
#![warn(for_loops_over_fallibles)] #![warn(for_loops_over_fallibles)] //~ ERROR: lint `clippy::for_loop_over_result`
#![warn(forgetting_copy_types)] #![warn(for_loops_over_fallibles)] //~ ERROR: lint `clippy::for_loops_over_fallibles`
#![warn(forgetting_references)] #![warn(forgetting_copy_types)] //~ ERROR: lint `clippy::forget_copy`
#![warn(array_into_iter)] #![warn(forgetting_references)] //~ ERROR: lint `clippy::forget_ref`
#![warn(invalid_atomic_ordering)] #![warn(array_into_iter)] //~ ERROR: lint `clippy::into_iter_on_array`
#![warn(invalid_value)] #![warn(invalid_atomic_ordering)] //~ ERROR: lint `clippy::invalid_atomic_ordering`
#![warn(invalid_from_utf8_unchecked)] #![warn(invalid_value)] //~ ERROR: lint `clippy::invalid_ref`
#![warn(let_underscore_drop)] #![warn(invalid_from_utf8_unchecked)] //~ ERROR: lint `clippy::invalid_utf8_in_unchecked`
#![warn(unexpected_cfgs)] #![warn(let_underscore_drop)] //~ ERROR: lint `clippy::let_underscore_drop`
#![warn(enum_intrinsics_non_enums)] #![warn(unexpected_cfgs)] //~ ERROR: lint `clippy::maybe_misused_cfg`
#![warn(unexpected_cfgs)] #![warn(enum_intrinsics_non_enums)] //~ ERROR: lint `clippy::mem_discriminant_non_enum`
#![warn(non_fmt_panics)] #![warn(unexpected_cfgs)] //~ ERROR: lint `clippy::mismatched_target_os`
#![warn(named_arguments_used_positionally)] #![warn(non_fmt_panics)] //~ ERROR: lint `clippy::panic_params`
#![warn(temporary_cstring_as_ptr)] #![warn(named_arguments_used_positionally)] //~ ERROR: lint `clippy::positional_named_format_parameters`
#![warn(undropped_manually_drops)] #![warn(temporary_cstring_as_ptr)] //~ ERROR: lint `clippy::temporary_cstring_as_ptr`
#![warn(unknown_lints)] #![warn(undropped_manually_drops)] //~ ERROR: lint `clippy::undropped_manually_drops`
#![warn(unused_labels)] #![warn(unknown_lints)] //~ ERROR: lint `clippy::unknown_clippy_lints`
#![warn(ambiguous_wide_pointer_comparisons)] #![warn(unused_labels)] //~ ERROR: lint `clippy::unused_label`
#![warn(ambiguous_wide_pointer_comparisons)] //~ ERROR: lint `clippy::vtable_address_comparisons`
#![warn(clippy::reversed_empty_ranges)] //~ ERROR: lint `clippy::reverse_range_loop`
fn main() {} fn main() {}

View file

@ -59,70 +59,72 @@
#![allow(unknown_lints)] #![allow(unknown_lints)]
#![allow(unused_labels)] #![allow(unused_labels)]
#![allow(ambiguous_wide_pointer_comparisons)] #![allow(ambiguous_wide_pointer_comparisons)]
#![warn(clippy::almost_complete_letter_range)] #![allow(clippy::reversed_empty_ranges)]
#![warn(clippy::blacklisted_name)] #![warn(clippy::almost_complete_letter_range)] //~ ERROR: lint `clippy::almost_complete_letter_range`
#![warn(clippy::block_in_if_condition_expr)] #![warn(clippy::blacklisted_name)] //~ ERROR: lint `clippy::blacklisted_name`
#![warn(clippy::block_in_if_condition_stmt)] #![warn(clippy::block_in_if_condition_expr)] //~ ERROR: lint `clippy::block_in_if_condition_expr`
#![warn(clippy::blocks_in_if_conditions)] #![warn(clippy::block_in_if_condition_stmt)] //~ ERROR: lint `clippy::block_in_if_condition_stmt`
#![warn(clippy::box_vec)] #![warn(clippy::blocks_in_if_conditions)] //~ ERROR: lint `clippy::blocks_in_if_conditions`
#![warn(clippy::const_static_lifetime)] #![warn(clippy::box_vec)] //~ ERROR: lint `clippy::box_vec`
#![warn(clippy::cyclomatic_complexity)] #![warn(clippy::const_static_lifetime)] //~ ERROR: lint `clippy::const_static_lifetime`
#![warn(clippy::derive_hash_xor_eq)] #![warn(clippy::cyclomatic_complexity)] //~ ERROR: lint `clippy::cyclomatic_complexity`
#![warn(clippy::disallowed_method)] #![warn(clippy::derive_hash_xor_eq)] //~ ERROR: lint `clippy::derive_hash_xor_eq`
#![warn(clippy::disallowed_type)] #![warn(clippy::disallowed_method)] //~ ERROR: lint `clippy::disallowed_method`
#![warn(clippy::eval_order_dependence)] #![warn(clippy::disallowed_type)] //~ ERROR: lint `clippy::disallowed_type`
#![warn(clippy::find_map)] #![warn(clippy::eval_order_dependence)] //~ ERROR: lint `clippy::eval_order_dependence`
#![warn(clippy::filter_map)] #![warn(clippy::find_map)] //~ ERROR: lint `clippy::find_map`
#![warn(clippy::identity_conversion)] #![warn(clippy::filter_map)] //~ ERROR: lint `clippy::filter_map`
#![warn(clippy::if_let_redundant_pattern_matching)] #![warn(clippy::identity_conversion)] //~ ERROR: lint `clippy::identity_conversion`
#![warn(clippy::if_let_some_result)] #![warn(clippy::if_let_redundant_pattern_matching)] //~ ERROR: lint `clippy::if_let_redundant_pattern_matching`
#![warn(clippy::incorrect_clone_impl_on_copy_type)] #![warn(clippy::if_let_some_result)] //~ ERROR: lint `clippy::if_let_some_result`
#![warn(clippy::incorrect_partial_ord_impl_on_ord_type)] #![warn(clippy::incorrect_clone_impl_on_copy_type)] //~ ERROR: lint `clippy::incorrect_clone_impl_on_copy_type`
#![warn(clippy::integer_arithmetic)] #![warn(clippy::incorrect_partial_ord_impl_on_ord_type)] //~ ERROR: lint `clippy::incorrect_partial_ord_impl_on_ord_type`
#![warn(clippy::logic_bug)] #![warn(clippy::integer_arithmetic)] //~ ERROR: lint `clippy::integer_arithmetic`
#![warn(clippy::new_without_default_derive)] #![warn(clippy::logic_bug)] //~ ERROR: lint `clippy::logic_bug`
#![warn(clippy::option_and_then_some)] #![warn(clippy::new_without_default_derive)] //~ ERROR: lint `clippy::new_without_default_derive`
#![warn(clippy::option_expect_used)] #![warn(clippy::option_and_then_some)] //~ ERROR: lint `clippy::option_and_then_some`
#![warn(clippy::option_map_unwrap_or)] #![warn(clippy::option_expect_used)] //~ ERROR: lint `clippy::option_expect_used`
#![warn(clippy::option_map_unwrap_or_else)] #![warn(clippy::option_map_unwrap_or)] //~ ERROR: lint `clippy::option_map_unwrap_or`
#![warn(clippy::option_unwrap_used)] #![warn(clippy::option_map_unwrap_or_else)] //~ ERROR: lint `clippy::option_map_unwrap_or_else`
#![warn(clippy::overflow_check_conditional)] #![warn(clippy::option_unwrap_used)] //~ ERROR: lint `clippy::option_unwrap_used`
#![warn(clippy::ref_in_deref)] #![warn(clippy::overflow_check_conditional)] //~ ERROR: lint `clippy::overflow_check_conditional`
#![warn(clippy::result_expect_used)] #![warn(clippy::ref_in_deref)] //~ ERROR: lint `clippy::ref_in_deref`
#![warn(clippy::result_map_unwrap_or_else)] #![warn(clippy::result_expect_used)] //~ ERROR: lint `clippy::result_expect_used`
#![warn(clippy::result_unwrap_used)] #![warn(clippy::result_map_unwrap_or_else)] //~ ERROR: lint `clippy::result_map_unwrap_or_else`
#![warn(clippy::single_char_push_str)] #![warn(clippy::result_unwrap_used)] //~ ERROR: lint `clippy::result_unwrap_used`
#![warn(clippy::stutter)] #![warn(clippy::single_char_push_str)] //~ ERROR: lint `clippy::single_char_push_str`
#![warn(clippy::thread_local_initializer_can_be_made_const)] #![warn(clippy::stutter)] //~ ERROR: lint `clippy::stutter`
#![warn(clippy::to_string_in_display)] #![warn(clippy::thread_local_initializer_can_be_made_const)] //~ ERROR: lint `clippy::thread_local_initializer_can_be_made_const`
#![warn(clippy::unwrap_or_else_default)] #![warn(clippy::to_string_in_display)] //~ ERROR: lint `clippy::to_string_in_display`
#![warn(clippy::zero_width_space)] #![warn(clippy::unwrap_or_else_default)] //~ ERROR: lint `clippy::unwrap_or_else_default`
#![warn(clippy::cast_ref_to_mut)] #![warn(clippy::zero_width_space)] //~ ERROR: lint `clippy::zero_width_space`
#![warn(clippy::clone_double_ref)] #![warn(clippy::cast_ref_to_mut)] //~ ERROR: lint `clippy::cast_ref_to_mut`
#![warn(clippy::cmp_nan)] #![warn(clippy::clone_double_ref)] //~ ERROR: lint `clippy::clone_double_ref`
#![warn(clippy::drop_bounds)] #![warn(clippy::cmp_nan)] //~ ERROR: lint `clippy::cmp_nan`
#![warn(clippy::drop_copy)] #![warn(clippy::drop_bounds)] //~ ERROR: lint `clippy::drop_bounds`
#![warn(clippy::drop_ref)] #![warn(clippy::drop_copy)] //~ ERROR: lint `clippy::drop_copy`
#![warn(clippy::fn_null_check)] #![warn(clippy::drop_ref)] //~ ERROR: lint `clippy::drop_ref`
#![warn(clippy::for_loop_over_option)] #![warn(clippy::fn_null_check)] //~ ERROR: lint `clippy::fn_null_check`
#![warn(clippy::for_loop_over_result)] #![warn(clippy::for_loop_over_option)] //~ ERROR: lint `clippy::for_loop_over_option`
#![warn(clippy::for_loops_over_fallibles)] #![warn(clippy::for_loop_over_result)] //~ ERROR: lint `clippy::for_loop_over_result`
#![warn(clippy::forget_copy)] #![warn(clippy::for_loops_over_fallibles)] //~ ERROR: lint `clippy::for_loops_over_fallibles`
#![warn(clippy::forget_ref)] #![warn(clippy::forget_copy)] //~ ERROR: lint `clippy::forget_copy`
#![warn(clippy::into_iter_on_array)] #![warn(clippy::forget_ref)] //~ ERROR: lint `clippy::forget_ref`
#![warn(clippy::invalid_atomic_ordering)] #![warn(clippy::into_iter_on_array)] //~ ERROR: lint `clippy::into_iter_on_array`
#![warn(clippy::invalid_ref)] #![warn(clippy::invalid_atomic_ordering)] //~ ERROR: lint `clippy::invalid_atomic_ordering`
#![warn(clippy::invalid_utf8_in_unchecked)] #![warn(clippy::invalid_ref)] //~ ERROR: lint `clippy::invalid_ref`
#![warn(clippy::let_underscore_drop)] #![warn(clippy::invalid_utf8_in_unchecked)] //~ ERROR: lint `clippy::invalid_utf8_in_unchecked`
#![warn(clippy::maybe_misused_cfg)] #![warn(clippy::let_underscore_drop)] //~ ERROR: lint `clippy::let_underscore_drop`
#![warn(clippy::mem_discriminant_non_enum)] #![warn(clippy::maybe_misused_cfg)] //~ ERROR: lint `clippy::maybe_misused_cfg`
#![warn(clippy::mismatched_target_os)] #![warn(clippy::mem_discriminant_non_enum)] //~ ERROR: lint `clippy::mem_discriminant_non_enum`
#![warn(clippy::panic_params)] #![warn(clippy::mismatched_target_os)] //~ ERROR: lint `clippy::mismatched_target_os`
#![warn(clippy::positional_named_format_parameters)] #![warn(clippy::panic_params)] //~ ERROR: lint `clippy::panic_params`
#![warn(clippy::temporary_cstring_as_ptr)] #![warn(clippy::positional_named_format_parameters)] //~ ERROR: lint `clippy::positional_named_format_parameters`
#![warn(clippy::undropped_manually_drops)] #![warn(clippy::temporary_cstring_as_ptr)] //~ ERROR: lint `clippy::temporary_cstring_as_ptr`
#![warn(clippy::unknown_clippy_lints)] #![warn(clippy::undropped_manually_drops)] //~ ERROR: lint `clippy::undropped_manually_drops`
#![warn(clippy::unused_label)] #![warn(clippy::unknown_clippy_lints)] //~ ERROR: lint `clippy::unknown_clippy_lints`
#![warn(clippy::vtable_address_comparisons)] #![warn(clippy::unused_label)] //~ ERROR: lint `clippy::unused_label`
#![warn(clippy::vtable_address_comparisons)] //~ ERROR: lint `clippy::vtable_address_comparisons`
#![warn(clippy::reverse_range_loop)] //~ ERROR: lint `clippy::reverse_range_loop`
fn main() {} fn main() {}

View file

@ -1,5 +1,5 @@
error: lint `clippy::almost_complete_letter_range` has been renamed to `clippy::almost_complete_range` error: lint `clippy::almost_complete_letter_range` has been renamed to `clippy::almost_complete_range`
--> tests/ui/rename.rs:62:9 --> tests/ui/rename.rs:63:9
| |
LL | #![warn(clippy::almost_complete_letter_range)] LL | #![warn(clippy::almost_complete_letter_range)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::almost_complete_range` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::almost_complete_range`
@ -8,388 +8,394 @@ LL | #![warn(clippy::almost_complete_letter_range)]
= help: to override `-D warnings` add `#[allow(renamed_and_removed_lints)]` = help: to override `-D warnings` add `#[allow(renamed_and_removed_lints)]`
error: lint `clippy::blacklisted_name` has been renamed to `clippy::disallowed_names` error: lint `clippy::blacklisted_name` has been renamed to `clippy::disallowed_names`
--> tests/ui/rename.rs:63:9 --> tests/ui/rename.rs:64:9
| |
LL | #![warn(clippy::blacklisted_name)] LL | #![warn(clippy::blacklisted_name)]
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::disallowed_names` | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::disallowed_names`
error: lint `clippy::block_in_if_condition_expr` has been renamed to `clippy::blocks_in_conditions` error: lint `clippy::block_in_if_condition_expr` has been renamed to `clippy::blocks_in_conditions`
--> tests/ui/rename.rs:64:9 --> tests/ui/rename.rs:65:9
| |
LL | #![warn(clippy::block_in_if_condition_expr)] LL | #![warn(clippy::block_in_if_condition_expr)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::blocks_in_conditions` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::blocks_in_conditions`
error: lint `clippy::block_in_if_condition_stmt` has been renamed to `clippy::blocks_in_conditions` error: lint `clippy::block_in_if_condition_stmt` has been renamed to `clippy::blocks_in_conditions`
--> tests/ui/rename.rs:65:9 --> tests/ui/rename.rs:66:9
| |
LL | #![warn(clippy::block_in_if_condition_stmt)] LL | #![warn(clippy::block_in_if_condition_stmt)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::blocks_in_conditions` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::blocks_in_conditions`
error: lint `clippy::blocks_in_if_conditions` has been renamed to `clippy::blocks_in_conditions` error: lint `clippy::blocks_in_if_conditions` has been renamed to `clippy::blocks_in_conditions`
--> tests/ui/rename.rs:66:9 --> tests/ui/rename.rs:67:9
| |
LL | #![warn(clippy::blocks_in_if_conditions)] LL | #![warn(clippy::blocks_in_if_conditions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::blocks_in_conditions` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::blocks_in_conditions`
error: lint `clippy::box_vec` has been renamed to `clippy::box_collection` error: lint `clippy::box_vec` has been renamed to `clippy::box_collection`
--> tests/ui/rename.rs:67:9 --> tests/ui/rename.rs:68:9
| |
LL | #![warn(clippy::box_vec)] LL | #![warn(clippy::box_vec)]
| ^^^^^^^^^^^^^^^ help: use the new name: `clippy::box_collection` | ^^^^^^^^^^^^^^^ help: use the new name: `clippy::box_collection`
error: lint `clippy::const_static_lifetime` has been renamed to `clippy::redundant_static_lifetimes` error: lint `clippy::const_static_lifetime` has been renamed to `clippy::redundant_static_lifetimes`
--> tests/ui/rename.rs:68:9 --> tests/ui/rename.rs:69:9
| |
LL | #![warn(clippy::const_static_lifetime)] LL | #![warn(clippy::const_static_lifetime)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::redundant_static_lifetimes` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::redundant_static_lifetimes`
error: lint `clippy::cyclomatic_complexity` has been renamed to `clippy::cognitive_complexity` error: lint `clippy::cyclomatic_complexity` has been renamed to `clippy::cognitive_complexity`
--> tests/ui/rename.rs:69:9 --> tests/ui/rename.rs:70:9
| |
LL | #![warn(clippy::cyclomatic_complexity)] LL | #![warn(clippy::cyclomatic_complexity)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::cognitive_complexity` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::cognitive_complexity`
error: lint `clippy::derive_hash_xor_eq` has been renamed to `clippy::derived_hash_with_manual_eq` error: lint `clippy::derive_hash_xor_eq` has been renamed to `clippy::derived_hash_with_manual_eq`
--> tests/ui/rename.rs:70:9 --> tests/ui/rename.rs:71:9
| |
LL | #![warn(clippy::derive_hash_xor_eq)] LL | #![warn(clippy::derive_hash_xor_eq)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::derived_hash_with_manual_eq` | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::derived_hash_with_manual_eq`
error: lint `clippy::disallowed_method` has been renamed to `clippy::disallowed_methods` error: lint `clippy::disallowed_method` has been renamed to `clippy::disallowed_methods`
--> tests/ui/rename.rs:71:9 --> tests/ui/rename.rs:72:9
| |
LL | #![warn(clippy::disallowed_method)] LL | #![warn(clippy::disallowed_method)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::disallowed_methods` | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::disallowed_methods`
error: lint `clippy::disallowed_type` has been renamed to `clippy::disallowed_types` error: lint `clippy::disallowed_type` has been renamed to `clippy::disallowed_types`
--> tests/ui/rename.rs:72:9 --> tests/ui/rename.rs:73:9
| |
LL | #![warn(clippy::disallowed_type)] LL | #![warn(clippy::disallowed_type)]
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::disallowed_types` | ^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::disallowed_types`
error: lint `clippy::eval_order_dependence` has been renamed to `clippy::mixed_read_write_in_expression` error: lint `clippy::eval_order_dependence` has been renamed to `clippy::mixed_read_write_in_expression`
--> tests/ui/rename.rs:73:9 --> tests/ui/rename.rs:74:9
| |
LL | #![warn(clippy::eval_order_dependence)] LL | #![warn(clippy::eval_order_dependence)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::mixed_read_write_in_expression` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::mixed_read_write_in_expression`
error: lint `clippy::find_map` has been renamed to `clippy::manual_find_map` error: lint `clippy::find_map` has been renamed to `clippy::manual_find_map`
--> tests/ui/rename.rs:74:9 --> tests/ui/rename.rs:75:9
| |
LL | #![warn(clippy::find_map)] LL | #![warn(clippy::find_map)]
| ^^^^^^^^^^^^^^^^ help: use the new name: `clippy::manual_find_map` | ^^^^^^^^^^^^^^^^ help: use the new name: `clippy::manual_find_map`
error: lint `clippy::filter_map` has been renamed to `clippy::manual_filter_map` error: lint `clippy::filter_map` has been renamed to `clippy::manual_filter_map`
--> tests/ui/rename.rs:75:9 --> tests/ui/rename.rs:76:9
| |
LL | #![warn(clippy::filter_map)] LL | #![warn(clippy::filter_map)]
| ^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::manual_filter_map` | ^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::manual_filter_map`
error: lint `clippy::identity_conversion` has been renamed to `clippy::useless_conversion` error: lint `clippy::identity_conversion` has been renamed to `clippy::useless_conversion`
--> tests/ui/rename.rs:76:9 --> tests/ui/rename.rs:77:9
| |
LL | #![warn(clippy::identity_conversion)] LL | #![warn(clippy::identity_conversion)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::useless_conversion` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::useless_conversion`
error: lint `clippy::if_let_redundant_pattern_matching` has been renamed to `clippy::redundant_pattern_matching` error: lint `clippy::if_let_redundant_pattern_matching` has been renamed to `clippy::redundant_pattern_matching`
--> tests/ui/rename.rs:77:9 --> tests/ui/rename.rs:78:9
| |
LL | #![warn(clippy::if_let_redundant_pattern_matching)] LL | #![warn(clippy::if_let_redundant_pattern_matching)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::redundant_pattern_matching` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::redundant_pattern_matching`
error: lint `clippy::if_let_some_result` has been renamed to `clippy::match_result_ok` error: lint `clippy::if_let_some_result` has been renamed to `clippy::match_result_ok`
--> tests/ui/rename.rs:78:9 --> tests/ui/rename.rs:79:9
| |
LL | #![warn(clippy::if_let_some_result)] LL | #![warn(clippy::if_let_some_result)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::match_result_ok` | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::match_result_ok`
error: lint `clippy::incorrect_clone_impl_on_copy_type` has been renamed to `clippy::non_canonical_clone_impl` error: lint `clippy::incorrect_clone_impl_on_copy_type` has been renamed to `clippy::non_canonical_clone_impl`
--> tests/ui/rename.rs:79:9 --> tests/ui/rename.rs:80:9
| |
LL | #![warn(clippy::incorrect_clone_impl_on_copy_type)] LL | #![warn(clippy::incorrect_clone_impl_on_copy_type)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::non_canonical_clone_impl` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::non_canonical_clone_impl`
error: lint `clippy::incorrect_partial_ord_impl_on_ord_type` has been renamed to `clippy::non_canonical_partial_ord_impl` error: lint `clippy::incorrect_partial_ord_impl_on_ord_type` has been renamed to `clippy::non_canonical_partial_ord_impl`
--> tests/ui/rename.rs:80:9 --> tests/ui/rename.rs:81:9
| |
LL | #![warn(clippy::incorrect_partial_ord_impl_on_ord_type)] LL | #![warn(clippy::incorrect_partial_ord_impl_on_ord_type)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::non_canonical_partial_ord_impl` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::non_canonical_partial_ord_impl`
error: lint `clippy::integer_arithmetic` has been renamed to `clippy::arithmetic_side_effects` error: lint `clippy::integer_arithmetic` has been renamed to `clippy::arithmetic_side_effects`
--> tests/ui/rename.rs:81:9 --> tests/ui/rename.rs:82:9
| |
LL | #![warn(clippy::integer_arithmetic)] LL | #![warn(clippy::integer_arithmetic)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::arithmetic_side_effects` | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::arithmetic_side_effects`
error: lint `clippy::logic_bug` has been renamed to `clippy::overly_complex_bool_expr` error: lint `clippy::logic_bug` has been renamed to `clippy::overly_complex_bool_expr`
--> tests/ui/rename.rs:82:9 --> tests/ui/rename.rs:83:9
| |
LL | #![warn(clippy::logic_bug)] LL | #![warn(clippy::logic_bug)]
| ^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::overly_complex_bool_expr` | ^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::overly_complex_bool_expr`
error: lint `clippy::new_without_default_derive` has been renamed to `clippy::new_without_default` error: lint `clippy::new_without_default_derive` has been renamed to `clippy::new_without_default`
--> tests/ui/rename.rs:83:9 --> tests/ui/rename.rs:84:9
| |
LL | #![warn(clippy::new_without_default_derive)] LL | #![warn(clippy::new_without_default_derive)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::new_without_default` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::new_without_default`
error: lint `clippy::option_and_then_some` has been renamed to `clippy::bind_instead_of_map` error: lint `clippy::option_and_then_some` has been renamed to `clippy::bind_instead_of_map`
--> tests/ui/rename.rs:84:9 --> tests/ui/rename.rs:85:9
| |
LL | #![warn(clippy::option_and_then_some)] LL | #![warn(clippy::option_and_then_some)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::bind_instead_of_map` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::bind_instead_of_map`
error: lint `clippy::option_expect_used` has been renamed to `clippy::expect_used` error: lint `clippy::option_expect_used` has been renamed to `clippy::expect_used`
--> tests/ui/rename.rs:85:9 --> tests/ui/rename.rs:86:9
| |
LL | #![warn(clippy::option_expect_used)] LL | #![warn(clippy::option_expect_used)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::expect_used` | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::expect_used`
error: lint `clippy::option_map_unwrap_or` has been renamed to `clippy::map_unwrap_or` error: lint `clippy::option_map_unwrap_or` has been renamed to `clippy::map_unwrap_or`
--> tests/ui/rename.rs:86:9 --> tests/ui/rename.rs:87:9
| |
LL | #![warn(clippy::option_map_unwrap_or)] LL | #![warn(clippy::option_map_unwrap_or)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or`
error: lint `clippy::option_map_unwrap_or_else` has been renamed to `clippy::map_unwrap_or` error: lint `clippy::option_map_unwrap_or_else` has been renamed to `clippy::map_unwrap_or`
--> tests/ui/rename.rs:87:9 --> tests/ui/rename.rs:88:9
| |
LL | #![warn(clippy::option_map_unwrap_or_else)] LL | #![warn(clippy::option_map_unwrap_or_else)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or`
error: lint `clippy::option_unwrap_used` has been renamed to `clippy::unwrap_used` error: lint `clippy::option_unwrap_used` has been renamed to `clippy::unwrap_used`
--> tests/ui/rename.rs:88:9 --> tests/ui/rename.rs:89:9
| |
LL | #![warn(clippy::option_unwrap_used)] LL | #![warn(clippy::option_unwrap_used)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::unwrap_used` | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::unwrap_used`
error: lint `clippy::overflow_check_conditional` has been renamed to `clippy::panicking_overflow_checks` error: lint `clippy::overflow_check_conditional` has been renamed to `clippy::panicking_overflow_checks`
--> tests/ui/rename.rs:89:9 --> tests/ui/rename.rs:90:9
| |
LL | #![warn(clippy::overflow_check_conditional)] LL | #![warn(clippy::overflow_check_conditional)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::panicking_overflow_checks` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::panicking_overflow_checks`
error: lint `clippy::ref_in_deref` has been renamed to `clippy::needless_borrow` error: lint `clippy::ref_in_deref` has been renamed to `clippy::needless_borrow`
--> tests/ui/rename.rs:90:9 --> tests/ui/rename.rs:91:9
| |
LL | #![warn(clippy::ref_in_deref)] LL | #![warn(clippy::ref_in_deref)]
| ^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::needless_borrow` | ^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::needless_borrow`
error: lint `clippy::result_expect_used` has been renamed to `clippy::expect_used` error: lint `clippy::result_expect_used` has been renamed to `clippy::expect_used`
--> tests/ui/rename.rs:91:9 --> tests/ui/rename.rs:92:9
| |
LL | #![warn(clippy::result_expect_used)] LL | #![warn(clippy::result_expect_used)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::expect_used` | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::expect_used`
error: lint `clippy::result_map_unwrap_or_else` has been renamed to `clippy::map_unwrap_or` error: lint `clippy::result_map_unwrap_or_else` has been renamed to `clippy::map_unwrap_or`
--> tests/ui/rename.rs:92:9 --> tests/ui/rename.rs:93:9
| |
LL | #![warn(clippy::result_map_unwrap_or_else)] LL | #![warn(clippy::result_map_unwrap_or_else)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or`
error: lint `clippy::result_unwrap_used` has been renamed to `clippy::unwrap_used` error: lint `clippy::result_unwrap_used` has been renamed to `clippy::unwrap_used`
--> tests/ui/rename.rs:93:9 --> tests/ui/rename.rs:94:9
| |
LL | #![warn(clippy::result_unwrap_used)] LL | #![warn(clippy::result_unwrap_used)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::unwrap_used` | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::unwrap_used`
error: lint `clippy::single_char_push_str` has been renamed to `clippy::single_char_add_str` error: lint `clippy::single_char_push_str` has been renamed to `clippy::single_char_add_str`
--> tests/ui/rename.rs:94:9 --> tests/ui/rename.rs:95:9
| |
LL | #![warn(clippy::single_char_push_str)] LL | #![warn(clippy::single_char_push_str)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::single_char_add_str` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::single_char_add_str`
error: lint `clippy::stutter` has been renamed to `clippy::module_name_repetitions` error: lint `clippy::stutter` has been renamed to `clippy::module_name_repetitions`
--> tests/ui/rename.rs:95:9 --> tests/ui/rename.rs:96:9
| |
LL | #![warn(clippy::stutter)] LL | #![warn(clippy::stutter)]
| ^^^^^^^^^^^^^^^ help: use the new name: `clippy::module_name_repetitions` | ^^^^^^^^^^^^^^^ help: use the new name: `clippy::module_name_repetitions`
error: lint `clippy::thread_local_initializer_can_be_made_const` has been renamed to `clippy::missing_const_for_thread_local` error: lint `clippy::thread_local_initializer_can_be_made_const` has been renamed to `clippy::missing_const_for_thread_local`
--> tests/ui/rename.rs:96:9 --> tests/ui/rename.rs:97:9
| |
LL | #![warn(clippy::thread_local_initializer_can_be_made_const)] LL | #![warn(clippy::thread_local_initializer_can_be_made_const)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::missing_const_for_thread_local` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::missing_const_for_thread_local`
error: lint `clippy::to_string_in_display` has been renamed to `clippy::recursive_format_impl` error: lint `clippy::to_string_in_display` has been renamed to `clippy::recursive_format_impl`
--> tests/ui/rename.rs:97:9 --> tests/ui/rename.rs:98:9
| |
LL | #![warn(clippy::to_string_in_display)] LL | #![warn(clippy::to_string_in_display)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::recursive_format_impl` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::recursive_format_impl`
error: lint `clippy::unwrap_or_else_default` has been renamed to `clippy::unwrap_or_default` error: lint `clippy::unwrap_or_else_default` has been renamed to `clippy::unwrap_or_default`
--> tests/ui/rename.rs:98:9 --> tests/ui/rename.rs:99:9
| |
LL | #![warn(clippy::unwrap_or_else_default)] LL | #![warn(clippy::unwrap_or_else_default)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::unwrap_or_default` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::unwrap_or_default`
error: lint `clippy::zero_width_space` has been renamed to `clippy::invisible_characters` error: lint `clippy::zero_width_space` has been renamed to `clippy::invisible_characters`
--> tests/ui/rename.rs:99:9 --> tests/ui/rename.rs:100:9
| |
LL | #![warn(clippy::zero_width_space)] LL | #![warn(clippy::zero_width_space)]
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::invisible_characters` | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::invisible_characters`
error: lint `clippy::cast_ref_to_mut` has been renamed to `invalid_reference_casting` error: lint `clippy::cast_ref_to_mut` has been renamed to `invalid_reference_casting`
--> tests/ui/rename.rs:100:9 --> tests/ui/rename.rs:101:9
| |
LL | #![warn(clippy::cast_ref_to_mut)] LL | #![warn(clippy::cast_ref_to_mut)]
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_reference_casting` | ^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_reference_casting`
error: lint `clippy::clone_double_ref` has been renamed to `suspicious_double_ref_op` error: lint `clippy::clone_double_ref` has been renamed to `suspicious_double_ref_op`
--> tests/ui/rename.rs:101:9 --> tests/ui/rename.rs:102:9
| |
LL | #![warn(clippy::clone_double_ref)] LL | #![warn(clippy::clone_double_ref)]
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `suspicious_double_ref_op` | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `suspicious_double_ref_op`
error: lint `clippy::cmp_nan` has been renamed to `invalid_nan_comparisons` error: lint `clippy::cmp_nan` has been renamed to `invalid_nan_comparisons`
--> tests/ui/rename.rs:102:9 --> tests/ui/rename.rs:103:9
| |
LL | #![warn(clippy::cmp_nan)] LL | #![warn(clippy::cmp_nan)]
| ^^^^^^^^^^^^^^^ help: use the new name: `invalid_nan_comparisons` | ^^^^^^^^^^^^^^^ help: use the new name: `invalid_nan_comparisons`
error: lint `clippy::drop_bounds` has been renamed to `drop_bounds` error: lint `clippy::drop_bounds` has been renamed to `drop_bounds`
--> tests/ui/rename.rs:103:9 --> tests/ui/rename.rs:104:9
| |
LL | #![warn(clippy::drop_bounds)] LL | #![warn(clippy::drop_bounds)]
| ^^^^^^^^^^^^^^^^^^^ help: use the new name: `drop_bounds` | ^^^^^^^^^^^^^^^^^^^ help: use the new name: `drop_bounds`
error: lint `clippy::drop_copy` has been renamed to `dropping_copy_types` error: lint `clippy::drop_copy` has been renamed to `dropping_copy_types`
--> tests/ui/rename.rs:104:9 --> tests/ui/rename.rs:105:9
| |
LL | #![warn(clippy::drop_copy)] LL | #![warn(clippy::drop_copy)]
| ^^^^^^^^^^^^^^^^^ help: use the new name: `dropping_copy_types` | ^^^^^^^^^^^^^^^^^ help: use the new name: `dropping_copy_types`
error: lint `clippy::drop_ref` has been renamed to `dropping_references` error: lint `clippy::drop_ref` has been renamed to `dropping_references`
--> tests/ui/rename.rs:105:9 --> tests/ui/rename.rs:106:9
| |
LL | #![warn(clippy::drop_ref)] LL | #![warn(clippy::drop_ref)]
| ^^^^^^^^^^^^^^^^ help: use the new name: `dropping_references` | ^^^^^^^^^^^^^^^^ help: use the new name: `dropping_references`
error: lint `clippy::fn_null_check` has been renamed to `useless_ptr_null_checks` error: lint `clippy::fn_null_check` has been renamed to `useless_ptr_null_checks`
--> tests/ui/rename.rs:106:9 --> tests/ui/rename.rs:107:9
| |
LL | #![warn(clippy::fn_null_check)] LL | #![warn(clippy::fn_null_check)]
| ^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `useless_ptr_null_checks` | ^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `useless_ptr_null_checks`
error: lint `clippy::for_loop_over_option` has been renamed to `for_loops_over_fallibles` error: lint `clippy::for_loop_over_option` has been renamed to `for_loops_over_fallibles`
--> tests/ui/rename.rs:107:9 --> tests/ui/rename.rs:108:9
| |
LL | #![warn(clippy::for_loop_over_option)] LL | #![warn(clippy::for_loop_over_option)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles`
error: lint `clippy::for_loop_over_result` has been renamed to `for_loops_over_fallibles` error: lint `clippy::for_loop_over_result` has been renamed to `for_loops_over_fallibles`
--> tests/ui/rename.rs:108:9 --> tests/ui/rename.rs:109:9
| |
LL | #![warn(clippy::for_loop_over_result)] LL | #![warn(clippy::for_loop_over_result)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles`
error: lint `clippy::for_loops_over_fallibles` has been renamed to `for_loops_over_fallibles` error: lint `clippy::for_loops_over_fallibles` has been renamed to `for_loops_over_fallibles`
--> tests/ui/rename.rs:109:9 --> tests/ui/rename.rs:110:9
| |
LL | #![warn(clippy::for_loops_over_fallibles)] LL | #![warn(clippy::for_loops_over_fallibles)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles`
error: lint `clippy::forget_copy` has been renamed to `forgetting_copy_types` error: lint `clippy::forget_copy` has been renamed to `forgetting_copy_types`
--> tests/ui/rename.rs:110:9 --> tests/ui/rename.rs:111:9
| |
LL | #![warn(clippy::forget_copy)] LL | #![warn(clippy::forget_copy)]
| ^^^^^^^^^^^^^^^^^^^ help: use the new name: `forgetting_copy_types` | ^^^^^^^^^^^^^^^^^^^ help: use the new name: `forgetting_copy_types`
error: lint `clippy::forget_ref` has been renamed to `forgetting_references` error: lint `clippy::forget_ref` has been renamed to `forgetting_references`
--> tests/ui/rename.rs:111:9 --> tests/ui/rename.rs:112:9
| |
LL | #![warn(clippy::forget_ref)] LL | #![warn(clippy::forget_ref)]
| ^^^^^^^^^^^^^^^^^^ help: use the new name: `forgetting_references` | ^^^^^^^^^^^^^^^^^^ help: use the new name: `forgetting_references`
error: lint `clippy::into_iter_on_array` has been renamed to `array_into_iter` error: lint `clippy::into_iter_on_array` has been renamed to `array_into_iter`
--> tests/ui/rename.rs:112:9 --> tests/ui/rename.rs:113:9
| |
LL | #![warn(clippy::into_iter_on_array)] LL | #![warn(clippy::into_iter_on_array)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `array_into_iter` | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `array_into_iter`
error: lint `clippy::invalid_atomic_ordering` has been renamed to `invalid_atomic_ordering` error: lint `clippy::invalid_atomic_ordering` has been renamed to `invalid_atomic_ordering`
--> tests/ui/rename.rs:113:9 --> tests/ui/rename.rs:114:9
| |
LL | #![warn(clippy::invalid_atomic_ordering)] LL | #![warn(clippy::invalid_atomic_ordering)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_atomic_ordering` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_atomic_ordering`
error: lint `clippy::invalid_ref` has been renamed to `invalid_value` error: lint `clippy::invalid_ref` has been renamed to `invalid_value`
--> tests/ui/rename.rs:114:9 --> tests/ui/rename.rs:115:9
| |
LL | #![warn(clippy::invalid_ref)] LL | #![warn(clippy::invalid_ref)]
| ^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_value` | ^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_value`
error: lint `clippy::invalid_utf8_in_unchecked` has been renamed to `invalid_from_utf8_unchecked` error: lint `clippy::invalid_utf8_in_unchecked` has been renamed to `invalid_from_utf8_unchecked`
--> tests/ui/rename.rs:115:9 --> tests/ui/rename.rs:116:9
| |
LL | #![warn(clippy::invalid_utf8_in_unchecked)] LL | #![warn(clippy::invalid_utf8_in_unchecked)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_from_utf8_unchecked` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_from_utf8_unchecked`
error: lint `clippy::let_underscore_drop` has been renamed to `let_underscore_drop` error: lint `clippy::let_underscore_drop` has been renamed to `let_underscore_drop`
--> tests/ui/rename.rs:116:9 --> tests/ui/rename.rs:117:9
| |
LL | #![warn(clippy::let_underscore_drop)] LL | #![warn(clippy::let_underscore_drop)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `let_underscore_drop` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `let_underscore_drop`
error: lint `clippy::maybe_misused_cfg` has been renamed to `unexpected_cfgs` error: lint `clippy::maybe_misused_cfg` has been renamed to `unexpected_cfgs`
--> tests/ui/rename.rs:117:9 --> tests/ui/rename.rs:118:9
| |
LL | #![warn(clippy::maybe_misused_cfg)] LL | #![warn(clippy::maybe_misused_cfg)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unexpected_cfgs` | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unexpected_cfgs`
error: lint `clippy::mem_discriminant_non_enum` has been renamed to `enum_intrinsics_non_enums` error: lint `clippy::mem_discriminant_non_enum` has been renamed to `enum_intrinsics_non_enums`
--> tests/ui/rename.rs:118:9 --> tests/ui/rename.rs:119:9
| |
LL | #![warn(clippy::mem_discriminant_non_enum)] LL | #![warn(clippy::mem_discriminant_non_enum)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `enum_intrinsics_non_enums` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `enum_intrinsics_non_enums`
error: lint `clippy::mismatched_target_os` has been renamed to `unexpected_cfgs` error: lint `clippy::mismatched_target_os` has been renamed to `unexpected_cfgs`
--> tests/ui/rename.rs:119:9 --> tests/ui/rename.rs:120:9
| |
LL | #![warn(clippy::mismatched_target_os)] LL | #![warn(clippy::mismatched_target_os)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unexpected_cfgs` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unexpected_cfgs`
error: lint `clippy::panic_params` has been renamed to `non_fmt_panics` error: lint `clippy::panic_params` has been renamed to `non_fmt_panics`
--> tests/ui/rename.rs:120:9 --> tests/ui/rename.rs:121:9
| |
LL | #![warn(clippy::panic_params)] LL | #![warn(clippy::panic_params)]
| ^^^^^^^^^^^^^^^^^^^^ help: use the new name: `non_fmt_panics` | ^^^^^^^^^^^^^^^^^^^^ help: use the new name: `non_fmt_panics`
error: lint `clippy::positional_named_format_parameters` has been renamed to `named_arguments_used_positionally` error: lint `clippy::positional_named_format_parameters` has been renamed to `named_arguments_used_positionally`
--> tests/ui/rename.rs:121:9 --> tests/ui/rename.rs:122:9
| |
LL | #![warn(clippy::positional_named_format_parameters)] LL | #![warn(clippy::positional_named_format_parameters)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `named_arguments_used_positionally` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `named_arguments_used_positionally`
error: lint `clippy::temporary_cstring_as_ptr` has been renamed to `temporary_cstring_as_ptr` error: lint `clippy::temporary_cstring_as_ptr` has been renamed to `temporary_cstring_as_ptr`
--> tests/ui/rename.rs:122:9 --> tests/ui/rename.rs:123:9
| |
LL | #![warn(clippy::temporary_cstring_as_ptr)] LL | #![warn(clippy::temporary_cstring_as_ptr)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `temporary_cstring_as_ptr` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `temporary_cstring_as_ptr`
error: lint `clippy::undropped_manually_drops` has been renamed to `undropped_manually_drops` error: lint `clippy::undropped_manually_drops` has been renamed to `undropped_manually_drops`
--> tests/ui/rename.rs:123:9 --> tests/ui/rename.rs:124:9
| |
LL | #![warn(clippy::undropped_manually_drops)] LL | #![warn(clippy::undropped_manually_drops)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `undropped_manually_drops` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `undropped_manually_drops`
error: lint `clippy::unknown_clippy_lints` has been renamed to `unknown_lints` error: lint `clippy::unknown_clippy_lints` has been renamed to `unknown_lints`
--> tests/ui/rename.rs:124:9 --> tests/ui/rename.rs:125:9
| |
LL | #![warn(clippy::unknown_clippy_lints)] LL | #![warn(clippy::unknown_clippy_lints)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unknown_lints` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unknown_lints`
error: lint `clippy::unused_label` has been renamed to `unused_labels` error: lint `clippy::unused_label` has been renamed to `unused_labels`
--> tests/ui/rename.rs:125:9 --> tests/ui/rename.rs:126:9
| |
LL | #![warn(clippy::unused_label)] LL | #![warn(clippy::unused_label)]
| ^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unused_labels` | ^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unused_labels`
error: lint `clippy::vtable_address_comparisons` has been renamed to `ambiguous_wide_pointer_comparisons` error: lint `clippy::vtable_address_comparisons` has been renamed to `ambiguous_wide_pointer_comparisons`
--> tests/ui/rename.rs:126:9 --> tests/ui/rename.rs:127:9
| |
LL | #![warn(clippy::vtable_address_comparisons)] LL | #![warn(clippy::vtable_address_comparisons)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `ambiguous_wide_pointer_comparisons` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `ambiguous_wide_pointer_comparisons`
error: aborting due to 65 previous errors error: lint `clippy::reverse_range_loop` has been renamed to `clippy::reversed_empty_ranges`
--> tests/ui/rename.rs:128:9
|
LL | #![warn(clippy::reverse_range_loop)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::reversed_empty_ranges`
error: aborting due to 66 previous errors

View file

@ -605,7 +605,7 @@ Otherwise, have a great day =^.^=
<a href="https://github.com/rust-lang/rust-clippy/issues?q=is%3Aissue+{{lint.id}}">Related Issues</a> <a href="https://github.com/rust-lang/rust-clippy/issues?q=is%3Aissue+{{lint.id}}">Related Issues</a>
</div> </div>
<!-- Jump to source --> <!-- Jump to source -->
<div class="lint-additional-info-item"> <div class="lint-additional-info-item" ng-if="lint.id_span">
<a href="https://github.com/rust-lang/rust-clippy/blob/{{docVersion}}/clippy_lints/{{lint.id_span.path}}#L{{lint.id_span.line}}">View Source</a> <a href="https://github.com/rust-lang/rust-clippy/blob/{{docVersion}}/clippy_lints/{{lint.id_span.path}}#L{{lint.id_span.line}}">View Source</a>
</div> </div>
</div> </div>