Skip to content

Commit

Permalink
fix ui tests again
Browse files Browse the repository at this point in the history
  • Loading branch information
agryaznov committed Oct 19, 2022
1 parent 23d61d4 commit 8e3bb51
Show file tree
Hide file tree
Showing 34 changed files with 197 additions and 145 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ 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>
Expand All @@ -18,8 +18,10 @@ 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 {
| ^^^ the trait `WrapperTypeDecode` is not implemented for `NonCodecType`
13 | / pub fn constructor(_input: NonCodecType) -> Self {
14 | | Self {}
15 | | }
| |_________^ the trait `WrapperTypeDecode` is not implemented for `NonCodecType`
|
= help: the following other types implement trait `WrapperTypeDecode`:
Arc<T>
Expand All @@ -30,8 +32,10 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeDecode` is not satisfied
error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied
--> tests/ui/contract/fail/constructor-input-non-codec.rs:13:9
|
13 | pub fn constructor(_input: NonCodecType) -> Self {
| ^^^ the trait `WrapperTypeEncode` is not implemented for `NonCodecType`
13 | / pub fn constructor(_input: NonCodecType) -> Self {
14 | | Self {}
15 | | }
| |_________^ the trait `WrapperTypeEncode` is not implemented for `NonCodecType`
|
= help: the following other types implement trait `WrapperTypeEncode`:
&T
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
error: encountered ink! constructor with overlapping wildcard selectors
--> tests/ui/contract/fail/constructor-multiple-wildcard-selectors.rs:15:9
|
15 | pub fn constructor2() -> Self {
| ^^^
15 | / pub fn constructor2() -> Self {
16 | | Self {}
17 | | }
| |_________^

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 {
| ^^^
10 | / pub fn constructor1() -> Self {
11 | | Self {}
12 | | }
| |_________^
Original file line number Diff line number Diff line change
Expand Up @@ -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 = _)]
| ^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change
@@ -1,35 +1,18 @@
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
...
10 | pub fn constructor(this: &Self) -> Self {
| ^^^^ `Self` is only available in impls, traits, and type definitions

error[E0411]: cannot find type `Self` in this scope
--> tests/ui/contract/fail/constructor-self-receiver-03.rs:10:35
error[E0106]: missing lifetime specifier
--> tests/ui/contract/fail/constructor-self-receiver-03.rs:10:34
|
3 | #[ink::contract]
| ---------------- `Self` not allowed in a function
...
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
| ^ expected named lifetime parameter
|
10 | pub fn constructor(this: &Self) -> Self {
| ^^^ the trait `WrapperTypeDecode` is not implemented for `&'static Contract`
help: consider introducing a named lifetime parameter
|
10 ~ pub fn constructor(this: &'a Self) -> Self {
11 | Self {}
12 ~ }<'a>
|
= help: the following other types implement trait `WrapperTypeDecode`:
Arc<T>
Box<T>
Rc<T>
= note: required because of the requirements on the impl of `parity_scale_codec::Decode` for `&'static Contract`
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
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 {
| ^^^ the trait `RespectTopicLimit<2>` is not implemented for `EventTopics<4>`
26 | / pub struct Event {
27 | | #[ink(topic)]
28 | | arg_1: i8,
29 | | #[ink(topic)]
... |
34 | | arg_4: i32,
35 | | }
| |_____^ 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
Expand Down
28 changes: 17 additions & 11 deletions crates/lang/tests/ui/contract/fail/event-too-many-topics.stderr
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
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 {
| ^^^ the trait `RespectTopicLimit<2>` is not implemented for `EventTopics<3>`
26 | / pub struct Event {
27 | | #[ink(topic)]
28 | | arg_1: i8,
29 | | #[ink(topic)]
... |
32 | | arg_3: i32,
33 | | }
| |_____^ 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
| ^^^^^^^^^^^^^
Expand All @@ -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) {}
| ^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ 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>
Expand All @@ -19,7 +19,7 @@ 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>
Expand All @@ -31,7 +31,7 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied
--> tests/ui/contract/fail/message-input-non-codec.rs:18:9
|
18 | pub fn message(&self, _input: NonCodecType) {}
| ^^^ the trait `WrapperTypeEncode` is not implemented for `NonCodecType`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `NonCodecType`
|
= help: the following other types implement trait `WrapperTypeEncode`:
&T
Expand All @@ -54,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
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
| ^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ 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 {
| ^^^ the trait `WrapperTypeEncode` is not implemented for `NonCodecType`
18 | / pub fn message(&self) -> NonCodecType {
19 | | NonCodecType
20 | | }
| |_________^ the trait `WrapperTypeEncode` is not implemented for `NonCodecType`
|
= help: the following other types implement trait `WrapperTypeEncode`:
&T
Expand All @@ -47,16 +49,24 @@ 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 {
| ^^^ 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 {
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
|
= 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.2.1/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)]
... |
| | }
| | }
| |_^
Original file line number Diff line number Diff line change
Expand Up @@ -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 = _)]
| ^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
| ^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
| ^^^^^^^^
| ^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
| ^^^^
| ^^^^^^^^^^^
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
| ^^^^
| ^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
error: ink! messages must have `&self` or `&mut self` receiver
--> tests/ui/contract/fail/message-self-receiver-missing.rs:14:9
|
14 | #[ink(message)]
| ^
14 | / #[ink(message)]
15 | | pub fn message() {}
| |___________________________^
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
error: missing ink! constructor
--> tests/ui/contract/fail/module-missing-constructor.rs:4:1
|
4 | mod contract {
| ^^^
--> tests/ui/contract/fail/module-missing-constructor.rs:4:1
|
4 | / mod contract {
5 | | #[ink(storage)]
6 | | pub struct Contract {}
7 | |
... |
11 | | }
12 | | }
| |_^
14 changes: 10 additions & 4 deletions crates/lang/tests/ui/contract/fail/module-missing-message.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
error: missing ink! message
--> tests/ui/contract/fail/module-missing-message.rs:4:1
|
4 | mod contract {
| ^^^
--> tests/ui/contract/fail/module-missing-message.rs:4:1
|
4 | / mod contract {
5 | | #[ink(storage)]
6 | | pub struct Contract {}
7 | |
... |
13 | | }
14 | | }
| |_^
Loading

0 comments on commit 8e3bb51

Please sign in to comment.