gpt4 book ai didi

rust - cargo 构建失败 : could not find macro `llvm_asm` in this scope

转载 作者:行者123 更新时间:2023-12-05 05:38:10 24 4
gpt4 key购买 nike

我正在尝试构建 rust-fractal-gui但构建总是因这些错误而失败:

$ cargo build --release

...

Compiling parking_lot v0.11.2
error: cannot find macro `llvm_asm` in this scope
--> /home/riley/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot-0.11.2/src/elision.rs:77:13
|
77 | llvm_asm!("xacquire; lock; cmpxchgq $2, $1"
| ^^^^^^^^

error: cannot find macro `llvm_asm` in this scope
--> /home/riley/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot-0.11.2/src/elision.rs:108:13
|
108 | llvm_asm!("xrelease; lock; xaddq $2, $1"
| ^^^^^^^^

error[E0635]: unknown feature `llvm_asm`
--> /home/riley/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot-0.11.2/src/lib.rs:14:42
|
14 | #![cfg_attr(feature = "nightly", feature(llvm_asm))]
| ^^^^^^^^

For more information about this error, try `rustc --explain E0635`.
error: could not compile `parking_lot` due to 3 previous errors
warning: build failed, waiting for other jobs to finish...

rustup show 的输出:

rustup home:  /home/riley/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu (default)
nightly-x86_64-unknown-linux-gnu
1.48.0-x86_64-unknown-linux-gnu

active toolchain
----------------

nightly-x86_64-unknown-linux-gnu (directory override for '/home/riley/projects/rust-fractal-gui')
rustc 1.64.0-nightly (c2f428d2f 2022-07-14)

我已经使用 rustup update nightlyrustup override set nightly 将我的夜间工具链更新到最新版本 see this issue但它没有解决问题。

最佳答案

rustc-nightly-2022-01-17 开始,宏 llvm_asm! 被移除,取而代之的是新的 asm! 宏。 rust-fractal-gui 使用的是 parking_lot 的过时版本,它仍然使用 llvm_asm! 宏,导致此错误。 PR已经合并,解决了这个问题。

关于rust - cargo 构建失败 : could not find macro `llvm_asm` in this scope,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72998962/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com