Auto merge of #13180 - Jarcho:deprecated_shrink, r=flip1995

Simplify lint deprecation

A couple of small changes:
* A few deprecations were changed to renames. They all had a message similar to "this lint has been replaced by ..." which is just describing a rename.
* The website and warning message are now the same. The website description was usually just a wordier version that contained no extra information. This can be worked around if needed, but I don't think that will happen.
* The legacy deprecations have been removed. rustc should handle this since it already suggests adding the `clippy::` for all lints (deprecated or not) when they're used without it. It wouldn't be a problem to add them back in.
* The website no longer has a "view source" link for deprecated lints since they're no longer read from the HIR tree. I could store the line number, but the link seems totally useless for these lints.

This came up as part of separating the internal lints into their own crate. Both the metadata collector and the lint registration code needs access to the deprecated and renamed lists. This form lets all the deprecations be a separate crate.

r? `@flip1995`

changelog: none
This commit is contained in:
bors 2024-08-05 13:23:16 +00:00
commit e17d254e2b
22 changed files with 584 additions and 1098 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_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
[`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
[`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

View file

@ -74,7 +74,7 @@ fn main() {
new_name,
uplift,
} => update_lints::rename(&old_name, new_name.as_ref().unwrap_or(&old_name), uplift),
DevCommand::Deprecate { name, reason } => update_lints::deprecate(&name, reason.as_deref()),
DevCommand::Deprecate { name, reason } => update_lints::deprecate(&name, &reason),
}
}
@ -223,7 +223,7 @@ enum DevCommand {
name: String,
#[arg(long, short)]
/// The reason for deprecation
reason: Option<String>,
reason: String,
},
}

View file

