首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未能遵循Mac m1上的红豆杉教程-使用未声明类型的“维克”

未能遵循Mac m1上的红豆杉教程-使用未声明类型的“维克”
EN

Stack Overflow用户
提问于 2022-06-05 00:35:15
回答 1查看 584关注 0票数 2

每当我运行trunk buildcargo run --target=wasm32-unknown-unknown时,我都会得到一堆范围错误。

我已经运行了rustup target add wasm32-unknown-unknowncargo install --locked wasm-bindgen-cli,但仍然没有运气。

这些错误信息意味着什么?

编辑输出相当长,但它的开头如下:

代码语言:javascript
复制
[2m2022-06-06T01:51:52.351114Z[0m [32m INFO[0m  starting build
[2m2022-06-06T01:51:52.351741Z[0m [32m INFO[0m spawning asset pipelines
[2m2022-06-06T01:51:52.390738Z[0m [32m INFO[0m building yew-app
   Compiling ryu v1.0.10
   Compiling itoa v1.0.2
   Compiling cfg-if v1.0.0
   Compiling hashbrown v0.11.2
   Compiling slab v0.4.6
   Compiling scoped-tls-hkt v0.1.2
   Compiling serde v1.0.137
   Compiling thiserror v1.0.31
error[E0463]: can't find crate for `core`
  |
  = note: the `wasm32-unknown-unknown` target may not be installed
  = help: consider downloading the target with `rustup target add wasm32-unknown-unknown`

error[E0463]: can't find crate for `compiler_builtins`

For more information about this error, try `rustc --explain E0463`.
error: could not compile `cfg-if` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `core`
  --> /Users/patrickstivalchaerke/.cargo/registry/src/github.com-1ecc6299db9ec823/itoa-1.0.2/src/lib.rs:44:5
   |
44 | use core::mem::{self, MaybeUninit};
   |     ^^^^ can't find crate
   |
   = note: the `wasm32-unknown-unknown` target may not be installed
   = help: consider downloading the target with `rustup target add wasm32-unknown-unknown`

error[E0463]: can't find crate for `std`
  |
  = note: the `wasm32-unknown-unknown` target may not be installed
  = help: consider downloading the target with `rustup target add wasm32-unknown-unknown`

error[E0463]: can't find crate for `core`
  --> /Users/patrickstivalchaerke/.cargo/registry/src/github.com-1ecc6299db9ec823/itoa-1.0.2/src/lib.rs:45:5
   |
45 | use core::{ptr, slice, str};
   |     ^^^^ can't find crate
   |
   = note: the `wasm32-unknown-unknown` target may not be installed
   = help: consider downloading the target with `rustup target add wasm32-unknown-unknown`

error: cannot find macro `debug_assert_eq` in this scope
  --> /Users/patrickstivalchaerke/.cargo/registry/src/github.com-1ecc6299db9ec823/itoa-1.0.2/src/udiv128.rs:39:5
   |
39 |     debug_assert_eq!(quot, n / d as u128);
   |     ^^^^^^^^^^^^^^^

error: cannot find macro `debug_assert_eq` in this scope
  --> /Users/patrickstivalchaerke/.cargo/registry/src/github.com-1ecc6299db9ec823/itoa-1.0.2/src/udiv128.rs:40:5
   |
40 |     debug_assert_eq!(rem as u128, n % d as u128);
   |     ^^^^^^^^^^^^^^^

error[E0463]: can't find crate for `core`
 --> /Users/patrickstivalchaerke/.cargo/registry/src/github.com-1ecc6299db9ec823/ryu-1.0.10/src/buffer/mod.rs:2:5
  |
2 | use core::mem::MaybeUninit;
  |     ^^^^ can't find crate
  |
  = note: the `wasm32-unknown-unknown` target may not be installed
  = help: consider downloading the target with `rustup target add wasm32-unknown-unknown`

error[E0463]: can't find crate for `core`
 --> /Users/patrickstivalchaerke/.cargo/registry/src/github.com-1ecc6299db9ec823/ryu-1.0.10/src/buffer/mod.rs:3:5
  |
3 | use core::{slice, str};
  |     ^^^^ can't find crate
  |
  = note: the `wasm32-unknown-unknown` target may not be installed
  = help: consider downloading the target with `rustup target add wasm32-unknown-unknown`

error[E0463]: can't find crate for `core`
  --> /Users/patrickstivalchaerke/.cargo/registry/src/github.com-1ecc6299db9ec823/ryu-1.0.10/src/d2s.rs:27:5
   |
27 | use core::mem::MaybeUninit;
   |     ^^^^ can't find crate
   |
   = note: the `wasm32-unknown-unknown` target may not be installed
   = help: consider downloading the target with `rustup target add wasm32-unknown-unknown`

error[E0433]: failed to resolve: use of undeclared type `MaybeUninit`
  --> /Users/patrickstivalchaerke/.cargo/registry/src/github.com-1ecc6299db9ec823/itoa-1.0.2/src/lib.rs:80:22
   |
80 |         let bytes = [MaybeUninit::<u8>::uninit(); I128_MAX_LEN];
   |                      ^^^^^^^^^^^ use of undeclared type `MaybeUninit`

编辑2

我看到输出的开头说我应该考虑安装目标是32未知的。

但实际上我已经安装好了。另一个终端输出:

代码语言:javascript
复制
yew-app git:(master) ✗ rustup target add wasm32-unknown-unknown
info: component 'rust-std' for target 'wasm32-unknown-unknown' is up to date

yew-app git:(master) ✗ rustc -V
rustc 1.59.0
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-06-06 02:20:19

事实上,我有生锈的自制和锈蚀安装分开。我想他们在一起打得不太好。

我卸载了brew的锈迹,重新安装了rustup,安装了m-bindgen-cli,添加了目标,它就成功了。

我运行的命令列表:

代码语言:javascript
复制
rustup target remove wasm32-unknown-unknown
rustup self uninstall
brew uninstall rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add wasm32-unknown-unknown
cargo install --locked trunk
cargo clean
trunk clean
cargo install --locked wasm-bindgen-cli

# And finally
trunk serve
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72504022

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档