Skip to content

Commit

Permalink
Suppress no_effect_underscore_binding pedantic clippy lint in generat…
Browse files Browse the repository at this point in the history
…ed code

    warning: binding to `_` prefixed variable with no side-effect
      --> tests/custom_linkme_path.rs:30:5
       |
    30 |     #[distributed_slice(super::declaration::SLICE)]
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_underscore_binding
       = note: `-W clippy::no-effect-underscore-binding` implied by `-W clippy::pedantic`
       = help: to override `-W clippy::pedantic` add `#[allow(clippy::no_effect_underscore_binding)]`
       = note: this warning originates in the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: binding to `_` prefixed variable with no side-effect
      --> tests/custom_linkme_path.rs:34:5
       |
    34 |     #[distributed_slice(super::declaration::FUNCTIONS)]
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_underscore_binding
       = note: this warning originates in the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: binding to `_` prefixed variable with no side-effect
     --> tests/distributed_slice.rs:9:1
      |
    9 | #[distributed_slice(SHENANIGANS)]
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_underscore_binding
      = note: `-W clippy::no-effect-underscore-binding` implied by `-W clippy::pedantic`
      = help: to override `-W clippy::pedantic` add `#[allow(clippy::no_effect_underscore_binding)]`
      = note: this warning originates in the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: binding to `_` prefixed variable with no side-effect
      --> tests/distributed_slice.rs:12:1
       |
    12 | #[distributed_slice(SHENANIGANS)]
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_underscore_binding
       = note: this warning originates in the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: binding to `_` prefixed variable with no side-effect
      --> tests/distributed_slice.rs:15:1
       |
    15 | #[distributed_slice(SHENANIGANS)]
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_underscore_binding
       = note: this warning originates in the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: `linkme` (test "custom_linkme_path") generated 2 warnings
    warning: binding to `_` prefixed variable with no side-effect
      --> tests/distributed_slice.rs:45:5
       |
    45 |     #[distributed_slice(NONCOPY)]
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_underscore_binding
       = note: this warning originates in the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: binding to `_` prefixed variable with no side-effect
      --> tests/distributed_slice.rs:56:5
       |
    56 |     #[distributed_slice(MUTABLE)]
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_underscore_binding
       = note: this warning originates in the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: binding to `_` prefixed variable with no side-effect
      --> tests/distributed_slice.rs:68:5
       |
    68 |     #[distributed_slice(MYSLICE)]
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_underscore_binding
       = note: this warning originates in the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: binding to `_` prefixed variable with no side-effect
     --> tests/fn_element.rs:9:1
      |
    9 | #[distributed_slice(SLICE1)]
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_underscore_binding
      = note: `-W clippy::no-effect-underscore-binding` implied by `-W clippy::pedantic`
      = help: to override `-W clippy::pedantic` add `#[allow(clippy::no_effect_underscore_binding)]`
      = note: this warning originates in the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: binding to `_` prefixed variable with no side-effect
      --> tests/fn_element.rs:15:1
       |
    15 | #[distributed_slice(SLICE2)]
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_underscore_binding
       = note: this warning originates in the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: binding to `_` prefixed variable with no side-effect
      --> tests/fn_element.rs:21:1
       |
    21 | #[distributed_slice(SLICE3)]
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_underscore_binding
       = note: this warning originates in the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: binding to `_` prefixed variable with no side-effect
      --> tests/module/mod.rs:16:5
       |
    16 |     #[distributed_slice(super::declaration::SLICE)]
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_underscore_binding
       = note: `-W clippy::no-effect-underscore-binding` implied by `-W clippy::pedantic`
       = help: to override `-W clippy::pedantic` add `#[allow(clippy::no_effect_underscore_binding)]`
       = note: this warning originates in the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: binding to `_` prefixed variable with no side-effect
     --> tests/win_status_access_violation.rs:8:1
      |
    8 | #[distributed_slice(ITEMS)]
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_underscore_binding
      = note: `-W clippy::no-effect-underscore-binding` implied by `-W clippy::pedantic`
      = help: to override `-W clippy::pedantic` add `#[allow(clippy::no_effect_underscore_binding)]`
      = note: this warning originates in the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: binding to `_` prefixed variable with no side-effect
      --> tests/win_status_illegal_instruction.rs:19:1
       |
    19 | #[distributed_slice(ITEMS)]
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_underscore_binding
       = note: `-W clippy::no-effect-underscore-binding` implied by `-W clippy::pedantic`
       = help: to override `-W clippy::pedantic` add `#[allow(clippy::no_effect_underscore_binding)]`
       = note: this warning originates in the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)
  • Loading branch information
dtolnay committed Dec 17, 2023
1 parent fa6284c commit 439eb0c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions impl/src/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ fn do_expand(path: Path, pos: Option<usize>, input: Element) -> TokenStream {
)*
#(#attrs)*
#vis static #ident : #ty = {
#[allow(clippy::no_effect_underscore_binding)]
unsafe fn __typecheck(_: #linkme_path::__private::Void) {
let #new = #linkme_path::__private::value::<#ty>;
#linkme_path::DistributedSlice::private_typecheck(#path, #uninit)
Expand Down

0 comments on commit 439eb0c

Please sign in to comment.