@ -3,6 +3,12 @@ use std::process::Command;
use std::time::{Duration, SystemTime};
use std::{env, thread};
#[cfg(windows)]
const PYTHON: &str = "python";
#[cfg(not(windows))]
const PYTHON: &str = "python3";
/// # Panics
///
/// 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() {
thread::spawn(move || {
Command::new("python3")
Command::new(PYTHON)
.arg("-m")
.arg("http.server")
.arg(port.to_string())

View file

@ -1,13 +1,12 @@
use crate::clippy_project_root;
use aho_corasick::AhoCorasickBuilder;
use indoc::writedoc;
use itertools::Itertools;
use rustc_lexer::{tokenize, unescape, LiteralKind, TokenKind};
use std::collections::{HashMap, HashSet};
use std::ffi::OsStr;
use std::fmt::{self, Write};
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::path::{Path, PathBuf};
use walkdir::{DirEntry, WalkDir};
@ -77,12 +76,8 @@ fn generate_lint_files(
for lint in usable_lints
.iter()
.map(|l| &*l.name)
.chain(deprecated_lints.iter().map(|l| &*l.name))
.chain(
renamed_lints
.iter()
.map(|l| l.old_name.strip_prefix("clippy::").unwrap_or(&l.old_name)),
)
.chain(deprecated_lints.iter().filter_map(|l| l.name.strip_prefix("clippy::")))
.chain(renamed_lints.iter().filter_map(|l| l.old_name.strip_prefix("clippy::")))
.sorted()
{
writeln!(res, "[`{lint}`]: {DOCS_LINK}#{lint}").unwrap();
@ -108,11 +103,6 @@ fn generate_lint_files(
update_mode,
&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);
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();
(ext == Some(OsStr::new("rs")) || ext == Some(OsStr::new("fixed")))
&& 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| {
@ -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.sort_by(|lhs, rhs| {
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))
});
write_file(
Path::new("clippy_lints/src/renamed_lints.rs"),
&gen_renamed_lints_list(&renamed_lints),
);
if uplift {
write_file(Path::new("tests/ui/rename.rs"), &gen_renamed_lints_test(&renamed_lints));
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
// 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));
}
@ -304,7 +303,6 @@ pub fn rename(old_name: &str, new_name: &str, uplift: bool) {
println!("note: `cargo uitest` still needs to be run to update the test results");
}
const DEFAULT_DEPRECATION_REASON: &str = "default deprecation note";
/// Runs the `deprecate` command
///
/// This does the following:
@ -314,33 +312,16 @@ const DEFAULT_DEPRECATION_REASON: &str = "default deprecation note";
/// # Panics
///
/// If a file path could not read from or written to
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(),
});
pub fn deprecate(name: &str, reason: &str) {
let prefixed_name = if name.starts_with("clippy::") {
name.to_owned()
} else {
format!("clippy::{name}")
};
let stripped_name = &prefixed_name[8..];
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 name_lower = name.to_lowercase();
let name_upper = name.to_uppercase();
let (mut lints, deprecated_lints, renamed_lints) = gather_all();
let Some(lint) = lints.iter().find(|l| l.name == name_lower) else {
let (mut lints, mut deprecated_lints, renamed_lints) = gather_all();
let Some(lint) = lints.iter().find(|l| l.name == stripped_name) else {
eprintln!("error: failed to find lint `{name}`");
return;
};
@ -357,13 +338,27 @@ pub fn deprecate(name: &str, reason: Option<&str>) {
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) {
declare_deprecated(&name_upper, deprecated_lints_path, reason).unwrap();
finish((lints, deprecated_lints, renamed_lints), name, reason);
return;
}
if remove_lint_declaration(stripped_name, &mod_path, &mut lints).unwrap_or(false) {
let version = crate::new_lint::get_stabilization_version();
rewrite_file(deprecated_lints_path, |s| {
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");
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> {
@ -465,37 +460,6 @@ fn remove_lint_declaration(name: &str, path: &Path, lints: &mut Vec<Lint>) -> io
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
/// were no replacements.
fn replace_ident_like(contents: &str, replacements: &[(&str, &str)]) -> Option<String> {
@ -604,14 +568,12 @@ impl Lint {
struct DeprecatedLint {
name: String,
reason: String,
declaration_range: Range<usize>,
}
impl DeprecatedLint {
fn new(name: &str, reason: &str, declaration_range: Range<usize>) -> Self {
fn new(name: &str, reason: &str) -> Self {
Self {
name: name.to_lowercase(),
name: remove_line_splices(name),
reason: remove_line_splices(reason),
declaration_range,
}
}
}
@ -629,28 +591,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
#[must_use]
fn gen_declared_lints<'a>(
@ -680,7 +620,7 @@ fn gen_declared_lints<'a>(
fn gen_deprecated_lints_test(lints: &[DeprecatedLint]) -> String {
let mut res: String = GENERATED_FILE_COMMENT.into();
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
@ -699,27 +639,13 @@ fn gen_renamed_lints_test(lints: &[RenamedLint]) -> String {
seen_lints.clear();
for lint in lints {
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
}
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`
fn gather_all() -> (Vec<Lint>, Vec<DeprecatedLint>, Vec<RenamedLint>) {
let mut lints = Vec::with_capacity(1000);
@ -744,10 +670,10 @@ fn gather_all() -> (Vec<Lint>, Vec<DeprecatedLint>, Vec<RenamedLint>) {
module.strip_suffix(".rs").unwrap_or(&module)
};
match module {
"deprecated_lints" => parse_deprecated_contents(&contents, &mut deprecated_lints),
"renamed_lints" => parse_renamed_contents(&contents, &mut renamed_lints),
_ => parse_contents(&contents, module, &mut lints),
if module == "deprecated_lints" {
parse_deprecated_contents(&contents, &mut deprecated_lints, &mut renamed_lints);
} else {
parse_contents(&contents, module, &mut lints);
}
}
(lints, deprecated_lints, renamed_lints)
@ -848,54 +774,37 @@ fn parse_contents(contents: &str, module: &str, lints: &mut Vec<Lint>) {
}
/// Parse a source file looking for `declare_deprecated_lint` macro invocations.
fn parse_deprecated_contents(contents: &str, lints: &mut Vec<DeprecatedLint>) {
let mut offset = 0usize;
let mut iter = tokenize(contents).map(|t| {
let range = offset..offset + t.len as usize;
offset = range.end;
fn parse_deprecated_contents(contents: &str, deprecated: &mut Vec<DeprecatedLint>, renamed: &mut Vec<RenamedLint>) {
let Some((_, contents)) = contents.split_once("\ndeclare_with_version! { DEPRECATED") else {
return;
};
let Some((deprecated_src, renamed_src)) = contents.split_once("\ndeclare_with_version! { RENAMED") else {
return;
};
LintDeclSearchResult {
token_kind: t.kind,
content: &contents[range.clone()],
range,
}
});
for line in deprecated_src.lines() {
let mut offset = 0usize;
let mut iter = tokenize(line).map(|t| {
let range = offset..offset + t.len as usize;
offset = range.end;
while let Some(LintDeclSearchResult { range, .. }) = iter.find(
|LintDeclSearchResult {
token_kind, content, ..
}| token_kind == &TokenKind::Ident && *content == "declare_deprecated_lint",
) {
let start = range.start;
let mut iter = iter.by_ref().filter(|LintDeclSearchResult { ref token_kind, .. }| {
!matches!(token_kind, TokenKind::Whitespace | TokenKind::LineComment { .. })
LintDeclSearchResult {
token_kind: t.kind,
content: &line[range.clone()],
range,
}
});
let (name, reason) = match_tokens!(
iter,
// !{
Bang OpenBrace
// #[clippy::version = "version"]
Pound OpenBracket Ident Colon Colon Ident Eq Literal{..} CloseBracket
// pub LINT_NAME,
Ident Ident(name) Comma
// "description"
Literal{kind: LiteralKind::Str{..},..}(reason)
// ("old_name",
Whitespace OpenParen Literal{kind: LiteralKind::Str{..},..}(name) Comma
// "new_name"),
Whitespace Literal{kind: LiteralKind::Str{..},..}(reason) CloseParen Comma
);
if let Some(LintDeclSearchResult {
token_kind: TokenKind::CloseBrace,
range,
..
}) = iter.next()
{
lints.push(DeprecatedLint::new(name, reason, start..range.end));
}
deprecated.push(DeprecatedLint::new(name, reason));
}
}
fn parse_renamed_contents(contents: &str, lints: &mut Vec<RenamedLint>) {
for line in contents.lines() {
for line in renamed_src.lines() {
let mut offset = 0usize;
let mut iter = tokenize(line).map(|t| {
let range = offset..offset + t.len as usize;
@ -915,7 +824,7 @@ fn parse_renamed_contents(contents: &str, lints: &mut Vec<RenamedLint>) {
// "new_name"),
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 +924,12 @@ fn panic_file(error: io::Error, name: &Path, action: &str) -> ! {
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>) {
let mut file = OpenOptions::new()
.write(true)
@ -1084,31 +999,6 @@ mod tests {
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]
fn test_usable_lints() {
let lints = vec![
@ -1177,34 +1067,4 @@ mod tests {
);
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

@ -14,8 +14,6 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[
#[cfg(feature = "internal")]
crate::utils::internal_lints::invalid_paths::INVALID_PATHS_INFO,
#[cfg(feature = "internal")]
crate::utils::internal_lints::lint_without_lint_pass::DEFAULT_DEPRECATION_REASON_INFO,
#[cfg(feature = "internal")]
crate::utils::internal_lints::lint_without_lint_pass::DEFAULT_LINT_INFO,
#[cfg(feature = "internal")]
crate::utils::internal_lints::lint_without_lint_pass::INVALID_CLIPPY_VERSION_ATTRIBUTE_INFO,

View file

@ -1,243 +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
/// enables the simple extraction of the metadata without changing the current deprecation
/// declaration.
pub struct ClippyDeprecatedLint {
#[allow(dead_code)]
pub desc: &'static str,
macro_rules! declare_with_version {
($name:ident($name_version:ident): &[$ty:ty] = &[$(
#[clippy::version = $version:literal]
$e:expr,
)*]) => {
pub static $name: &[$ty] = &[$($e),*];
#[allow(unused)]
pub static $name_version: &[&str] = &[$($version),*];
};
}
#[macro_export]
macro_rules! declare_deprecated_lint {
{ $(#[$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.
#[rustfmt::skip]
declare_with_version! { DEPRECATED(DEPRECATED_VERSION): &[(&str, &str)] = &[
#[clippy::version = "pre 1.29.0"]
pub SHOULD_ASSERT_EQ,
"`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::should_assert_eq", "`assert!(a == b)` can now print the values the same way `assert_eq!(a, b) can"),
#[clippy::version = "pre 1.29.0"]
pub EXTEND_FROM_SLICE,
"`.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::extend_from_slice", "`Vec::extend_from_slice` is no longer faster than `Vec::extend` due to specialization"),
#[clippy::version = "pre 1.29.0"]
pub RANGE_STEP_BY_ZERO,
"`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::range_step_by_zero", "`Iterator::step_by(0)` now panics and is no longer an infinite iterator"),
#[clippy::version = "pre 1.29.0"]
pub UNSTABLE_AS_SLICE,
"`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::unstable_as_slice", "`Vec::as_slice` is now stable"),
#[clippy::version = "pre 1.29.0"]
pub UNSTABLE_AS_MUT_SLICE,
"`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::unstable_as_mut_slice", "`Vec::as_mut_slice` is now stable"),
#[clippy::version = "pre 1.29.0"]
pub MISALIGNED_TRANSMUTE,
"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::misaligned_transmute", "split into `clippy::cast_ptr_alignment` and `clippy::transmute_ptr_to_ptr`"),
#[clippy::version = "1.30.0"]
pub ASSIGN_OPS,
"using compound assignment operators (e.g., `+=`) is harmless"
}
declare_deprecated_lint! {
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// The original rule will only lint for `if let`. After
/// making it support to lint `match`, naming as `if let` is not suitable for it.
/// So, this lint is deprecated.
("clippy::assign_ops", "compound operators are harmless and linting on them is not in scope for clippy"),
#[clippy::version = "pre 1.29.0"]
pub IF_LET_REDUNDANT_PATTERN_MATCHING,
"this lint has been changed to redundant_pattern_matching"
}
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"]
pub UNSAFE_VECTOR_INITIALIZATION,
"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::unsafe_vector_initialization", "the suggested alternative could be substantially slower"),
#[clippy::version = "1.39.0"]
pub UNUSED_COLLECT,
"`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::unused_collect", "`Iterator::collect` is now marked as `#[must_use]`"),
#[clippy::version = "1.44.0"]
pub REPLACE_CONSTS,
"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::replace_consts", "`min_value` and `max_value` are now deprecated"),
#[clippy::version = "1.47.0"]
pub REGEX_MACRO,
"the regex! macro has been removed from the regex crate in 2018"
}
("clippy::regex_macro", "the `regex!` macro was removed from the regex crate in 2018"),
#[clippy::version = "1.54.0"]
("clippy::pub_enum_variant_names", "`clippy::enum_variant_names` now covers this case via the `avoid-breaking-exported-api` config"),
#[clippy::version = "1.54.0"]
("clippy::wrong_pub_self_convention", "`clippy::wrong_self_convention` now covers this case via the `avoid-breaking-exported-api` config"),
// end deprecated lints. used by `cargo dev deprecate_lint`
]}
declare_deprecated_lint! {
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// This lint has been replaced by `manual_find_map`, a
/// more specific 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"]
pub FIND_MAP,
"this lint has been replaced by `manual_find_map`, a more specific lint"
}
declare_deprecated_lint! {
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// This lint has been replaced by `manual_filter_map`, a
/// more specific lint.
("clippy::find_map", "clippy::manual_find_map"),
#[clippy::version = "1.53.0"]
pub FILTER_MAP,
"this lint has been replaced by `manual_filter_map`, a more specific lint"
}
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"]
pub PUB_ENUM_VARIANT_NAMES,
"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"]
pub WRONG_PUB_SELF_CONVENTION,
"set the `avoid-breaking-exported-api` config option to `false` to enable the `wrong_self_convention` lint for public items"
}
declare_deprecated_lint! {
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// This lint has been superseded by rustc's own [`unexpected_cfgs`] lint that is able to detect the `#[cfg(features)]` and `#[cfg(tests)]` typos.
///
/// [`unexpected_cfgs`]: https://doc.rust-lang.org/rustc/lints/listing/warn-by-default.html#unexpected-cfgs
("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"]
pub MAYBE_MISUSED_CFG,
"this lint has been replaced by `unexpected_cfgs`"
}
declare_deprecated_lint! {
/// ### What it does
/// Nothing. This lint has been deprecated.
///
/// ### Deprecation reason
/// This lint has been superseded by rustc's own [`unexpected_cfgs`] lint that is able to detect invalid `#[cfg(linux)]` attributes.
///
/// [`unexpected_cfgs`]: https://doc.rust-lang.org/rustc/lints/listing/warn-by-default.html#unexpected-cfgs
("clippy::maybe_misused_cfg", "unexpected_cfgs"),
#[clippy::version = ""]
("clippy::mem_discriminant_non_enum", "enum_intrinsics_non_enums"),
#[clippy::version = "1.80.0"]
pub MISMATCHED_TARGET_OS,
"this lint has been replaced by `unexpected_cfgs`"
}
("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,78 +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::if_let_redundant_pattern_matching",
"this lint has been changed to redundant_pattern_matching",
);
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::find_map",
"this lint has been replaced by `manual_find_map`, a more specific lint",
);
store.register_removed(
"clippy::filter_map",
"this lint has been replaced by `manual_filter_map`, a more specific lint",
);
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",
);
store.register_removed(
"clippy::maybe_misused_cfg",
"this lint has been replaced by `unexpected_cfgs`",
);
store.register_removed(
"clippy::mismatched_target_os",
"this lint has been replaced by `unexpected_cfgs`",
);
}

