如何解决底材油墨!编译错误“函数指针不能出现在常量函数中”
- 我尝试“ https://substrate.dev/substrate-contracts-workshop/#/”
- 我按照教程创建了Rust环境。
- 我执行了“货物+夜间测试”
- 我收到错误消息。
<?php
namespace App\Http\Middleware;
use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
{
protected $headers = Request::HEADER_X_FORWARDED_AWS_ELB;
}
请告诉我怎么了?
解决方法
我无法解决它,但是我能够使其可编译和可执行。 如下所示,纠正〜/ .cargo / git / checkouts / ink-XXXXX / cca-XXXX / lang / source / disposacher.rs的错误部分。
//pub const fn new(dispatchable: $dispatchable_fn<Msg,S>) -> Self { // before
pub fn new(dispatchable: $dispatchable_fn<Msg,S>) -> Self { // after
,
墨水似乎已更新。我进行了货物更新,然后没有错误地建立了合同。
$ testcontract % cargo update
Updating git repository `https://github.com/paritytech/ink`
Updating crates.io index
Updating git repository `https://github.com/type-metadata/type-metadata.git`
Updating aho-corasick v0.7.13 -> v0.7.14
Updating regex v1.3.9 -> v1.4.1
Updating regex-syntax v0.6.18 -> v0.6.20
Updating serde_json v1.0.58 -> v1.0.59
Updating syn v1.0.43 -> v1.0.44
Updating toml v0.5.6 -> v0.5.7
$ testcontract % sh build.sh
[1/4] Collecting crate metadata
[2/4] Building cargo project
Compiling compiler_builtins v0.1.35
Compiling core v0.0.0 (/Users/home/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core)
Compiling rustc-std-workspace-core v1.99.0 (/Users/home/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/rustc-std-workspace-core)
Compiling alloc v0.0.0 (/var/folders/xj/m862kvrj73x04dvsfr6vs_fm0000gn/T/cargo-xbuild8YkYwG)
Finished release [optimized] target(s) in 13.19s
Compiling cfg-if v0.1.10
Compiling serde_json v1.0.59
Compiling byte-slice-cast v0.3.5
Compiling arrayvec v0.5.1
Compiling memory_units v0.4.0
Compiling regex-syntax v0.6.20
Compiling smallvec v1.4.2
Compiling crunchy v0.2.2
Compiling paste v0.1.18
Compiling aho-corasick v0.7.14
Compiling num-traits v0.2.12
Compiling toml v0.5.7
Compiling ink_prelude v2.1.0 (https://github.com/paritytech/ink?tag=latest-v2#cca31543)
Compiling tiny-keccak v2.0.2
Compiling wee_alloc v0.4.5
Compiling ink_alloc v2.1.0 (https://github.com/paritytech/ink?tag=latest-v2#cca31543)
Compiling proc-macro-crate v0.1.5
Compiling parity-scale-codec-derive v1.2.2
Compiling regex v1.4.1
Compiling parity-scale-codec v1.3.5
Compiling ink_primitives v2.1.0 (https://github.com/paritytech/ink?tag=latest-v2#cca31543)
Compiling ink_core_derive v2.1.0 (https://github.com/paritytech/ink?tag=latest-v2#cca31543)
Compiling ink_lang_macro v2.1.0 (https://github.com/paritytech/ink?tag=latest-v2#cca31543)
Compiling ink_core v2.1.0 (https://github.com/paritytech/ink?tag=latest-v2#cca31543)
Compiling ink_lang v2.1.0 (https://github.com/paritytech/ink?tag=latest-v2#cca31543)
Compiling testcontract v0.1.0 (/var/folders/xj/m862kvrj73x04dvsfr6vs_fm0000gn/T/.cargo-contract_rKI7GO)
Finished release [optimized] target(s) in 13.91s
[3/4] Post processing wasm file
[4/4] Optimizing wasm file
Original wasm size: 21.8K,Optimized: 5.0K
Your contract is ready. You can find it here:
/Users/home/projects/testcontract/target/testcontract.wasm
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。