mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-18 00:53:31 +00:00
Rename lint
This commit is contained in:
parent
d65c9a5700
commit
4b9cb857f9
7 changed files with 12 additions and 12 deletions
|
@ -4382,7 +4382,7 @@ Released 2018-09-13
|
|||
<!-- begin autogenerated links to lint list -->
|
||||
[`absurd_extreme_comparisons`]: https://rust-lang.github.io/rust-clippy/master/index.html#absurd_extreme_comparisons
|
||||
[`alloc_instead_of_core`]: https://rust-lang.github.io/rust-clippy/master/index.html#alloc_instead_of_core
|
||||
[`allow_attribute`]: https://rust-lang.github.io/rust-clippy/master/index.html#allow_attribute
|
||||
[`allow_attributes`]: https://rust-lang.github.io/rust-clippy/master/index.html#allow_attributes
|
||||
[`allow_attributes_without_reason`]: https://rust-lang.github.io/rust-clippy/master/index.html#allow_attributes_without_reason
|
||||
[`almost_complete_letter_range`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_complete_letter_range
|
||||
[`almost_complete_range`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_complete_range
|
||||
|
|
|
@ -40,12 +40,12 @@ declare_clippy_lint! {
|
|||
/// }
|
||||
/// ```
|
||||
#[clippy::version = "1.69.0"]
|
||||
pub ALLOW_ATTRIBUTE,
|
||||
pub ALLOW_ATTRIBUTES,
|
||||
restriction,
|
||||
"`#[allow]` will not trigger if a warning isn't found. `#[expect]` triggers if there are no warnings."
|
||||
}
|
||||
|
||||
declare_lint_pass!(AllowAttribute => [ALLOW_ATTRIBUTE]);
|
||||
declare_lint_pass!(AllowAttribute => [ALLOW_ATTRIBUTES]);
|
||||
|
||||
impl LateLintPass<'_> for AllowAttribute {
|
||||
// Separate each crate's features.
|
||||
|
@ -58,7 +58,7 @@ impl LateLintPass<'_> for AllowAttribute {
|
|||
then {
|
||||
span_lint_and_sugg(
|
||||
cx,
|
||||
ALLOW_ATTRIBUTE,
|
||||
ALLOW_ATTRIBUTES,
|
||||
ident.span,
|
||||
"#[allow] attribute found",
|
||||
"replace it with", "expect".into()
|
|
@ -35,7 +35,7 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[
|
|||
crate::utils::internal_lints::produce_ice::PRODUCE_ICE_INFO,
|
||||
#[cfg(feature = "internal")]
|
||||
crate::utils::internal_lints::unnecessary_def_path::UNNECESSARY_DEF_PATH_INFO,
|
||||
crate::allow_attribute::ALLOW_ATTRIBUTE_INFO,
|
||||
crate::allow_attributes::ALLOW_ATTRIBUTES_INFO,
|
||||
crate::almost_complete_range::ALMOST_COMPLETE_RANGE_INFO,
|
||||
crate::approx_const::APPROX_CONSTANT_INFO,
|
||||
crate::as_conversions::AS_CONVERSIONS_INFO,
|
||||
|
|
|
@ -67,7 +67,7 @@ mod declared_lints;
|
|||
mod renamed_lints;
|
||||
|
||||
// begin lints modules, do not remove this comment, it’s used in `update_lints`
|
||||
mod allow_attribute;
|
||||
mod allow_attributes;
|
||||
mod almost_complete_range;
|
||||
mod approx_const;
|
||||
mod as_conversions;
|
||||
|
@ -934,7 +934,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
|||
store.register_late_pass(|_| Box::new(missing_assert_message::MissingAssertMessage));
|
||||
store.register_early_pass(|| Box::new(redundant_async_block::RedundantAsyncBlock));
|
||||
store.register_late_pass(|_| Box::new(let_with_type_underscore::UnderscoreTyped));
|
||||
store.register_late_pass(|_| Box::new(allow_attribute::AllowAttribute));
|
||||
store.register_late_pass(|_| Box::new(allow_attributes::AllowAttribute));
|
||||
// add lints here, do not remove this comment, it's used in `new_lint`
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// run-rustfix
|
||||
#![allow(unused)]
|
||||
#![warn(clippy::allow_attribute)]
|
||||
#![warn(clippy::allow_attributes)]
|
||||
#![feature(lint_reasons)]
|
||||
|
||||
fn main() {}
|
|
@ -1,6 +1,6 @@
|
|||
// run-rustfix
|
||||
#![allow(unused)]
|
||||
#![warn(clippy::allow_attribute)]
|
||||
#![warn(clippy::allow_attributes)]
|
||||
#![feature(lint_reasons)]
|
||||
|
||||
fn main() {}
|
|
@ -1,13 +1,13 @@
|
|||
error: #[allow] attribute found
|
||||
--> $DIR/allow_attribute.rs:11:3
|
||||
--> $DIR/allow_attributes.rs:11:3
|
||||
|
|
||||
LL | #[allow(dead_code)]
|
||||
| ^^^^^ help: replace it with: `expect`
|
||||
|
|
||||
= note: `-D clippy::allow-attribute` implied by `-D warnings`
|
||||
= note: `-D clippy::allow-attributes` implied by `-D warnings`
|
||||
|
||||
error: #[allow] attribute found
|
||||
--> $DIR/allow_attribute.rs:20:30
|
||||
--> $DIR/allow_attributes.rs:20:30
|
||||
|
|
||||
LL | #[cfg_attr(panic = "unwind", allow(dead_code))]
|
||||
| ^^^^^ help: replace it with: `expect`
|
Loading…
Reference in a new issue