-
Notifications
You must be signed in to change notification settings - Fork 471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix all warnings from the latest Clippy #1123
Conversation
* It resolves a clippy warning: `zero_repeat_side_effects`
Thanks!
AFAIK this lint is completely useless (borrow_interior_mutable_const covers actual footguns about interior_mutable_const. see also rust-lang/rust-clippy#7665)
I feel it is a clippy bug that this lint warns of a code that has no side effects... |
I agree with your suggestion. I will add another commit to ignore the
It also seems strange to me because |
* Clippy's `declare_interior_mutable_const` is considered redundant * See also: crossbeam-rs#1123 (comment)
I pushed a commit and all CI checks are passed. |
* This reverts commit 5602a6c. * `zero_repeat_side_effect` seems to be a false positive in this circumstance. * See: crossbeam-rs#1123
The Clippy from the stable channel now produces new warnings, which this PR addresses. Specifically, those warnings are:
declare_interior_mutable_const
: For efficientBlock
initialization, a constantSlot
is used, but it has interior mutability, which Clippy warns about. I believe that using the inline-const expression inBlock::new
is ideal, but it is experimental in the current MSRV (1.61). Other solutions either have performance overheads (e.g.,array::map
,array::from_fn
) or require nightly features (e.g.,MaybeUninit::uninit_array
).doc_lazy_continuation
: Some indentations are missing in the documentation.zero_repeat_side_effects
: When there are no explicit cases for theselect!
macro, it creates a zero-sized array with initialization that calls a function. Clippy is concerned if the function has side effects. In our case, it has no side effects and can be trivially resolved.