View file

@ -65,13 +65,11 @@ extern crate clippy_utils;
#[macro_use]
extern crate declare_clippy_lint;
#[cfg(feature = "internal")]
pub mod deprecated_lints;
#[cfg_attr(feature = "internal", allow(clippy::missing_clippy_version_attribute))]
mod utils;
mod declared_lints;
mod renamed_lints;
mod deprecated_lints;
// begin lints modules, do not remove this comment, its used in `update_lints`
mod absolute_paths;
@ -532,10 +530,14 @@ fn register_categories(store: &mut rustc_lint::LintStore) {
/// Used in `./src/driver.rs`.
#[expect(clippy::too_many_lines)]
pub fn register_lints(store: &mut rustc_lint::LintStore, conf: &'static Conf) {
register_removed_non_tool_lints(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")]
{
@ -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));
// 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,65 +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::identity_conversion", "clippy::useless_conversion"),
("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::mem_discriminant_non_enum", "enum_intrinsics_non_enums"),
("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::macros::root_macro_call_first_node;
use clippy_utils::{is_lint_allowed, match_def_path, paths};
@ -87,82 +86,32 @@ declare_clippy_lint! {
"found clippy lint without `clippy::version` attribute"
}
declare_clippy_lint! {
/// ### What it does
/// Checks for cases of an auto-generated deprecated lint without an updated reason,
/// i.e. `"default deprecation note"`.
///
/// ### Why is this bad?
/// Indicates that the documentation is incomplete.
///
/// ### Example
/// ```rust,ignore
/// declare_deprecated_lint! {
/// /// ### What it does
/// /// Nothing. This lint has been deprecated.
/// ///
/// /// ### Deprecation reason
/// /// TODO
/// #[clippy::version = "1.63.0"]
/// pub COOL_LINT,
/// "default deprecation note"
/// }
/// ```
///
/// Use instead:
/// ```rust,ignore
/// 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`"
/// }
/// ```
pub DEFAULT_DEPRECATION_REASON,
internal,
"found 'default deprecation note' in a deprecated lint declaration"
}
#[derive(Clone, Debug, Default)]
pub struct LintWithoutLintPass {
declared_lints: FxHashMap<Symbol, Span>,
registered_lints: FxHashSet<Symbol>,
}
impl_lint_pass!(LintWithoutLintPass => [DEFAULT_LINT, LINT_WITHOUT_LINT_PASS, INVALID_CLIPPY_VERSION_ATTRIBUTE, MISSING_CLIPPY_VERSION_ATTRIBUTE, DEFAULT_DEPRECATION_REASON]);
impl_lint_pass!(LintWithoutLintPass => [DEFAULT_LINT, LINT_WITHOUT_LINT_PASS, INVALID_CLIPPY_VERSION_ATTRIBUTE, MISSING_CLIPPY_VERSION_ATTRIBUTE]);
impl<'tcx> LateLintPass<'tcx> for LintWithoutLintPass {
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
if is_lint_allowed(cx, DEFAULT_LINT, item.hir_id())
|| is_lint_allowed(cx, DEFAULT_DEPRECATION_REASON, item.hir_id())
{
if is_lint_allowed(cx, DEFAULT_LINT, item.hir_id()) {
return;
}
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_deprecated_lint(cx, ty) || is_lint_ref_ty {
if is_lint_ref_type(cx, ty) {
check_invalid_clippy_version_attribute(cx, item);
let expr = &cx.tcx.hir().body(body_id).value;
let fields;
if is_lint_ref_ty {
if let ExprKind::AddrOf(_, _, inner_exp) = expr.kind
&& let ExprKind::Struct(_, struct_fields, _) = inner_exp.kind
{
fields = struct_fields;
} else {
return;
}
} else if let ExprKind::Struct(_, struct_fields, _) = expr.kind {
fields = struct_fields;
let fields = if let ExprKind::AddrOf(_, _, inner_exp) = expr.kind
&& let ExprKind::Struct(_, struct_fields, _) = inner_exp.kind
{
struct_fields
} else {
return;
}
};
let field = fields
.iter()
@ -175,25 +124,15 @@ impl<'tcx> LateLintPass<'tcx> for LintWithoutLintPass {
}) = field.expr.kind
{
let sym_str = sym.as_str();
if is_lint_ref_ty {
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" {
if sym_str == "default lint description" {
span_lint(
cx,
DEFAULT_DEPRECATION_REASON,
DEFAULT_LINT,
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) {

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
//! 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 clippy_config::{get_configuration_metadata, ClippyConfiguration};
use clippy_utils::diagnostics::span_lint;
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 rustc_ast as ast;
use rustc_data_structures::fx::FxHashMap;
@ -85,7 +84,6 @@ const SUGGESTION_DIAG_METHODS: [(&str, bool); 9] = [
("tool_only_multipart_suggestion", 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`
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);
// 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
let mut lints = std::mem::take(&mut self.lints).into_sorted_vec();
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)]
struct LintMetadata {
id: String,
id_span: SerializableSpan,
id_span: Option<SerializableSpan>,
group: String,
level: String,
docs: String,
@ -281,7 +286,7 @@ impl LintMetadata {
) -> Self {
Self {
id,
id_span,
id_span: Some(id_span),
group,
level: level.to_string(),
version,
@ -290,6 +295,29 @@ impl LintMetadata {
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) {
@ -560,24 +588,6 @@ impl<'hir> LateLintPass<'hir> for MetadataCollector {
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))
}
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>) {
for lint in lints {
let mut collected = String::new();
@ -784,7 +784,7 @@ fn collect_renames(lints: &mut Vec<LintMetadata>) {
loop {
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)
&& name == lint_name
&& 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);
clippy_lints::register_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

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,23 +2,18 @@
// Use that command to update this file and do not edit by hand.
// Manual edits will be overwritten.
#![warn(clippy::should_assert_eq)]
#![warn(clippy::extend_from_slice)]
#![warn(clippy::range_step_by_zero)]
#![warn(clippy::unstable_as_slice)]
#![warn(clippy::unstable_as_mut_slice)]
#![warn(clippy::misaligned_transmute)]
#![warn(clippy::assign_ops)]
#![warn(clippy::if_let_redundant_pattern_matching)]
#![warn(clippy::unsafe_vector_initialization)]
#![warn(clippy::unused_collect)]
#![warn(clippy::replace_consts)]
#![warn(clippy::regex_macro)]
#![warn(clippy::find_map)]
#![warn(clippy::filter_map)]
#![warn(clippy::pub_enum_variant_names)]
#![warn(clippy::wrong_pub_self_convention)]
#![warn(clippy::maybe_misused_cfg)]
#![warn(clippy::mismatched_target_os)]
#![warn(clippy::should_assert_eq)] //~ ERROR: lint `clippy::should_assert_eq`
#![warn(clippy::extend_from_slice)] //~ ERROR: lint `clippy::extend_from_slice`
#![warn(clippy::range_step_by_zero)] //~ ERROR: lint `clippy::range_step_by_zero`
#![warn(clippy::unstable_as_slice)] //~ ERROR: lint `clippy::unstable_as_slice`
#![warn(clippy::unstable_as_mut_slice)] //~ ERROR: lint `clippy::unstable_as_mut_slice`
#![warn(clippy::misaligned_transmute)] //~ ERROR: lint `clippy::misaligned_transmute`
#![warn(clippy::assign_ops)] //~ ERROR: lint `clippy::assign_ops`
#![warn(clippy::unsafe_vector_initialization)] //~ ERROR: lint `clippy::unsafe_vector_initialization`
#![warn(clippy::unused_collect)] //~ ERROR: lint `clippy::unused_collect`
#![warn(clippy::replace_consts)] //~ ERROR: lint `clippy::replace_consts`
#![warn(clippy::regex_macro)] //~ ERROR: lint `clippy::regex_macro`
#![warn(clippy::pub_enum_variant_names)] //~ ERROR: lint `clippy::pub_enum_variant_names`
#![warn(clippy::wrong_pub_self_convention)] //~ ERROR: lint `clippy::wrong_pub_self_convention`
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
|
LL | #![warn(clippy::should_assert_eq)]
@ -7,107 +7,77 @@ LL | #![warn(clippy::should_assert_eq)]
= note: `-D renamed-and-removed-lints` implied by `-D warnings`
= 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
|
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
|
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
|
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
|
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
|
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
|
LL | #![warn(clippy::assign_ops)]
| ^^^^^^^^^^^^^^^^^^
error: lint `clippy::if_let_redundant_pattern_matching` has been removed: this lint has been changed to redundant_pattern_matching
error: lint `clippy::unsafe_vector_initialization` has been removed: the suggested alternative could be substantially slower
--> tests/ui/deprecated.rs:12:9
|
LL | #![warn(clippy::if_let_redundant_pattern_matching)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: lint `clippy::unsafe_vector_initialization` has been removed: the replacement suggested by this lint had substantially different behavior
--> tests/ui/deprecated.rs:13:9
|
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
--> tests/ui/deprecated.rs:14:9
error: lint `clippy::unused_collect` has been removed: `Iterator::collect` is now marked as `#[must_use]`
--> tests/ui/deprecated.rs:13:9
|
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
--> tests/ui/deprecated.rs:15:9
error: lint `clippy::replace_consts` has been removed: `min_value` and `max_value` are now deprecated
--> tests/ui/deprecated.rs:14:9
|
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
--> tests/ui/deprecated.rs:16:9
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
|
LL | #![warn(clippy::regex_macro)]
| ^^^^^^^^^^^^^^^^^^^
error: lint `clippy::find_map` has been removed: this lint has been replaced by `manual_find_map`, a more specific lint
--> tests/ui/deprecated.rs:17:9
|
LL | #![warn(clippy::find_map)]
| ^^^^^^^^^^^^^^^^
error: lint `clippy::filter_map` has been removed: this lint has been replaced by `manual_filter_map`, a more specific lint
--> tests/ui/deprecated.rs:18:9
|
LL | #![warn(clippy::filter_map)]
| ^^^^^^^^^^^^^^^^^^
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
--> tests/ui/deprecated.rs:19:9
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
|
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
--> tests/ui/deprecated.rs:20:9
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
|
LL | #![warn(clippy::wrong_pub_self_convention)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: lint `clippy::maybe_misused_cfg` has been removed: this lint has been replaced by `unexpected_cfgs`
--> tests/ui/deprecated.rs:21:9
|
LL | #![warn(clippy::maybe_misused_cfg)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: lint `clippy::mismatched_target_os` has been removed: this lint has been replaced by `unexpected_cfgs`
--> tests/ui/deprecated.rs:22:9
|
LL | #![warn(clippy::mismatched_target_os)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 18 previous errors
error: aborting due to 13 previous errors

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

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

View file

@ -13,7 +13,10 @@
#![allow(clippy::disallowed_methods)]
#![allow(clippy::disallowed_types)]
#![allow(clippy::mixed_read_write_in_expression)]
#![allow(clippy::manual_find_map)]
#![allow(clippy::manual_filter_map)]
#![allow(clippy::useless_conversion)]
#![allow(clippy::redundant_pattern_matching)]
#![allow(clippy::match_result_ok)]
#![allow(clippy::non_canonical_clone_impl)]
#![allow(clippy::non_canonical_partial_ord_impl)]
@ -47,6 +50,7 @@
#![allow(invalid_value)]
#![allow(invalid_from_utf8_unchecked)]
#![allow(let_underscore_drop)]
#![allow(unexpected_cfgs)]
#![allow(enum_intrinsics_non_enums)]
#![allow(non_fmt_panics)]
#![allow(named_arguments_used_positionally)]
@ -55,65 +59,72 @@
#![allow(unknown_lints)]
#![allow(unused_labels)]
#![allow(ambiguous_wide_pointer_comparisons)]
#![warn(clippy::almost_complete_letter_range)]
#![warn(clippy::blacklisted_name)]
#![warn(clippy::block_in_if_condition_expr)]
#![warn(clippy::block_in_if_condition_stmt)]
#![warn(clippy::blocks_in_if_conditions)]
#![warn(clippy::box_vec)]
#![warn(clippy::const_static_lifetime)]
#![warn(clippy::cyclomatic_complexity)]
#![warn(clippy::derive_hash_xor_eq)]
#![warn(clippy::disallowed_method)]
#![warn(clippy::disallowed_type)]
#![warn(clippy::eval_order_dependence)]
#![warn(clippy::identity_conversion)]
#![warn(clippy::if_let_some_result)]
#![warn(clippy::incorrect_clone_impl_on_copy_type)]
#![warn(clippy::incorrect_partial_ord_impl_on_ord_type)]
#![warn(clippy::integer_arithmetic)]
#![warn(clippy::logic_bug)]
#![warn(clippy::new_without_default_derive)]
#![warn(clippy::option_and_then_some)]
#![warn(clippy::option_expect_used)]
#![warn(clippy::option_map_unwrap_or)]
#![warn(clippy::option_map_unwrap_or_else)]
#![warn(clippy::option_unwrap_used)]
#![warn(clippy::overflow_check_conditional)]
#![warn(clippy::ref_in_deref)]
#![warn(clippy::result_expect_used)]
#![warn(clippy::result_map_unwrap_or_else)]
#![warn(clippy::result_unwrap_used)]
#![warn(clippy::single_char_push_str)]
#![warn(clippy::stutter)]
#![warn(clippy::thread_local_initializer_can_be_made_const)]
#![warn(clippy::to_string_in_display)]
#![warn(clippy::unwrap_or_else_default)]
#![warn(clippy::zero_width_space)]
#![warn(clippy::cast_ref_to_mut)]
#![warn(clippy::clone_double_ref)]
#![warn(clippy::cmp_nan)]
#![warn(clippy::drop_bounds)]
#![warn(clippy::drop_copy)]
#![warn(clippy::drop_ref)]
#![warn(clippy::fn_null_check)]
#![warn(clippy::for_loop_over_option)]
#![warn(clippy::for_loop_over_result)]
#![warn(clippy::for_loops_over_fallibles)]
#![warn(clippy::forget_copy)]
#![warn(clippy::forget_ref)]
#![warn(clippy::into_iter_on_array)]
#![warn(clippy::invalid_atomic_ordering)]
#![warn(clippy::invalid_ref)]
#![warn(clippy::invalid_utf8_in_unchecked)]
#![warn(clippy::let_underscore_drop)]
#![warn(clippy::mem_discriminant_non_enum)]
#![warn(clippy::panic_params)]
#![warn(clippy::positional_named_format_parameters)]
#![warn(clippy::temporary_cstring_as_ptr)]
#![warn(clippy::undropped_manually_drops)]
#![warn(clippy::unknown_clippy_lints)]
#![warn(clippy::unused_label)]
#![warn(clippy::vtable_address_comparisons)]
#![allow(clippy::reversed_empty_ranges)]
#![warn(clippy::almost_complete_letter_range)] //~ ERROR: lint `clippy::almost_complete_letter_range`
#![warn(clippy::blacklisted_name)] //~ ERROR: lint `clippy::blacklisted_name`
#![warn(clippy::block_in_if_condition_expr)] //~ ERROR: lint `clippy::block_in_if_condition_expr`
#![warn(clippy::block_in_if_condition_stmt)] //~ ERROR: lint `clippy::block_in_if_condition_stmt`
#![warn(clippy::blocks_in_if_conditions)] //~ ERROR: lint `clippy::blocks_in_if_conditions`
#![warn(clippy::box_vec)] //~ ERROR: lint `clippy::box_vec`
#![warn(clippy::const_static_lifetime)] //~ ERROR: lint `clippy::const_static_lifetime`
#![warn(clippy::cyclomatic_complexity)] //~ ERROR: lint `clippy::cyclomatic_complexity`
#![warn(clippy::derive_hash_xor_eq)] //~ ERROR: lint `clippy::derive_hash_xor_eq`
#![warn(clippy::disallowed_method)] //~ ERROR: lint `clippy::disallowed_method`
#![warn(clippy::disallowed_type)] //~ ERROR: lint `clippy::disallowed_type`
#![warn(clippy::eval_order_dependence)] //~ ERROR: lint `clippy::eval_order_dependence`
#![warn(clippy::find_map)] //~ ERROR: lint `clippy::find_map`
#![warn(clippy::filter_map)] //~ ERROR: lint `clippy::filter_map`
#![warn(clippy::identity_conversion)] //~ ERROR: lint `clippy::identity_conversion`
#![warn(clippy::if_let_redundant_pattern_matching)] //~ ERROR: lint `clippy::if_let_redundant_pattern_matching`
#![warn(clippy::if_let_some_result)] //~ ERROR: lint `clippy::if_let_some_result`
#![warn(clippy::incorrect_clone_impl_on_copy_type)] //~ ERROR: lint `clippy::incorrect_clone_impl_on_copy_type`
#![warn(clippy::incorrect_partial_ord_impl_on_ord_type)] //~ ERROR: lint `clippy::incorrect_partial_ord_impl_on_ord_type`
#![warn(clippy::integer_arithmetic)] //~ ERROR: lint `clippy::integer_arithmetic`
#![warn(clippy::logic_bug)] //~ ERROR: lint `clippy::logic_bug`
#![warn(clippy::new_without_default_derive)] //~ ERROR: lint `clippy::new_without_default_derive`
#![warn(clippy::option_and_then_some)] //~ ERROR: lint `clippy::option_and_then_some`
#![warn(clippy::option_expect_used)] //~ ERROR: lint `clippy::option_expect_used`
#![warn(clippy::option_map_unwrap_or)] //~ ERROR: lint `clippy::option_map_unwrap_or`
#![warn(clippy::option_map_unwrap_or_else)] //~ ERROR: lint `clippy::option_map_unwrap_or_else`
#![warn(clippy::option_unwrap_used)] //~ ERROR: lint `clippy::option_unwrap_used`
#![warn(clippy::overflow_check_conditional)] //~ ERROR: lint `clippy::overflow_check_conditional`
#![warn(clippy::ref_in_deref)] //~ ERROR: lint `clippy::ref_in_deref`
#![warn(clippy::result_expect_used)] //~ ERROR: lint `clippy::result_expect_used`
#![warn(clippy::result_map_unwrap_or_else)] //~ ERROR: lint `clippy::result_map_unwrap_or_else`
#![warn(clippy::result_unwrap_used)] //~ ERROR: lint `clippy::result_unwrap_used`
#![warn(clippy::single_char_push_str)] //~ ERROR: lint `clippy::single_char_push_str`
#![warn(clippy::stutter)] //~ ERROR: lint `clippy::stutter`
#![warn(clippy::thread_local_initializer_can_be_made_const)] //~ ERROR: lint `clippy::thread_local_initializer_can_be_made_const`
#![warn(clippy::to_string_in_display)] //~ ERROR: lint `clippy::to_string_in_display`
#![warn(clippy::unwrap_or_else_default)] //~ ERROR: lint `clippy::unwrap_or_else_default`
#![warn(clippy::zero_width_space)] //~ ERROR: lint `clippy::zero_width_space`
#![warn(clippy::cast_ref_to_mut)] //~ ERROR: lint `clippy::cast_ref_to_mut`
#![warn(clippy::clone_double_ref)] //~ ERROR: lint `clippy::clone_double_ref`
#![warn(clippy::cmp_nan)] //~ ERROR: lint `clippy::cmp_nan`
#![warn(clippy::drop_bounds)] //~ ERROR: lint `clippy::drop_bounds`
#![warn(clippy::drop_copy)] //~ ERROR: lint `clippy::drop_copy`
#![warn(clippy::drop_ref)] //~ ERROR: lint `clippy::drop_ref`
#![warn(clippy::fn_null_check)] //~ ERROR: lint `clippy::fn_null_check`
#![warn(clippy::for_loop_over_option)] //~ ERROR: lint `clippy::for_loop_over_option`
#![warn(clippy::for_loop_over_result)] //~ ERROR: lint `clippy::for_loop_over_result`
#![warn(clippy::for_loops_over_fallibles)] //~ ERROR: lint `clippy::for_loops_over_fallibles`
#![warn(clippy::forget_copy)] //~ ERROR: lint `clippy::forget_copy`
#![warn(clippy::forget_ref)] //~ ERROR: lint `clippy::forget_ref`
#![warn(clippy::into_iter_on_array)] //~ ERROR: lint `clippy::into_iter_on_array`
#![warn(clippy::invalid_atomic_ordering)] //~ ERROR: lint `clippy::invalid_atomic_ordering`
#![warn(clippy::invalid_ref)] //~ ERROR: lint `clippy::invalid_ref`
#![warn(clippy::invalid_utf8_in_unchecked)] //~ ERROR: lint `clippy::invalid_utf8_in_unchecked`
#![warn(clippy::let_underscore_drop)] //~ ERROR: lint `clippy::let_underscore_drop`
#![warn(clippy::maybe_misused_cfg)] //~ ERROR: lint `clippy::maybe_misused_cfg`
#![warn(clippy::mem_discriminant_non_enum)] //~ ERROR: lint `clippy::mem_discriminant_non_enum`
#![warn(clippy::mismatched_target_os)] //~ ERROR: lint `clippy::mismatched_target_os`
#![warn(clippy::panic_params)] //~ ERROR: lint `clippy::panic_params`
#![warn(clippy::positional_named_format_parameters)] //~ ERROR: lint `clippy::positional_named_format_parameters`
#![warn(clippy::temporary_cstring_as_ptr)] //~ ERROR: lint `clippy::temporary_cstring_as_ptr`
#![warn(clippy::undropped_manually_drops)] //~ ERROR: lint `clippy::undropped_manually_drops`
#![warn(clippy::unknown_clippy_lints)] //~ ERROR: lint `clippy::unknown_clippy_lints`
#![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() {}

View file

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