Skip to content

Commit

Permalink
suppress the eval_order_dependence lint in macro code (#15)
Browse files Browse the repository at this point in the history
This one triggers in callers when they run `cargo clippy`.
  • Loading branch information
oconnor663 authored and droundy committed Oct 20, 2018
1 parent c0045e3 commit fd7f92b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ macro_rules! array_refs {
use std::slice;
#[inline]
#[allow(unused_assignments)]
#[allow(eval_order_dependence)]
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;
Expand Down Expand Up @@ -138,6 +139,7 @@ macro_rules! array_refs {
{
#[inline]
#[allow(unused_assignments)]
#[allow(eval_order_dependence)]
unsafe fn as_arrays<T>(a: &[T; $( $len + )* 0 ]) -> ( $( &[T; $len], )* ) {
let mut p = a.as_ptr();
( $( {
Expand Down Expand Up @@ -203,6 +205,7 @@ macro_rules! mut_array_refs {
use std::slice;
#[inline]
#[allow(unused_assignments)]
#[allow(eval_order_dependence)]
unsafe fn as_arrays<T>(a: &mut [T]) -> ( $( &mut [T; $pre], )* &mut [T], $( &mut [T; $post], )*) {
let min_len = $( $pre + )* $( $post + )* 0;
let var_len = a.len() - min_len;
Expand Down Expand Up @@ -233,6 +236,7 @@ macro_rules! mut_array_refs {
{
#[inline]
#[allow(unused_assignments)]
#[allow(eval_order_dependence)]
unsafe fn as_arrays<T>(a: &mut [T; $( $len + )* 0 ]) -> ( $( &mut [T; $len], )* ) {
let mut p = a.as_mut_ptr();
( $( {
Expand Down

0 comments on commit fd7f92b

Please sign in to comment.