Skip to content

Commit

Permalink
Ignore 2 pedantic clippy lints in new unwind safety test
Browse files Browse the repository at this point in the history
    warning: adding items after statements is confusing, since items exist from the start of the scope
       --> tests/test.rs:391:5
        |
    391 |     fn require_unwind_safe<T: UnwindSafe>() {}
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
        = note: `-W clippy::items-after-statements` implied by `-W clippy::pedantic`
        = help: to override `-W clippy::pedantic` add `#[allow(clippy::items_after_statements)]`

    warning: adding items after statements is confusing, since items exist from the start of the scope
       --> tests/test.rs:394:5
        |
    394 |     fn require_ref_unwind_safe<T: RefUnwindSafe>() {}
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements

    warning: binding to `_` prefixed variable with no side-effect
       --> tests/test.rs:388:9
        |
    388 |     let _unwind_safe = |c: UniquePtr<ffi::C>| panic::catch_unwind(|| drop(c));
        |         ^^^^^^^^^^^^
        |
        = 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)]`

    warning: binding to `_` prefixed variable with no side-effect
       --> tests/test.rs:389:9
        |
    389 |     let _ref_unwind_safe = |c: &ffi::C| panic::catch_unwind(|| inspect(c));
        |         ^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_underscore_binding
  • Loading branch information
dtolnay committed Aug 30, 2024
1 parent d4f3c16 commit e87196d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ fn test_raw_ptr() {
}

#[test]
#[allow(clippy::items_after_statements, clippy::no_effect_underscore_binding)]
fn test_unwind_safe() {
fn inspect(_c: &ffi::C) {}
let _unwind_safe = |c: UniquePtr<ffi::C>| panic::catch_unwind(|| drop(c));
Expand Down

0 comments on commit e87196d

Please sign in to comment.