Skip to content
Myr

Ignore erasing_op clippy lint in test

Before adoption: this commit came in with the history the project adopted, so no landing records it.

warning: this operation will always return zero. This is likely not the intended outcome --> tests/test_ensure.rs:555:30 | 555 | let test = || Ok(ensure!(f as fn() as usize * 0 != 0)); | ^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#erasing_op = note: `#[warn(clippy::erasing_op)]` on by default warning: this operation will always return zero. This is likely not the intended outcome --> tests/test_ensure.rs:561:30 | 561 | let test = || Ok(ensure!(f as fn() -> () as usize * 0 != 0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#erasing_op warning: this operation will always return zero. This is likely not the intended outcome --> tests/test_ensure.rs:567:30 | 567 | let test = || Ok(ensure!(f as for<'a> fn() as usize * 0 != 0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#erasing_op warning: this operation will always return zero. This is likely not the intended outcome --> tests/test_ensure.rs:573:30 | 573 | let test = || Ok(ensure!(f as unsafe fn() as usize * 0 != 0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#erasing_op warning: this operation will always return zero. This is likely not the intended outcome --> tests/test_ensure.rs:580:30 | 580 | let test = || Ok(ensure!(f as extern "Rust" fn() as usize * 0 != 0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#erasing_op warning: this operation will always return zero. This is likely not the intended outcome --> tests/test_ensure.rs:588:30 | 588 | let test = || Ok(ensure!(extern_fn as extern fn() as usize * 0 != 0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#erasing_op warning: this operation will always return zero. This is likely not the intended outcome --> tests/test_ensure.rs:595:30 | 595 | let test = || Ok(ensure!(f as fn() -> ! as usize * 0 != 0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#erasing_op

authored by David Tolnay · committed by David Tolnay · parent 3578823 · Browse files · 1 file+1 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−0 removed

  • tests:+1 added−0 removed

1 file+1 added−0 removed

modified:tests/test_ensure.rs+1 added
1 unmodified line
2 clippy::bool_to_int_with_if,3 clippy::char_lit_as_u8,4 clippy::deref_addrof,5 clippy::diverging_sub_expression,6 clippy::erasing_op,7 clippy::extra_unused_type_parameters,8 clippy::if_same_then_else,9 clippy::ifs_same_cond,10 clippy::ignored_unit_patterns,
717 unmodified lines