Skip to content

Commit

Permalink
Ignore used_underscore_items pedantic clippy lint in test
Browse files Browse the repository at this point in the history
    warning: used underscore-prefixed item
     --> tests/test_const.rs:5:20
      |
    5 | const _BASIC: () = _basic();
      |                    ^^^^^^^^
      |
    note: item is defined here
     --> tests/test_const.rs:3:28
      |
    3 |   #[rustversion::attr(all(), const)]
      |  ____________________________^
    4 | | fn _basic() {}
      | |___________^
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items
      = note: `-W clippy::used-underscore-items` implied by `-W clippy::pedantic`
      = help: to override `-W clippy::pedantic` add `#[allow(clippy::used_underscore_items)]`

    warning: used underscore-prefixed item
     --> tests/test_const.rs:9:30
      |
    9 | const _UNSAFE: () = unsafe { _unsafe() };
      |                              ^^^^^^^^^
      |
    note: item is defined here
     --> tests/test_const.rs:7:28
      |
    7 |   #[rustversion::attr(all(), const)]
      |  ____________________________^
    8 | | unsafe fn _unsafe() {}
      | |___________________^
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items

    warning: used underscore-prefixed item
      --> tests/test_const.rs:34:24
       |
    34 | const _DOC_BELOW: () = _doc_below();
       |                        ^^^^^^^^^^^^
       |
    note: item is defined here
      --> tests/test_const.rs:31:28
       |
    31 |   #[rustversion::attr(all(), const)]
       |  ____________________________^
    32 | | /// doc
    33 | | fn _doc_below() {}
       | |_______________^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items

    warning: used underscore-prefixed item
      --> tests/test_const.rs:39:24
       |
    39 | const _DOC_ABOVE: () = _doc_above();
       |                        ^^^^^^^^^^^^
       |
    note: item is defined here
      --> tests/test_const.rs:37:28
       |
    37 |   #[rustversion::attr(all(), const)]
       |  ____________________________^
    38 | | fn _doc_above() {}
       | |_______________^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items
  • Loading branch information
dtolnay committed Sep 27, 2024
1 parent 9a3d23f commit 6346c4e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_const.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#![allow(clippy::semicolon_if_nothing_returned)] // https://github.com/rust-lang/rust-clippy/issues/7324
#![allow(
clippy::semicolon_if_nothing_returned, // https://github.com/rust-lang/rust-clippy/issues/7324
clippy::used_underscore_items,
)]

#[rustversion::attr(all(), const)]
fn _basic() {}
Expand Down

0 comments on commit 6346c4e

Please sign in to comment.