-
Notifications
You must be signed in to change notification settings - Fork 15
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
Conversation
@@ -108,23 +108,23 @@ macro_rules! array_refs { | |||
use std::slice; | |||
#[inline] | |||
#[allow(unused_assignments)] | |||
#[allow(eval_order_dependence)] | |||
#[allow(clippy::eval_order_dependence)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[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]; | ||
} |
There was a problem hiding this comment.
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
No description provided.