From c5fcc6602d90ed817af7f03c119931e2025849aa Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Mon, 19 Mar 2018 11:15:52 -0700 Subject: [PATCH] Fix build for AVX2 backend. A missing import of the Borrow trait caused the build to break with the "yolocrypto" feature enabled; this was't caught by CI because the CI machine that Travis used didn't have AVX2, so the code was never built. This commit adds the missing import and changes `std` to `core` so that the AVX2 backend builds with no_std, but this isn't tested and is, actually, "yolocrypto". --- src/backend/avx2/edwards.rs | 5 +++-- src/backend/avx2/field.rs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/backend/avx2/edwards.rs b/src/backend/avx2/edwards.rs index b5f3245..fa83c72 100644 --- a/src/backend/avx2/edwards.rs +++ b/src/backend/avx2/edwards.rs @@ -13,8 +13,9 @@ // just going to own it #![allow(bad_style)] -use std::convert::From; -use std::ops::{Index, Add, Sub, Mul, Neg}; +use core::convert::From; +use core::ops::{Index, Add, Sub, Mul, Neg}; +use core::borrow::Borrow; use stdsimd::simd::{u32x8, i32x8}; diff --git a/src/backend/avx2/field.rs b/src/backend/avx2/field.rs index 3f69aad..8d3af8b 100644 --- a/src/backend/avx2/field.rs +++ b/src/backend/avx2/field.rs @@ -25,7 +25,7 @@ pub const D_LANES64: u8 = 0b11_00_00_00; pub const ALL_LANES: u8 = A_LANES | B_LANES | C_LANES | D_LANES; -use std::ops::Mul; +use core::ops::Mul; use stdsimd::simd::{u32x8, i32x8, u64x4};