Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cmov/src/aarch64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ macro_rules! cseleq {
};
};

*$dst = tmp as u8;
#[allow(clippy::cast_possible_truncation)]
{
*$dst = tmp as u8;
}
};
}

Expand Down
19 changes: 18 additions & 1 deletion cmov/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg",
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg"
)]
#![warn(missing_docs, unused_qualifications)]
#![warn(
clippy::cast_possible_truncation,
clippy::integer_division_remainder_used,
clippy::mod_module_files,
missing_docs,
missing_debug_implementations,
missing_copy_implementations,
rust_2018_idioms,
trivial_casts,
trivial_numeric_casts,
unused_qualifications
)]

#[cfg(not(miri))]
#[cfg(target_arch = "aarch64")]
Expand Down Expand Up @@ -59,6 +70,8 @@ pub trait CmovEq {
}
}

// TODO(tarcieri): address truncation lint
#[allow(clippy::cast_possible_truncation)]
impl Cmov for u8 {
#[inline]
fn cmovnz(&mut self, value: &Self, condition: Condition) {
Expand Down Expand Up @@ -87,6 +100,8 @@ impl CmovEq for u8 {
}
}

// TODO(tarcieri): address truncation lint
#[allow(clippy::cast_possible_truncation)]
impl Cmov for u128 {
#[inline]
fn cmovnz(&mut self, value: &Self, condition: Condition) {
Expand All @@ -111,6 +126,8 @@ impl Cmov for u128 {
}
}

// TODO(tarcieri): address truncation lint
#[allow(clippy::cast_possible_truncation)]
impl CmovEq for u128 {
#[inline]
fn cmovne(&self, rhs: &Self, input: Condition, output: &mut Condition) {
Expand Down
6 changes: 5 additions & 1 deletion cmov/src/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ macro_rules! cmov_eq {
options(pure, nomem, nostack),
};
}
*$dst = tmp as u8;

#[allow(clippy::cast_possible_truncation)]
{
*$dst = tmp as u8;
}
};
}

Expand Down