Unverified Commit c0956e42 authored by Michael Müller's avatar Michael Müller Committed by GitHub
Browse files

CI: Use stable for `clippy` and `cargo test` (#1391)



* Use stable `clippy`

* Use stable for `cargo test`

* Update test fixtures

	cd crates/lang/
	export TRYBUILD=overwrite
	cargo test --verbose --all-features --no-fail-fast

* Remove unnecessary cfg feature

* Update `CONTRIBUTING.md`

* Update test fixtures

* Update `CONTRIBUTING.md`

* Update CONTRIBUTING.md
Co-authored-by: Andrew Jones's avatarAndrew Jones <ascjones@gmail.com>

* Update CONTRIBUTING.md
Co-authored-by: Andrew Jones's avatarAndrew Jones <ascjones@gmail.com>
Co-authored-by: Andrew Jones's avatarAndrew Jones <ascjones@gmail.com>
parent 2cf8c3da
Pipeline #214413 passed with stages
in 18 minutes and 14 seconds
......@@ -39,6 +39,11 @@ variables:
# `cargo-contract`, but in our CI here we also use e.g.
# `cargo check` directly.
RUSTC_BOOTSTRAP: "1"
# TODO `cargo clippy --verbose --all-targets --all-features` for this crate
# currently fails on `stable`, but succeeds on `nightly`. This is due to
# this fix not yet in stable: https://github.com/rust-lang/rust-clippy/issues/8895.
# Remove the following line again as soon as `clippy` on stable succeeds again.
CLIPPY_ALLOWED: "clippy::extra_unused_lifetimes"
workflow:
rules:
......@@ -138,7 +143,7 @@ clippy-std:
<<: *test-refs
script:
- for crate in ${ALL_CRATES}; do
cargo +nightly clippy --verbose --all-targets --all-features --manifest-path ./crates/${crate}/Cargo.toml -- -D warnings;
cargo clippy --verbose --all-targets --all-features --manifest-path ./crates/${crate}/Cargo.toml -- -D warnings -A $CLIPPY_ALLOWED;
done
clippy-wasm:
......@@ -147,7 +152,7 @@ clippy-wasm:
<<: *test-refs
script:
- for crate in ${ALSO_WASM_CRATES}; do
cargo +nightly clippy --verbose --no-default-features --manifest-path ./crates/${crate}/Cargo.toml --target wasm32-unknown-unknown -- -D warnings;
cargo clippy --verbose --no-default-features --manifest-path ./crates/${crate}/Cargo.toml --target wasm32-unknown-unknown -- -D warnings -A $CLIPPY_ALLOWED;
done
allow_failure: true
......@@ -158,15 +163,15 @@ examples-clippy-std:
script:
- for example in examples/*/; do
if [ "$example" = "examples/upgradeable-contracts/" ]; then continue; fi;
cargo +nightly clippy --verbose --all-targets --manifest-path ${example}/Cargo.toml -- -D warnings;
cargo clippy --verbose --all-targets --manifest-path ${example}/Cargo.toml -- -D warnings -A $CLIPPY_ALLOWED;
done
- for contract in ${DELEGATOR_SUBCONTRACTS}; do
cargo +nightly clippy --verbose --all-targets --manifest-path ./examples/delegator/${contract}/Cargo.toml -- -D warnings;
cargo clippy --verbose --all-targets --manifest-path ./examples/delegator/${contract}/Cargo.toml -- -D warnings -A $CLIPPY_ALLOWED;
done
- for contract in ${UPGRADEABLE_CONTRACTS}; do
cargo +nightly clippy --verbose --all-targets --manifest-path ./examples/upgradeable-contracts/${contract}/Cargo.toml -- -D warnings;
cargo clippy --verbose --all-targets --manifest-path ./examples/upgradeable-contracts/${contract}/Cargo.toml -- -D warnings -A $CLIPPY_ALLOWED;
done
- cargo +nightly clippy --verbose --all-targets --manifest-path ./examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml -- -D warnings;
- cargo clippy --verbose --all-targets --manifest-path ./examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml -- -D warnings -A $CLIPPY_ALLOWED;
allow_failure: true
examples-clippy-wasm:
......@@ -176,15 +181,15 @@ examples-clippy-wasm:
script:
- for example in examples/*/; do
if [ "$example" = "examples/upgradeable-contracts/" ]; then continue; fi;
cargo +nightly clippy --verbose --manifest-path ${example}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings;
cargo clippy --verbose --manifest-path ${example}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings -A $CLIPPY_ALLOWED;
done
- for contract in ${DELEGATOR_SUBCONTRACTS}; do
cargo +nightly clippy --verbose --manifest-path ./examples/delegator/${contract}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings;
cargo clippy --verbose --manifest-path ./examples/delegator/${contract}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings -A $CLIPPY_ALLOWED;
done
- for contract in ${UPGRADEABLE_CONTRACTS}; do
cargo +nightly clippy --verbose --manifest-path ./examples/upgradeable-contracts/${contract}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings;
cargo clippy --verbose --manifest-path ./examples/upgradeable-contracts/${contract}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings -A $CLIPPY_ALLOWED;
done
- cargo +nightly clippy --verbose --manifest-path ./examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings;
- cargo clippy --verbose --manifest-path ./examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings -A $CLIPPY_ALLOWED;
allow_failure: true
......@@ -264,8 +269,8 @@ test:
# at the same time, hence we use this workaround.
QUICKCHECK_TESTS: 0
script:
- cargo +nightly test --verbose --all-features --no-fail-fast --workspace
- cargo +nightly test --verbose --all-features --no-fail-fast --workspace --doc
- cargo test --verbose --all-features --no-fail-fast --workspace
- cargo test --verbose --all-features --no-fail-fast --workspace --doc
docs:
stage: workspace
......@@ -321,7 +326,7 @@ codecov:
script:
# RUSTFLAGS are the cause target cache can't be used here
- cargo build --verbose --all-features --workspace
- cargo +nightly test --verbose --all-features --no-fail-fast --workspace
- cargo test --verbose --all-features --no-fail-fast --workspace
# coverage with branches
- grcov . --binary-path ./target/debug/ --source-dir . --output-type lcov --llvm --branch
--ignore-not-existing --ignore "/*" --ignore "tests/*" --output-path lcov-w-branch.info
......
......@@ -36,35 +36,46 @@ contributing in the first place anyways, right?)
To help you out here's a [really good post](https://cbea.ms/git-commit/) on how to write good commit
messages.
### Stable vs Nightly Rust
For everything but `rustfmt` we use Rust `stable` together with `export RUSTC_BOOTSTRAP=1`.
You have to export this environment variable locally too! Setting it will enable nightly
features in stable Rust. So it's definitely a hack, but we decided on it since using nightly
in the CI and for tooling came with a lot of maintenance burden.
### Checklist
Below is a checklist for you before doing a pull request.
Following these will ensure that your pull request is going to be accepted.
1. Run `rustfmt` automatically.
1. Run `clippy` on your changes.
1. Run tests via `cargo test --release` for off-chain testing.
1. For critical parts perform some manual on-chain tests.
1. Build the code and run tests also for the `wasm32` target.
1. Try to run some examples and see if they are still working correctly.
1. Sometimes clippy lints can be unfortunate or even buggy and it can be very hard to fix those.
In these situations you may skip the clippy lint with `#[clippy::skip]`, however,
note that this always requires a good rational as a side-comment and probably link to the eventual clippy bug.
1. **Important** Strive for simple, clean and concise code.
If your code is very complex - because it is trying to accomplish complex things - try to think about how another aproach or design could simplify it.
1. Name your branch with a prefix and a descriptive name in the style of `peter-refactor-storage-implementation`.
1. We won't accept a pull request with `FIXME` or `TODO` comments in it.
Please try to fix them by yourself and resolve all remaining to-do items.
If that is not possible then write an issue for each of them and link to the source line and commit with a proper description. For more information go [here](#Issues-&-pull-requests).
1. Document everything properly that you have written, refactored or touched. Especially keeping documentation up-to-date is very important. For larger portions please try to also update the ink! wiki or write a new entry there.
1. Write tests for your code. If your code is hard to test, try to find a design that allows for testing.
1. If needed also update the [`README`](README.md).
1. For performance critical parts we also want additional performance tests.
1. If you implement a fix for a reported bug also include a regression test alongside the fix if possible.
1. When commenting or documenting code make use of proper punctuation.
This might seem pedantic but we believe that in essence this is going to improve overall comment and documentation quality.
This might seem pedantic, but we believe that in essence this is going to improve overall comment and documentation quality.
1. If possible try to sign your commits, e.g. using GPG keys. For more information about this go [here](https://help.github.com/en/articles/signing-commits).
Verify the following locally, otherwise the CI will fail:
1. Is `rustfmt` happy with it ?
- `cargo +nightly fmt --all`
1. Is `clippy` happy with it?
- `cargo clippy --all-targets --all-features` -- -D warnings;
1. Does the code still compile?
- `cargo check --all-features`
1. Do all the examples still compile?
- `cargo contract check --manifest-path ./examples/.../Cargo.toml`
1. Is the `wasm32` target still compiling?
- `cargo check --no-default-features --target wasm32-unknown-unknown`
1. Are all the tests passing?
- `cargo test --all-features --workspace`
1. Are all the tests for the examples passing?
- `cargo test --manifest-path ./examples/.../Cargo.toml`
### Backwards Compatibility
ink! and `pallet-contracts` are projects under active development. As the Contracts API
......@@ -93,29 +104,6 @@ older nodes, please do the following:
You can have a look at the [PR#1284](https://github.com/paritytech/ink/pull/1284/files#diff-e7cc1cdb3856da1293c785de863703d5961c324aa2018decb0166ea1eb0631e8R191) for a reference of how the described way could be implemented.
## Continuous Integration
Our [continuous integration (CI)](https://github.com/paritytech/ink/blob/master/.gitlab-ci.yml) will check for the following properties of all changes.
1. Is `rustfmt` happy with it ?
- `cargo fmt --all`
1. Is `clippy` happy with it?
- `cargo clippy --all-targets --all-features`
1. Does the code still compile?
- `cargo check --all-features`
1. Do all the examples still compile?
- `cargo +nightly contract check --manifest-path ./examples/.../Cargo.toml`
1. Is the `wasm-32` target still compiling?
- `cargo check --no-default-features --target wasm32-unknown-unknown`
1. Are all the tests passing?
- `cargo test --all-features --workspace`
1. Are all the tests for the examples passing?
- `cargo +nightly test --manifest-path ./examples/.../Cargo.toml`
1. Is the test code coverage increasing or at least stable?
1. Has the size of the example contract binaries changed?
Only if our very demanding CI is happy with your pull request we will eventually merge it.
Exceptions confirm the rule!
## Issues and Pull Requests
......
......@@ -2,13 +2,13 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeDecode` is not satisfied
--> tests/ui/contract/fail/constructor-input-non-codec.rs:13:28
|
13 | pub fn constructor(_input: NonCodecType) -> Self {
| ^^^^^^^^^^^^^^^^^^^^ the trait `WrapperTypeDecode` is not implemented for `NonCodecType`
| ^^^^^^ the trait `WrapperTypeDecode` is not implemented for `NonCodecType`
|
= help: the following other types implement trait `WrapperTypeDecode`:
Arc<T>
Box<T>
Rc<T>
= note: required for `NonCodecType` to implement `parity_scale_codec::Decode`
= note: required because of the requirements on the impl of `parity_scale_codec::Decode` for `NonCodecType`
note: required by a bound in `DispatchInput`
--> src/codegen/dispatch/type_check.rs
|
......@@ -18,27 +18,20 @@ note: required by a bound in `DispatchInput`
error[E0277]: the trait bound `NonCodecType: WrapperTypeDecode` is not satisfied
--> tests/ui/contract/fail/constructor-input-non-codec.rs:13:9
|
13 | / pub fn constructor(_input: NonCodecType) -> Self {
14 | | Self {}
15 | | }
| |_________^ the trait `WrapperTypeDecode` is not implemented for `NonCodecType`
13 | pub fn constructor(_input: NonCodecType) -> Self {
| ^^^ the trait `WrapperTypeDecode` is not implemented for `NonCodecType`
|
= help: the following other types implement trait `WrapperTypeDecode`:
Arc<T>
Box<T>
Rc<T>
= note: required for `NonCodecType` to implement `parity_scale_codec::Decode`
= note: required because of the requirements on the impl of `parity_scale_codec::Decode` for `NonCodecType`
error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied
--> tests/ui/contract/fail/constructor-input-non-codec.rs:3:1
--> tests/ui/contract/fail/constructor-input-non-codec.rs:13:9
|
3 | #[ink::contract]
| ^^^^^^^^^^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `NonCodecType`
...
13 | / pub fn constructor(_input: NonCodecType) -> Self {
14 | | Self {}
15 | | }
| |_________- required by a bound introduced by this call
13 | pub fn constructor(_input: NonCodecType) -> Self {
| ^^^ the trait `WrapperTypeEncode` is not implemented for `NonCodecType`
|
= help: the following other types implement trait `WrapperTypeEncode`:
&T
......@@ -50,7 +43,7 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied
String
Vec<T>
parity_scale_codec::Ref<'a, T, U>
= note: required for `NonCodecType` to implement `Encode`
= note: required because of the requirements on the impl of `Encode` for `NonCodecType`
note: required by a bound in `ExecutionInput::<ArgumentList<ArgumentListEnd, ArgumentListEnd>>::push_arg`
--> $WORKSPACE/crates/env/src/call/execution_input.rs
|
......
error: encountered ink! constructor with overlapping wildcard selectors
--> tests/ui/contract/fail/constructor-multiple-wildcard-selectors.rs:15:9
|
15 | / pub fn constructor2() -> Self {
16 | | Self {}
17 | | }
| |_________^
15 | pub fn constructor2() -> Self {
| ^^^
error: first ink! constructor with overlapping wildcard selector here
--> tests/ui/contract/fail/constructor-multiple-wildcard-selectors.rs:10:9
|
10 | / pub fn constructor1() -> Self {
11 | | Self {}
12 | | }
| |_________^
10 | pub fn constructor1() -> Self {
| ^^^
......@@ -2,10 +2,10 @@ error: encountered ink! attribute arguments with equal kinds
--> tests/ui/contract/fail/constructor-selector-and-wildcard-selector.rs:9:51
|
9 | #[ink(constructor, selector = 0xCAFEBABA, selector = _)]
| ^^^^^^^^^^^^
| ^^^^^^^^
error: first equal ink! attribute argument with equal kind here
--> tests/ui/contract/fail/constructor-selector-and-wildcard-selector.rs:9:28
|
9 | #[ink(constructor, selector = 0xCAFEBABA, selector = _)]
| ^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^
error[E0637]: `&` without an explicit lifetime name cannot be used here
--> tests/ui/contract/fail/constructor-self-receiver-03.rs:10:34
|
10 | pub fn constructor(this: &Self) -> Self {
| ^ explicit lifetime name needed here
error[E0411]: cannot find type `Self` in this scope
--> tests/ui/contract/fail/constructor-self-receiver-03.rs:10:35
|
6 | pub struct Contract {}
| ---------------------- `Self` not allowed in a constant item
| --- `Self` not allowed in a constant item
...
10 | pub fn constructor(this: &Self) -> Self {
| ^^^^ `Self` is only available in impls, traits, and type definitions
......@@ -22,16 +16,13 @@ error[E0411]: cannot find type `Self` in this scope
10 | pub fn constructor(this: &Self) -> Self {
| ^^^^ `Self` is only available in impls, traits, and type definitions
error[E0277]: the trait bound `&'static Contract: WrapperTypeDecode` is not satisfied
--> tests/ui/contract/fail/constructor-self-receiver-03.rs:10:9
error[E0106]: missing lifetime specifier
--> tests/ui/contract/fail/constructor-self-receiver-03.rs:10:34
|
10 | pub fn constructor(this: &Self) -> Self {
| ^ expected named lifetime parameter
|
10 | / pub fn constructor(this: &Self) -> Self {
11 | | Self {}
12 | | }
| |_________^ the trait `WrapperTypeDecode` is not implemented for `&'static Contract`
help: consider introducing a named lifetime parameter
|
= help: the following other types implement trait `WrapperTypeDecode`:
Arc<T>
Box<T>
Rc<T>
= note: required for `&'static Contract` to implement `parity_scale_codec::Decode`
10 | pub<'a> fn constructor(this: &'a Self) -> Self {
| ++++ ++
error[E0277]: the trait bound `EventTopics<4>: RespectTopicLimit<2>` is not satisfied
error[E0277]: the trait bound `EventTopics<4_usize>: RespectTopicLimit<2_usize>` is not satisfied
--> tests/ui/contract/fail/event-too-many-topics-anonymous.rs:26:5
|
26 | / pub struct Event {
27 | | #[ink(topic)]
28 | | arg_1: i8,
29 | | #[ink(topic)]
... |
34 | | arg_4: i32,
35 | | }
| |_____^ the trait `RespectTopicLimit<2>` is not implemented for `EventTopics<4>`
26 | pub struct Event {
| ^^^ the trait `RespectTopicLimit<2_usize>` is not implemented for `EventTopics<4_usize>`
|
= help: the following other types implement trait `RespectTopicLimit<N>`:
<EventTopics<0> as RespectTopicLimit<0>>
<EventTopics<0> as RespectTopicLimit<10>>
<EventTopics<0> as RespectTopicLimit<11>>
<EventTopics<0> as RespectTopicLimit<12>>
<EventTopics<0> as RespectTopicLimit<1>>
<EventTopics<0> as RespectTopicLimit<2>>
<EventTopics<0> as RespectTopicLimit<3>>
<EventTopics<0> as RespectTopicLimit<4>>
<EventTopics<0_usize> as RespectTopicLimit<0_usize>>
<EventTopics<0_usize> as RespectTopicLimit<10_usize>>
<EventTopics<0_usize> as RespectTopicLimit<11_usize>>
<EventTopics<0_usize> as RespectTopicLimit<12_usize>>
<EventTopics<0_usize> as RespectTopicLimit<1_usize>>
<EventTopics<0_usize> as RespectTopicLimit<2_usize>>
<EventTopics<0_usize> as RespectTopicLimit<3_usize>>
<EventTopics<0_usize> as RespectTopicLimit<4_usize>>
and 83 others
note: required by a bound in `EventRespectsTopicLimit`
--> src/codegen/event/topics.rs
......
error[E0277]: the trait bound `EventTopics<3>: RespectTopicLimit<2>` is not satisfied
error[E0277]: the trait bound `EventTopics<3_usize>: RespectTopicLimit<2_usize>` is not satisfied
--> tests/ui/contract/fail/event-too-many-topics.rs:26:5
|
26 | / pub struct Event {
27 | | #[ink(topic)]
28 | | arg_1: i8,
29 | | #[ink(topic)]
... |
32 | | arg_3: i32,
33 | | }
| |_____^ the trait `RespectTopicLimit<2>` is not implemented for `EventTopics<3>`
26 | pub struct Event {
| ^^^ the trait `RespectTopicLimit<2_usize>` is not implemented for `EventTopics<3_usize>`
|
= help: the following other types implement trait `RespectTopicLimit<N>`:
<EventTopics<0> as RespectTopicLimit<0>>
<EventTopics<0> as RespectTopicLimit<10>>
<EventTopics<0> as RespectTopicLimit<11>>
<EventTopics<0> as RespectTopicLimit<12>>
<EventTopics<0> as RespectTopicLimit<1>>
<EventTopics<0> as RespectTopicLimit<2>>
<EventTopics<0> as RespectTopicLimit<3>>
<EventTopics<0> as RespectTopicLimit<4>>
<EventTopics<0_usize> as RespectTopicLimit<0_usize>>
<EventTopics<0_usize> as RespectTopicLimit<10_usize>>
<EventTopics<0_usize> as RespectTopicLimit<11_usize>>
<EventTopics<0_usize> as RespectTopicLimit<12_usize>>
<EventTopics<0_usize> as RespectTopicLimit<1_usize>>
<EventTopics<0_usize> as RespectTopicLimit<2_usize>>
<EventTopics<0_usize> as RespectTopicLimit<3_usize>>
<EventTopics<0_usize> as RespectTopicLimit<4_usize>>
and 83 others
note: required by a bound in `EventRespectsTopicLimit`
--> src/codegen/event/topics.rs
......
......@@ -11,7 +11,7 @@ error[E0599]: no function or associated item named `constructor_2` found for str
--> tests/ui/contract/fail/impl-block-for-non-storage-01.rs:22:16
|
6 | pub struct Contract {}
| ------------------- function or associated item `constructor_2` not found for this struct
| --- function or associated item `constructor_2` not found for this
...
22 | pub fn constructor_2() -> Self {
| ^^^^^^^^^^^^^
......@@ -23,7 +23,7 @@ error[E0599]: no function or associated item named `message_2` found for struct
--> tests/ui/contract/fail/impl-block-for-non-storage-01.rs:27:16
|
6 | pub struct Contract {}
| ------------------- function or associated item `message_2` not found for this struct
| --- function or associated item `message_2` not found for this
...
27 | pub fn message_2(&self) {}
| ^^^^^^^^^
......
......@@ -2,4 +2,4 @@ error: expected string type for `namespace` argument, e.g. #[ink(namespace = "he
--> tests/ui/contract/fail/impl-block-namespace-invalid-type.rs:8:11
|
8 | #[ink(namespace = true)]
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^
......@@ -2,7 +2,7 @@ error[E0599]: no function or associated item named `env` found for struct `Contr
--> tests/ui/contract/fail/impl-block-using-static-env-no-marker.rs:22:27
|
6 | pub struct Contract {}
| ------------------- function or associated item `env` not found for this struct
| --- function or associated item `env` not found for this
...
22 | let _ = Self::env().caller();
| ^^^ function or associated item not found in `Contract`
......
......@@ -2,13 +2,13 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeDecode` is not satisfied
--> tests/ui/contract/fail/message-input-non-codec.rs:18:31
|
18 | pub fn message(&self, _input: NonCodecType) {}
| ^^^^^^^^^^^^^^^^^^^^ the trait `WrapperTypeDecode` is not implemented for `NonCodecType`
| ^^^^^^ the trait `WrapperTypeDecode` is not implemented for `NonCodecType`
|
= help: the following other types implement trait `WrapperTypeDecode`:
Arc<T>
Box<T>
Rc<T>
= note: required for `NonCodecType` to implement `parity_scale_codec::Decode`
= note: required because of the requirements on the impl of `parity_scale_codec::Decode` for `NonCodecType`
note: required by a bound in `DispatchInput`
--> src/codegen/dispatch/type_check.rs
|
......@@ -19,22 +19,19 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeDecode` is not satisfied
--> tests/ui/contract/fail/message-input-non-codec.rs:18:9
|
18 | pub fn message(&self, _input: NonCodecType) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `WrapperTypeDecode` is not implemented for `NonCodecType`
| ^^^ the trait `WrapperTypeDecode` is not implemented for `NonCodecType`
|
= help: the following other types implement trait `WrapperTypeDecode`:
Arc<T>
Box<T>
Rc<T>
= note: required for `NonCodecType` to implement `parity_scale_codec::Decode`
= note: required because of the requirements on the impl of `parity_scale_codec::Decode` for `NonCodecType`
error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied
--> tests/ui/contract/fail/message-input-non-codec.rs:3:1
--> tests/ui/contract/fail/message-input-non-codec.rs:18:9
|
3 | #[ink::contract]
| ^^^^^^^^^^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `NonCodecType`
...
18 | pub fn message(&self, _input: NonCodecType) {}
| ---------------------------------------------- required by a bound introduced by this call
| ^^^ the trait `WrapperTypeEncode` is not implemented for `NonCodecType`
|
= help: the following other types implement trait `WrapperTypeEncode`:
&T
......@@ -46,7 +43,7 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied
String
Vec<T>
parity_scale_codec::Ref<'a, T, U>
= note: required for `NonCodecType` to implement `Encode`
= note: required because of the requirements on the impl of `Encode` for `NonCodecType`
note: required by a bound in `ExecutionInput::<ArgumentList<ArgumentListEnd, ArgumentListEnd>>::push_arg`
--> $WORKSPACE/crates/env/src/call/execution_input.rs
|
......@@ -57,7 +54,7 @@ error[E0599]: the method `fire` exists for struct `ink_env::call::CallBuilder<De
--> tests/ui/contract/fail/message-input-non-codec.rs:18:9
|
18 | pub fn message(&self, _input: NonCodecType) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `ink_env::call::CallBuilder<DefaultEnvironment, Set<Call<DefaultEnvironment>>, Set<ExecutionInput<ArgumentList<ink_env::call::utils::Argument<NonCodecType>, ArgumentList<ArgumentListEnd, ArgumentListEnd>>>>, Set<ReturnType<()>>>` due to unsatisfied trait bounds
| ^^^ method cannot be called on `ink_env::call::CallBuilder<DefaultEnvironment, Set<Call<DefaultEnvironment>>, Set<ExecutionInput<ArgumentList<ink_env::call::utils::Argument<NonCodecType>, ArgumentList<ArgumentListEnd, ArgumentListEnd>>>>, Set<ReturnType<()>>>` due to unsatisfied trait bounds
|
::: $WORKSPACE/crates/env/src/call/execution_input.rs
|
......
......@@ -2,10 +2,10 @@ error: encountered ink! messages with overlapping wildcard selectors
--> tests/ui/contract/fail/message-multiple-wildcard-selectors.rs:18:9
|
18 | pub fn message2(&self) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^
error: first ink! message with overlapping wildcard selector here
--> tests/ui/contract/fail/message-multiple-wildcard-selectors.rs:15:9
|
15 | pub fn message1(&self) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^
......@@ -14,7 +14,7 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied
String
Vec<T>
parity_scale_codec::Ref<'a, T, U>
= note: required for `NonCodecType` to implement `Encode`
= note: required because of the requirements on the impl of `Encode` for `NonCodecType`
note: required by a bound in `DispatchOutput`
--> src/codegen/dispatch/type_check.rs
|
......@@ -24,10 +24,8 @@ note: required by a bound in `DispatchOutput`
error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied
--> tests/ui/contract/fail/message-returns-non-codec.rs:18:9
|
18 | / pub fn message(&self) -> NonCodecType {
19 | | NonCodecType
20 | | }
| |_________^ the trait `WrapperTypeEncode` is not implemented for `NonCodecType`
18 | pub fn message(&self) -> NonCodecType {
| ^^^ the trait `WrapperTypeEncode` is not implemented for `NonCodecType`
|
= help: the following other types implement trait `WrapperTypeEncode`:
&T
......@@ -39,7 +37,7 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied
String
Vec<T>
parity_scale_codec::Ref<'a, T, U>
= note: required for `NonCodecType` to implement `Encode`
= note: required because of the requirements on the impl of `Encode` for `NonCodecType`
note: required by a bound in `return_value`
--> $WORKSPACE/crates/env/src/api.rs
|
......@@ -49,18 +47,22 @@ note: required by a bound in `return_value`
error[E0599]: the method `fire` exists for struct `ink_env::call::CallBuilder<DefaultEnvironment, Set<Call<DefaultEnvironment>>, Set<ExecutionInput<ArgumentList<ArgumentListEnd, ArgumentListEnd>>>, Set<ReturnType<NonCodecType>>>`, but its trait bounds were not satisfied
--> tests/ui/contract/fail/message-returns-non-codec.rs:18:9
|
6 | pub struct NonCodecType;
| ----------------------- doesn't satisfy `NonCodecType: parity_scale_codec::Decode`
6 | pub struct NonCodecType;
| ------------------------ doesn't satisfy `NonCodecType: parity_scale_codec::Decode`
...
18 | / pub fn message(&self) -> NonCodecType {
19 | | NonCodecType
20 | | }
| |_________^ method cannot be called on `ink_env::call::CallBuilder<DefaultEnvironment, Set<Call<DefaultEnvironment>>, Set<ExecutionInput<ArgumentList<ArgumentListEnd, ArgumentListEnd>>>, Set<ReturnType<NonCodecType>>>` due to unsatisfied trait bounds
18 | pub fn message(&self) -> NonCodecType {
| ^^^ method cannot be called on `ink_env::call::CallBuilder<DefaultEnvironment, Set<Call<DefaultEnvironment>>, Set<ExecutionInput<ArgumentList<ArgumentListEnd, ArgumentListEnd>>>, Set<ReturnType<NonCodecType>>>` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
`NonCodecType: parity_scale_codec::Decode`
note: the following trait must be implemented
--> $CARGO/parity-scale-codec-3.1.5/src/codec.rs
|
| pub trait Decode: Sized {
| ^^^^^^^^^^^^^^^^^^^^^^^
| / pub trait Decode: Sized {
| | // !INTERNAL USE ONLY!
| | // This const helps SCALE to optimize the encoding/decoding by doing fake specialization.
| | #[doc(hidden)]
... |
| | }
| | }
| |_^
......@@ -2,10 +2,10 @@ error: encountered ink! attribute arguments with equal kinds
--> tests/ui/contract/fail/message-selector-and-wildcard-selector.rs:14:47
|
14 | #[ink(message, selector = 0xCAFEBABA, selector = _)]
| ^^^^^^^^^^^^
| ^^^^^^^^
error: first equal ink! attribute argument with equal kind here
--> tests/ui/contract/fail/message-selector-and-wildcard-selector.rs:14:24
|
14 | #[ink(message, selector = 0xCAFEBABA, selector = _)]
| ^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^
......@@ -2,4 +2,4 @@ error: #[ink(selector = ..)] attributes with string inputs are deprecated. use a
--> tests/ui/contract/fail/message-selector-invalid-type-01.rs:14:24
|
14 | #[ink(message, selector = "0xC0DECAFE")]
| ^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^
......@@ -2,4 +2,4 @@ error: expected 4-digit hexcode for `selector` argument, e.g. #[ink(selector = 0
--> tests/ui/contract/fail/message-selector-invalid-type-02.rs:14:24
|
14 | #[ink(message, selector = true)]
| ^^^^^^^^^^^^^^^
| ^^^^^^^^
......@@ -2,4 +2,4 @@ error: ink! messages must have `&self` or `&mut self` receiver
--> tests/ui/contract/fail/message-self-receiver-invalid-01.rs:15:24
|
15 | pub fn message(this: &Self) {}
| ^^^^^^^^^^^
| ^^^^
......@@ -2,4 +2,4 @@ error: ink! messages must have `&self` or `&mut self` receiver
--> tests/ui/contract/fail/message-self-receiver-invalid-02.rs:15:24
|
15 | pub fn message(this: &mut Self) {}
| ^^^^^^^^^^^^^^^
| ^^^^
error: ink! messages must have `&self` or `&mut self` receiver
--> tests/ui/contract/fail/message-self-receiver-missing.rs:14:9
|
14 | / #[ink(message)]
15 | | pub fn message() {}
| |___________________________^
14 | #[ink(message)]
| ^