1
Fork 0

Use the now available implementation of IntoIterator for arrays

This commit is contained in:
LeSeulArtichaut 2021-06-14 23:40:09 +02:00
parent a216131c35
commit e3ca81fd5a
17 changed files with 34 additions and 34 deletions

View file

@ -185,7 +185,7 @@ where
if let Ok(cls) = cls_or_mem {
let mut needed_int = 0;
let mut needed_sse = 0;
for &c in &cls {
for c in cls {
match c {
Some(Class::Int) => needed_int += 1,
Some(Class::Sse) => needed_sse += 1,

View file

@ -590,7 +590,7 @@ impl Integer {
pub fn for_align<C: HasDataLayout>(cx: &C, wanted: Align) -> Option<Integer> {
let dl = cx.data_layout();
for &candidate in &[I8, I16, I32, I64, I128] {
for candidate in [I8, I16, I32, I64, I128] {
if wanted == candidate.align(dl).abi && wanted.bytes() == candidate.size().bytes() {
return Some(candidate);
}
@ -603,7 +603,7 @@ impl Integer {
let dl = cx.data_layout();
// FIXME(eddyb) maybe include I128 in the future, when it works everywhere.
for &candidate in &[I64, I32, I16] {
for candidate in [I64, I32, I16] {
if wanted >= candidate.align(dl).abi && wanted.bytes() >= candidate.size().bytes() {
return candidate;
}