Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: cannot find macro asm in this scope #4

Open
qxzhou1010 opened this issue Apr 22, 2022 · 2 comments
Open

error: cannot find macro asm in this scope #4

qxzhou1010 opened this issue Apr 22, 2022 · 2 comments

Comments

@qxzhou1010
Copy link

Hi, I am using cargo build --release,but the following errors occurs:

error: cannot find macro `asm` in this scope
   --> /Users/qixian/.cargo/registry/src/github.com-1ecc6299db9ec823/ramp-0.6.0/src/ll/limb.rs:467:17
    |
467 |                 asm!(
    |                 ^^^
    |
    = note: consider importing this macro:
            std::arch::asm

error: cannot find macro `asm` in this scope
   --> /Users/qixian/.cargo/registry/src/github.com-1ecc6299db9ec823/ramp-0.6.0/src/ll/limb.rs:557:17
    |
557 |                 asm!(
    |                 ^^^
    |
    = note: consider importing this macro:
            std::arch::asm

error: cannot find macro `asm` in this scope
   --> /Users/qixian/.cargo/registry/src/github.com-1ecc6299db9ec823/ramp-0.6.0/src/ll/limb.rs:606:17
    |
606 |                 asm!(
    |                 ^^^
    |
    = note: consider importing this macro:
            std::arch::asm

error: cannot find macro `asm` in this scope
   --> /Users/qixian/.cargo/registry/src/github.com-1ecc6299db9ec823/ramp-0.6.0/src/ll/limb.rs:661:17
    |
661 |                 asm!(
    |                 ^^^
    |
    = note: consider importing this macro:
            std::arch::asm

error[E0603]: module `raw_vec` is private
   --> /Users/qixian/.cargo/registry/src/github.com-1ecc6299db9ec823/ramp-0.6.0/src/int.rs:37:12
    |
37  | use alloc::raw_vec::RawVec;
    |            ^^^^^^^ private module
    |
note: the module `raw_vec` is defined here

error[E0282]: type annotations needed
   --> /Users/qixian/.cargo/registry/src/github.com-1ecc6299db9ec823/ramp-0.6.0/src/int.rs:182:31
    |
182 |             ret.with_raw_vec(|v| v.reserve_exact(0, cap as usize))
    |                               ^ consider giving this closure parameter a type
    |
    = note: type must be known at this point

error[E0282]: type annotations needed
   --> /Users/qixian/.cargo/registry/src/github.com-1ecc6299db9ec823/ramp-0.6.0/src/int.rs:275:28
    |
275 |         self.with_raw_vec(|v| {
    |                            ^ consider giving this closure parameter a type
    |
    = note: type must be known at this point

error[E0282]: type annotations needed
   --> /Users/qixian/.cargo/registry/src/github.com-1ecc6299db9ec823/ramp-0.6.0/src/int.rs:769:32
    |
769 |             self.with_raw_vec(|v| v.reserve_exact(old_cap, cap as usize - old_cap))
    |                                ^ consider giving this closure parameter a type
    |
    = note: type must be known at this point

Some errors have detailed explanations: E0282, E0603.
For more information about an error, try `rustc --explain E0282`.

Please tell me how to fix these errors?

@vks
Copy link
Owner

vks commented Apr 22, 2022

Which Rust version are you using?

I think ramp requires nightly, and the version used here is outdated and no longer works on current Rust versions. I can think of three possible fixes:

  1. Use an older Rust nightly where ramp 0.6 still compiles.
  2. Update discrete-log to use the most recent ramp version, which hopefully works on current Rust versions.
  3. Make ramp optional and compile discrete-log without it.

@qxzhou1010
Copy link
Author

Thank for your reply. I am using therustc 1.62.0-nightly (de1bc0008 2022-04-21). I found that the most recent ramp version is still 0.6.0. I have removed all the code related ramp and complied successfully.
But how to run this code? I follow the README to run this line :
perf stat -B target/release/discrete-log num_bigint. However, a error occur: zsh: command not found: perf
.
And I try to use cargo run gmp(num_bigint/rug/ibig), but only the cargo run num_bigint successfully, other command all failed and output the following contetn:

arg = "rug"
thread 'main' panicked at 'unknown argument!', src/main.rs:404:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants