From 410c3b66ff124895caa7f70e9397b875fa8fbee7 Mon Sep 17 00:00:00 2001 From: Centri3 <114838443+Centri3@users.noreply.github.com> Date: Sun, 14 May 2023 18:53:16 -0500 Subject: [PATCH 1/4] not working implementation --- CHANGELOG.md | 1 + clippy_lints/src/casts/mod.rs | 20 +++++++++ clippy_lints/src/casts/ptr_as_underscore.rs | 49 +++++++++++++++++++++ clippy_lints/src/declared_lints.rs | 1 + tests/ui/ptr_as_underscore.rs | 11 +++++ tests/ui/ptr_as_underscore.stderr | 45 +++++++++++++++++++ 6 files changed, 127 insertions(+) create mode 100644 clippy_lints/src/casts/ptr_as_underscore.rs create mode 100644 tests/ui/ptr_as_underscore.rs create mode 100644 tests/ui/ptr_as_underscore.stderr diff --git a/CHANGELOG.md b/CHANGELOG.md index dafa3f3a1393..a40848480598 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4948,6 +4948,7 @@ Released 2018-09-13 [`println_empty_string`]: https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [`ptr_arg`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [`ptr_as_ptr`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr +[`ptr_as_underscore`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_underscore [`ptr_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq [`ptr_offset_with_cast`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast [`pub_enum_variant_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#pub_enum_variant_names diff --git a/clippy_lints/src/casts/mod.rs b/clippy_lints/src/casts/mod.rs index cfeb75eed3bb..b27a749756aa 100644 --- a/clippy_lints/src/casts/mod.rs +++ b/clippy_lints/src/casts/mod.rs @@ -18,6 +18,7 @@ mod fn_to_numeric_cast; mod fn_to_numeric_cast_any; mod fn_to_numeric_cast_with_truncation; mod ptr_as_ptr; +mod ptr_as_underscore; mod unnecessary_cast; mod utils; @@ -422,6 +423,23 @@ declare_clippy_lint! { "casting using `as` from and to raw pointers that doesn't change its mutability, where `pointer::cast` could take the place of `as`" } +declare_clippy_lint! { + /// ### What it does + /// TODO + /// + /// ### Why is this bad? + /// TODO + /// + /// ### Example + /// TODO + /// Use instead: + /// TODO + #[clippy::version = "1.71.0"] + pub PTR_AS_UNDERSCORE, + nursery, + "TODO" +} + declare_clippy_lint! { /// ### What it does /// Checks for casts from an enum type to an integral type which will definitely truncate the @@ -689,6 +707,7 @@ impl_lint_pass!(Casts => [ FN_TO_NUMERIC_CAST_WITH_TRUNCATION, CHAR_LIT_AS_U8, PTR_AS_PTR, + PTR_AS_UNDERSCORE, CAST_ENUM_TRUNCATION, CAST_ENUM_CONSTRUCTOR, CAST_ABS_TO_UNSIGNED, @@ -703,6 +722,7 @@ impl<'tcx> LateLintPass<'tcx> for Casts { fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { if !in_external_macro(cx.sess(), expr.span) { ptr_as_ptr::check(cx, expr, &self.msrv); + ptr_as_underscore::check(cx, expr); } if expr.span.from_expansion() { diff --git a/clippy_lints/src/casts/ptr_as_underscore.rs b/clippy_lints/src/casts/ptr_as_underscore.rs new file mode 100644 index 000000000000..0d541f7f50d8 --- /dev/null +++ b/clippy_lints/src/casts/ptr_as_underscore.rs @@ -0,0 +1,49 @@ +use clippy_utils::diagnostics::span_lint_and_help; +use if_chain::if_chain; +use rustc_hir::ExprKind; +use rustc_hir::{Expr, Mutability}; +use rustc_lint::LateContext; +use rustc_middle::ty::{self, TypeAndMut}; + +use super::PTR_AS_UNDERSCORE; + +pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>) { + if_chain! { + if let ExprKind::Cast(cast_expr, cast_to_hir_ty) = expr.kind; + let (cast_from, cast_to) = (cx.typeck_results().expr_ty(cast_expr), cx.typeck_results().expr_ty(expr)); + // if let ty::RawPtr(TypeAndMut { mutbl: from_mutbl, .. }) = cast_from.kind(); + // if let ty::Infer(_) = cast_to.kind(); + then { + span_lint_and_help( + cx, + PTR_AS_UNDERSCORE, + expr.span, + &format!("using `as * _` conversion\n{:#?}\n{:#?}", cast_from.kind(), cast_to.kind()), + None, + "this is likely an extraneous operation", + ); + } + } + + if_chain! { + if let ExprKind::Cast(cast_expr, _) = expr.kind; + let (cast_from, cast_to) = (cx.typeck_results().expr_ty(cast_expr), cx.typeck_results().expr_ty(expr)); + if let ty::RawPtr(TypeAndMut { mutbl: from_mutbl, .. }) = cast_from.kind(); + if let ty::Infer(_) = cast_to.kind(); + then { + let constness = match *from_mutbl { + Mutability::Not => "const", + Mutability::Mut => "mut", + }; + + span_lint_and_help( + cx, + PTR_AS_UNDERSCORE, + expr.span, + &format!("using `as *{constness} _` conversion"), + None, + "this is likely an extraneous operation", + ); + } + } +} diff --git a/clippy_lints/src/declared_lints.rs b/clippy_lints/src/declared_lints.rs index a3a6f1746bcc..09be379d0313 100644 --- a/clippy_lints/src/declared_lints.rs +++ b/clippy_lints/src/declared_lints.rs @@ -89,6 +89,7 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[ crate::casts::FN_TO_NUMERIC_CAST_ANY_INFO, crate::casts::FN_TO_NUMERIC_CAST_WITH_TRUNCATION_INFO, crate::casts::PTR_AS_PTR_INFO, + crate::casts::PTR_AS_UNDERSCORE_INFO, crate::casts::UNNECESSARY_CAST_INFO, crate::checked_conversions::CHECKED_CONVERSIONS_INFO, crate::cognitive_complexity::COGNITIVE_COMPLEXITY_INFO, diff --git a/tests/ui/ptr_as_underscore.rs b/tests/ui/ptr_as_underscore.rs new file mode 100644 index 000000000000..15eac8c6d725 --- /dev/null +++ b/tests/ui/ptr_as_underscore.rs @@ -0,0 +1,11 @@ +#![warn(clippy::ptr_as_underscore)] +#![allow(dead_code)] +#![allow(unused)] + +fn main() { + let x = [3; 11]; + x.as_ptr() as *const _; + let y = 1i32; + let y = y as i64; + // let +} diff --git a/tests/ui/ptr_as_underscore.stderr b/tests/ui/ptr_as_underscore.stderr new file mode 100644 index 000000000000..d230f1d0c99d --- /dev/null +++ b/tests/ui/ptr_as_underscore.stderr @@ -0,0 +1,45 @@ +error: unnecessary operation + --> $DIR/ptr_as_underscore.rs:7:5 + | +LL | x.as_ptr() as *const _; + | ^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `x.as_ptr();` + | + = note: `-D clippy::unnecessary-operation` implied by `-D warnings` + +error: using `as * _` conversion + RawPtr( + TypeAndMut { + ty: i32, + mutbl: Not, + }, + ) + RawPtr( + TypeAndMut { + ty: i32, + mutbl: Not, + }, + ) + --> $DIR/ptr_as_underscore.rs:7:5 + | +LL | x.as_ptr() as *const _; + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = help: this is likely an extraneous operation + = note: `-D clippy::ptr-as-underscore` implied by `-D warnings` + +error: using `as * _` conversion + Int( + I32, + ) + Int( + I64, + ) + --> $DIR/ptr_as_underscore.rs:9:13 + | +LL | let y = y as i64; + | ^^^^^^^^ + | + = help: this is likely an extraneous operation + +error: aborting due to 3 previous errors + From 7f2a18d81935a9a9a0ba382fe77b0011146bd401 Mon Sep 17 00:00:00 2001 From: Centri3 <114838443+Centri3@users.noreply.github.com> Date: Mon, 15 May 2023 10:10:51 -0500 Subject: [PATCH 2/4] add `as_ptr_cast_underscore` --- .../src/casts/as_ptr_cast_underscore.rs | 33 ++++++++++++ clippy_lints/src/casts/mod.rs | 8 +-- clippy_lints/src/casts/ptr_as_underscore.rs | 49 ------------------ clippy_lints/src/declared_lints.rs | 2 +- tests/ui/as_ptr_cast_underscore.rs | 39 ++++++++++++++ tests/ui/as_ptr_cast_underscore.stderr | 51 +++++++++++++++++++ tests/ui/ptr_as_underscore.rs | 11 ---- tests/ui/ptr_as_underscore.stderr | 45 ---------------- 8 files changed, 128 insertions(+), 110 deletions(-) create mode 100644 clippy_lints/src/casts/as_ptr_cast_underscore.rs delete mode 100644 clippy_lints/src/casts/ptr_as_underscore.rs create mode 100644 tests/ui/as_ptr_cast_underscore.rs create mode 100644 tests/ui/as_ptr_cast_underscore.stderr delete mode 100644 tests/ui/ptr_as_underscore.rs delete mode 100644 tests/ui/ptr_as_underscore.stderr diff --git a/clippy_lints/src/casts/as_ptr_cast_underscore.rs b/clippy_lints/src/casts/as_ptr_cast_underscore.rs new file mode 100644 index 000000000000..d173bfaa6e54 --- /dev/null +++ b/clippy_lints/src/casts/as_ptr_cast_underscore.rs @@ -0,0 +1,33 @@ +use clippy_utils::diagnostics::span_lint_and_help; +use if_chain::if_chain; +use rustc_hir::ExprKind; +use rustc_hir::{Expr, Mutability}; +use rustc_lint::LateContext; +use rustc_middle::ty::{self, TypeAndMut}; + +use super::AS_PTR_CAST_UNDERSCORE; + +pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>) { + if_chain! { + if let ExprKind::Cast(cast_expr, ..) = expr.kind; + let (cast_from, cast_to) = (cx.typeck_results().expr_ty(cast_expr), cx.typeck_results().expr_ty(expr)); + if let ty::RawPtr(TypeAndMut { mutbl: from_mutbl, .. }) = cast_from.kind(); + // check both mutability and type are the same + if cast_from.kind() == cast_to.kind(); + then { + let constness = match *from_mutbl { + Mutability::Not => "const", + Mutability::Mut => "mut", + }; + + span_lint_and_help( + cx, + AS_PTR_CAST_UNDERSCORE, + expr.span, + &format!("casting a raw pointer using `as *{constness} _` without changing type or constness"), + None, + "this is an extrenuous operation", + ); + } + } +} diff --git a/clippy_lints/src/casts/mod.rs b/clippy_lints/src/casts/mod.rs index b27a749756aa..c4956bff9762 100644 --- a/clippy_lints/src/casts/mod.rs +++ b/clippy_lints/src/casts/mod.rs @@ -1,4 +1,5 @@ mod as_ptr_cast_mut; +mod as_ptr_cast_underscore; mod as_underscore; mod borrow_as_ptr; mod cast_abs_to_unsigned; @@ -18,7 +19,6 @@ mod fn_to_numeric_cast; mod fn_to_numeric_cast_any; mod fn_to_numeric_cast_with_truncation; mod ptr_as_ptr; -mod ptr_as_underscore; mod unnecessary_cast; mod utils; @@ -435,7 +435,7 @@ declare_clippy_lint! { /// Use instead: /// TODO #[clippy::version = "1.71.0"] - pub PTR_AS_UNDERSCORE, + pub AS_PTR_CAST_UNDERSCORE, nursery, "TODO" } @@ -707,7 +707,6 @@ impl_lint_pass!(Casts => [ FN_TO_NUMERIC_CAST_WITH_TRUNCATION, CHAR_LIT_AS_U8, PTR_AS_PTR, - PTR_AS_UNDERSCORE, CAST_ENUM_TRUNCATION, CAST_ENUM_CONSTRUCTOR, CAST_ABS_TO_UNSIGNED, @@ -715,6 +714,7 @@ impl_lint_pass!(Casts => [ BORROW_AS_PTR, CAST_SLICE_FROM_RAW_PARTS, AS_PTR_CAST_MUT, + AS_PTR_CAST_UNDERSCORE, CAST_NAN_TO_INT, ]); @@ -722,7 +722,7 @@ impl<'tcx> LateLintPass<'tcx> for Casts { fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { if !in_external_macro(cx.sess(), expr.span) { ptr_as_ptr::check(cx, expr, &self.msrv); - ptr_as_underscore::check(cx, expr); + as_ptr_cast_underscore::check(cx, expr); } if expr.span.from_expansion() { diff --git a/clippy_lints/src/casts/ptr_as_underscore.rs b/clippy_lints/src/casts/ptr_as_underscore.rs deleted file mode 100644 index 0d541f7f50d8..000000000000 --- a/clippy_lints/src/casts/ptr_as_underscore.rs +++ /dev/null @@ -1,49 +0,0 @@ -use clippy_utils::diagnostics::span_lint_and_help; -use if_chain::if_chain; -use rustc_hir::ExprKind; -use rustc_hir::{Expr, Mutability}; -use rustc_lint::LateContext; -use rustc_middle::ty::{self, TypeAndMut}; - -use super::PTR_AS_UNDERSCORE; - -pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>) { - if_chain! { - if let ExprKind::Cast(cast_expr, cast_to_hir_ty) = expr.kind; - let (cast_from, cast_to) = (cx.typeck_results().expr_ty(cast_expr), cx.typeck_results().expr_ty(expr)); - // if let ty::RawPtr(TypeAndMut { mutbl: from_mutbl, .. }) = cast_from.kind(); - // if let ty::Infer(_) = cast_to.kind(); - then { - span_lint_and_help( - cx, - PTR_AS_UNDERSCORE, - expr.span, - &format!("using `as * _` conversion\n{:#?}\n{:#?}", cast_from.kind(), cast_to.kind()), - None, - "this is likely an extraneous operation", - ); - } - } - - if_chain! { - if let ExprKind::Cast(cast_expr, _) = expr.kind; - let (cast_from, cast_to) = (cx.typeck_results().expr_ty(cast_expr), cx.typeck_results().expr_ty(expr)); - if let ty::RawPtr(TypeAndMut { mutbl: from_mutbl, .. }) = cast_from.kind(); - if let ty::Infer(_) = cast_to.kind(); - then { - let constness = match *from_mutbl { - Mutability::Not => "const", - Mutability::Mut => "mut", - }; - - span_lint_and_help( - cx, - PTR_AS_UNDERSCORE, - expr.span, - &format!("using `as *{constness} _` conversion"), - None, - "this is likely an extraneous operation", - ); - } - } -} diff --git a/clippy_lints/src/declared_lints.rs b/clippy_lints/src/declared_lints.rs index 09be379d0313..73d490c6b0f1 100644 --- a/clippy_lints/src/declared_lints.rs +++ b/clippy_lints/src/declared_lints.rs @@ -69,6 +69,7 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[ crate::cargo::REDUNDANT_FEATURE_NAMES_INFO, crate::cargo::WILDCARD_DEPENDENCIES_INFO, crate::casts::AS_PTR_CAST_MUT_INFO, + crate::casts::AS_PTR_CAST_UNDERSCORE_INFO, crate::casts::AS_UNDERSCORE_INFO, crate::casts::BORROW_AS_PTR_INFO, crate::casts::CAST_ABS_TO_UNSIGNED_INFO, @@ -89,7 +90,6 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[ crate::casts::FN_TO_NUMERIC_CAST_ANY_INFO, crate::casts::FN_TO_NUMERIC_CAST_WITH_TRUNCATION_INFO, crate::casts::PTR_AS_PTR_INFO, - crate::casts::PTR_AS_UNDERSCORE_INFO, crate::casts::UNNECESSARY_CAST_INFO, crate::checked_conversions::CHECKED_CONVERSIONS_INFO, crate::cognitive_complexity::COGNITIVE_COMPLEXITY_INFO, diff --git a/tests/ui/as_ptr_cast_underscore.rs b/tests/ui/as_ptr_cast_underscore.rs new file mode 100644 index 000000000000..264d3014bea6 --- /dev/null +++ b/tests/ui/as_ptr_cast_underscore.rs @@ -0,0 +1,39 @@ +#![warn(clippy::as_ptr_cast_underscore)] +#![allow(dead_code)] +#![allow(unused)] + +static X: u32 = 0u32; + +fn takes_raw(a: *mut u32) -> *mut u32 { + a +} + +fn return_raw() -> *mut u32 { + // UB but i don't care + X as *mut u32 +} + +fn main() { + let e = return_raw() as *mut _; + let e = return_raw() as *const _; + let mut z = vec![11; 100]; + let z = z.as_mut_ptr() as *mut _; + // since this changes its type, this will not be linted + takes_raw(z); + + // this doesn't, however, so lint this + let mut z = [1u32; 2]; + let z = z.as_mut_ptr() as *mut _; + let z = takes_raw(z as *mut _) as *mut _; + + let mut x = [3; 11]; + // do not lint if it changes type + let z: *const u32 = x.as_ptr() as *const _; + // lint this + let w = x.as_ptr() as *const _; + let x = x.as_mut_ptr() as *mut _; + + // this is not a raw pointer. do not lint this. + let y = 1i32; + let y = y as i64; +} diff --git a/tests/ui/as_ptr_cast_underscore.stderr b/tests/ui/as_ptr_cast_underscore.stderr new file mode 100644 index 000000000000..9ca50e478d5d --- /dev/null +++ b/tests/ui/as_ptr_cast_underscore.stderr @@ -0,0 +1,51 @@ +error: casting a raw pointer using `as *mut _` without changing type or constness + --> $DIR/as_ptr_cast_underscore.rs:17:13 + | +LL | let e = return_raw() as *mut _; + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = help: this is an extrenuous operation + = note: `-D clippy::as-ptr-cast-underscore` implied by `-D warnings` + +error: casting a raw pointer using `as *mut _` without changing type or constness + --> $DIR/as_ptr_cast_underscore.rs:26:13 + | +LL | let z = z.as_mut_ptr() as *mut _; + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: this is an extrenuous operation + +error: casting a raw pointer using `as *mut _` without changing type or constness + --> $DIR/as_ptr_cast_underscore.rs:27:13 + | +LL | let z = takes_raw(z as *mut _) as *mut _; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: this is an extrenuous operation + +error: casting a raw pointer using `as *mut _` without changing type or constness + --> $DIR/as_ptr_cast_underscore.rs:27:23 + | +LL | let z = takes_raw(z as *mut _) as *mut _; + | ^^^^^^^^^^^ + | + = help: this is an extrenuous operation + +error: casting a raw pointer using `as *const _` without changing type or constness + --> $DIR/as_ptr_cast_underscore.rs:33:13 + | +LL | let w = x.as_ptr() as *const _; + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = help: this is an extrenuous operation + +error: casting a raw pointer using `as *mut _` without changing type or constness + --> $DIR/as_ptr_cast_underscore.rs:34:13 + | +LL | let x = x.as_mut_ptr() as *mut _; + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: this is an extrenuous operation + +error: aborting due to 6 previous errors + diff --git a/tests/ui/ptr_as_underscore.rs b/tests/ui/ptr_as_underscore.rs deleted file mode 100644 index 15eac8c6d725..000000000000 --- a/tests/ui/ptr_as_underscore.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![warn(clippy::ptr_as_underscore)] -#![allow(dead_code)] -#![allow(unused)] - -fn main() { - let x = [3; 11]; - x.as_ptr() as *const _; - let y = 1i32; - let y = y as i64; - // let -} diff --git a/tests/ui/ptr_as_underscore.stderr b/tests/ui/ptr_as_underscore.stderr deleted file mode 100644 index d230f1d0c99d..000000000000 --- a/tests/ui/ptr_as_underscore.stderr +++ /dev/null @@ -1,45 +0,0 @@ -error: unnecessary operation - --> $DIR/ptr_as_underscore.rs:7:5 - | -LL | x.as_ptr() as *const _; - | ^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `x.as_ptr();` - | - = note: `-D clippy::unnecessary-operation` implied by `-D warnings` - -error: using `as * _` conversion - RawPtr( - TypeAndMut { - ty: i32, - mutbl: Not, - }, - ) - RawPtr( - TypeAndMut { - ty: i32, - mutbl: Not, - }, - ) - --> $DIR/ptr_as_underscore.rs:7:5 - | -LL | x.as_ptr() as *const _; - | ^^^^^^^^^^^^^^^^^^^^^^ - | - = help: this is likely an extraneous operation - = note: `-D clippy::ptr-as-underscore` implied by `-D warnings` - -error: using `as * _` conversion - Int( - I32, - ) - Int( - I64, - ) - --> $DIR/ptr_as_underscore.rs:9:13 - | -LL | let y = y as i64; - | ^^^^^^^^ - | - = help: this is likely an extraneous operation - -error: aborting due to 3 previous errors - From c6f544cc733ab91ff26d98fcd0b735f144ffa41b Mon Sep 17 00:00:00 2001 From: Centri3 <114838443+Centri3@users.noreply.github.com> Date: Mon, 15 May 2023 10:15:10 -0500 Subject: [PATCH 3/4] add description --- clippy_lints/src/casts/mod.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/clippy_lints/src/casts/mod.rs b/clippy_lints/src/casts/mod.rs index c4956bff9762..c80cc9b5df24 100644 --- a/clippy_lints/src/casts/mod.rs +++ b/clippy_lints/src/casts/mod.rs @@ -425,19 +425,26 @@ declare_clippy_lint! { declare_clippy_lint! { /// ### What it does - /// TODO + /// Checks for `as` casts between raw pointers that change neither its constness or type. /// /// ### Why is this bad? - /// TODO + /// It's an unnecessary operation. If the type and constness is the same, the cast can be entirely + /// emitted. /// /// ### Example - /// TODO + /// ```rust + /// let x = [10; 4]; + /// let px = x.as_ptr() as *const _; + /// ``` /// Use instead: - /// TODO + /// ```rust + /// let x = [10; 4]; + /// let px = x.as_ptr(); + /// ``` #[clippy::version = "1.71.0"] pub AS_PTR_CAST_UNDERSCORE, nursery, - "TODO" + "casting raw pointers that change neither its constness or type" } declare_clippy_lint! { From e7a08111bc2bb0bed65436abe07b86aea71344e7 Mon Sep 17 00:00:00 2001 From: Centri3 <114838443+Centri3@users.noreply.github.com> Date: Mon, 15 May 2023 10:17:35 -0500 Subject: [PATCH 4/4] appease CI (please work) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a40848480598..e2e02332e473 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4506,6 +4506,7 @@ Released 2018-09-13 [`arithmetic_side_effects`]: https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects [`as_conversions`]: https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions [`as_ptr_cast_mut`]: https://rust-lang.github.io/rust-clippy/master/index.html#as_ptr_cast_mut +[`as_ptr_cast_underscore`]: https://rust-lang.github.io/rust-clippy/master/index.html#as_ptr_cast_underscore [`as_underscore`]: https://rust-lang.github.io/rust-clippy/master/index.html#as_underscore [`assertions_on_constants`]: https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [`assertions_on_result_states`]: https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states @@ -4948,7 +4949,6 @@ Released 2018-09-13 [`println_empty_string`]: https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [`ptr_arg`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [`ptr_as_ptr`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr -[`ptr_as_underscore`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_underscore [`ptr_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq [`ptr_offset_with_cast`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast [`pub_enum_variant_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#pub_enum_variant_names