Skip to content
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 Clippy diagnostics #21

Merged
merged 1 commit into from
Feb 27, 2022
Merged

Fix Clippy diagnostics #21

merged 1 commit into from
Feb 27, 2022

Conversation

c410-f3r
Copy link
Contributor

No description provided.

@@ -108,23 +108,23 @@ macro_rules! array_refs {
use std::slice;
#[inline]
#[allow(unused_assignments)]
#[allow(eval_order_dependence)]
#[allow(clippy::eval_order_dependence)]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eval_order_dependence is deprecated

Capture d’écran de 2022-02-26 08-20-20

unsafe fn as_arrays<T>(a: &[T]) -> ( $( &[T; $pre], )* &[T], $( &[T; $post], )*) {
let min_len = $( $pre + )* $( $post + )* 0;
let var_len = a.len() - min_len;
assert!(a.len() >= min_len);
let mut p = a.as_ptr();
( $( {
let aref = & *(p as *const [T; $pre]);
p = p.offset($pre as isize);
p = p.add($pre);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clippy::ptr_offset_with_cast is affecting downstream crates that use cargo clippy

Capture d’écran de 2022-02-26 08-22-35

Comment on lines +477 to +483
#[forbid(clippy::ptr_offset_with_cast)]
#[test]
fn forbidden_clippy_lints_do_not_fire() {
let mut data = [0u8; 32];
let _ = array_refs![&data, 8; .. ;];
let _ = mut_array_refs![&mut data, 8; .. ; 10];
}
Copy link
Contributor Author

@c410-f3r c410-f3r Feb 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensures that forbidden Clippy lints won't trigger again but I can remove it if you prefer so

@droundy droundy merged commit d2bf9b4 into droundy:master Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants