bulletproofs icon indicating copy to clipboard operation
bulletproofs copied to clipboard

subtle-2.3.0 and clear_on_drop CANNOT compile. HELP

Open kaidoxue opened this issue 5 years ago • 7 comments

I cann't compile some packge, please help , thank you.

Output of "cargo build"

error[E0210]: type parameter T must be used as the type parameter for some local type (e.g., MyStruct<T>) --> C:\Users\KAIDO.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b\subtle-2.3.0\src\lib.rs:510:1 | 510 | impl<T> From<CtOption<T>> for Option<T> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter T must be used as the type parameter for some local type | = note: only traits defined in the current crate can be implemented for a type parameter

error: aborting due to previous error

For more information about this error, try rustc --explain E0210. error: Could not compile subtle. warning: build failed, waiting for other jobs to finish... error: cannot find macro llvm_asm! in this scope --> C:\Users\KAIDO.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b\clear_on_drop-0.2.4\src\hide.rs:38:17 | 38 | llvm_asm!("" : : "r" (ptr as *mut u8) : "memory"); | ^^^^^^^^

error: cannot find macro llvm_asm! in this scope --> C:\Users\KAIDO.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b\clear_on_drop-0.2.4\src\hide.rs:48:17 | 48 | llvm_asm!("" : "=*m" (ptr) : "*0" (ptr)); | ^^^^^^^^

error: aborting due to 2 previous errors

error: Could not compile clear_on_drop. warning: build failed, waiting for other jobs to finish... error: build failed

kaidoxue avatar Nov 07 '20 15:11 kaidoxue

Hi, this is caused by the Rust 1.41 MSRV requirement on subtle. Try updating your rust version to 1.41 or above.

hdevalence avatar Nov 09 '20 21:11 hdevalence

D:\Projects\bulletproofs-main>rustup update info: syncing channel updates for 'stable-x86_64-pc-windows-msvc' info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc' info: checking for self-updates

stable-x86_64-pc-windows-msvc unchanged - rustc 1.47.0 (18bf6b4f0 2020-10-07) nightly-x86_64-pc-windows-msvc unchanged - rustc 1.49.0-nightly (25f6938da 2020-11-09)

info: cleaning up downloads & tmp directories

My rust version maybe 1.41 or above.....but still cannot comile subtle Please Help, Thanks @hdevalence

kaidoxue avatar Nov 10 '20 15:11 kaidoxue

error[E0432]: unresolved import crate::arch::x86_64::_mm_movemask_pi8 --> C:\Users\KAIDO.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b\packed_simd-0.3.3\src\codegen\reductions\mask\x86\sse.rs:62:21 | 62 | use crate::arch::x86_64::_mm_movemask_pi8; | ^^^^^^^^^^^^^^^^^^^^^---------------- | | | | | help: a similar name exists in the module: _mm_movemask_epi8 | no _mm_movemask_pi8 in arch::x86_64 | ::: C:\Users\KAIDO.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b\packed_simd-0.3.3\src\codegen\reductions\mask.rs:52:1 | 52 | impl_mask_reductions!(m32x2); | ----------------------------- in this macro invocation | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

When I edit environment variety, change to 1.49-nightly. Occur the new error.....

kaidoxue avatar Nov 10 '20 15:11 kaidoxue

Hmm, does that error occur on stable rust without using the simd_backend?

hdevalence avatar Nov 10 '20 17:11 hdevalence

https://github.com/rust-lang/packed_simd/issues/288#issuecomment-693782215

I use this, then cargo test works

jadeydi avatar Dec 23 '20 16:12 jadeydi

build passed with recent nightly and several lines deleted

~/bulletproofs$ git diff
diff --git a/rust-toolchain b/rust-toolchain
index ed6f0c1..eb726a2 100644
--- a/rust-toolchain
+++ b/rust-toolchain
@@ -1 +1 @@
-nightly-2019-07-31
+nightly-2021-11-03
diff --git a/src/lib.rs b/src/lib.rs
index 41b1edd..0fe8004 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,8 +1,5 @@
 #![cfg_attr(not(feature = "std"), no_std)]
 #![feature(nll)]
-#![feature(external_doc)]
-#![feature(try_trait)]
-#![deny(missing_docs)]
 #![doc(include = "../README.md")]
 #![doc(html_logo_url = "https://doc.dalek.rs/assets/dalek-logo-clear.png")]
 #![doc(html_root_url = "https://docs.rs/bulletproofs/2.0.0")]

kernel1983 avatar Nov 03 '21 13:11 kernel1983

Hi all, the upstream for this crate is now https://github.com/zkcrypto/bulletproofs and this issue should be already fixed there.

hdevalence avatar Nov 09 '21 18:11 hdevalence