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 ab18071
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 63 deletions.
Original file line number Diff line number Diff line change
@@ -1,35 +1,16 @@
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
|
= 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`
10 | pub<'a> fn constructor(this: &'a Self) -> Self {
| ++++ ++
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
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>`
| ^^^ 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
20 changes: 10 additions & 10 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,18 @@
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>`
| ^^^ 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,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 @@ -48,7 +48,7 @@ error[E0599]: the method `fire` exists for struct `ink_env::call::CallBuilder<De
--> tests/ui/contract/fail/message-returns-non-codec.rs:18:9
|
6 | pub struct NonCodecType;
| ----------------------- doesn't satisfy `NonCodecType: parity_scale_codec::Decode`
| ------------------------ 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
Expand All @@ -58,5 +58,11 @@ error[E0599]: the method `fire` exists for struct `ink_env::call::CallBuilder<De
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,7 +2,7 @@ error[E0308]: mismatched types
--> tests/ui/contract/fail/trait-message-selector-mismatch.rs:25:9
|
25 | fn message(&self) {}
| ^^ expected `1`, found `2`
| ^^ expected `1_u32`, found `2_u32`
|
= note: expected struct `TraitMessageSelector<1>`
found struct `TraitMessageSelector<2>`
= note: expected struct `TraitMessageSelector<1_u32>`
found struct `TraitMessageSelector<2_u32>`
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0119]: conflicting implementations of trait `ink_lang::reflect::DispatchableMessageInfo<1083895717>` for type `contract::Contract`
error[E0119]: conflicting implementations of trait `ink_lang::reflect::DispatchableMessageInfo<1083895717_u32>` for type `contract::Contract`
--> tests/ui/contract/fail/trait-message-selector-overlap-1.rs:47:9
|
42 | fn message(&self) {}
Expand All @@ -7,7 +7,7 @@ error[E0119]: conflicting implementations of trait `ink_lang::reflect::Dispatcha
47 | fn message(&self) {}
| ^^ conflicting implementation for `contract::Contract`

error[E0119]: conflicting implementations of trait `ink_lang::codegen::TraitCallForwarderFor<1083895717>` for type `contract::_::CallBuilder`
error[E0119]: conflicting implementations of trait `ink_lang::codegen::TraitCallForwarderFor<1083895717_u32>` for type `contract::_::CallBuilder`
--> tests/ui/contract/fail/trait-message-selector-overlap-1.rs:45:5
|
40 | impl TraitDefinition1 for Contract {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0119]: conflicting implementations of trait `ink_lang::reflect::DispatchableMessageInfo<1518209067>` for type `contract::Contract`
error[E0119]: conflicting implementations of trait `ink_lang::reflect::DispatchableMessageInfo<1518209067_u32>` for type `contract::Contract`
--> tests/ui/contract/fail/trait-message-selector-overlap-2.rs:47:9
|
42 | fn message(&self) {}
Expand All @@ -7,7 +7,7 @@ error[E0119]: conflicting implementations of trait `ink_lang::reflect::Dispatcha
47 | fn message(&self) {}
| ^^ conflicting implementation for `contract::Contract`

error[E0119]: conflicting implementations of trait `ink_lang::codegen::TraitCallForwarderFor<1518209067>` for type `contract::_::CallBuilder`
error[E0119]: conflicting implementations of trait `ink_lang::codegen::TraitCallForwarderFor<1518209067_u32>` for type `contract::_::CallBuilder`
--> tests/ui/contract/fail/trait-message-selector-overlap-2.rs:45:5
|
40 | impl TraitDefinition1 for Contract {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0119]: conflicting implementations of trait `ink_lang::reflect::DispatchableMessageInfo<42>` for type `contract::Contract`
error[E0119]: conflicting implementations of trait `ink_lang::reflect::DispatchableMessageInfo<42_u32>` for type `contract::Contract`
--> tests/ui/contract/fail/trait-message-selector-overlap-3.rs:47:9
|
42 | fn message1(&self) {}
Expand All @@ -7,7 +7,7 @@ error[E0119]: conflicting implementations of trait `ink_lang::reflect::Dispatcha
47 | fn message2(&self) {}
| ^^ conflicting implementation for `contract::Contract`

error[E0119]: conflicting implementations of trait `ink_lang::codegen::TraitCallForwarderFor<42>` for type `contract::_::CallBuilder`
error[E0119]: conflicting implementations of trait `ink_lang::codegen::TraitCallForwarderFor<42_u32>` for type `contract::_::CallBuilder`
--> tests/ui/contract/fail/trait-message-selector-overlap-3.rs:45:5
|
40 | impl TraitDefinition1 for Contract {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ error[E0599]: the method `fire` exists for struct `CallBuilder<E, Set<Call<E>>,
--> tests/ui/trait_def/fail/message_output_non_codec.rs:7:5
|
3 | pub struct NonCodec;
| ------------------- doesn't satisfy `NonCodec: parity_scale_codec::Decode`
| -------------------- doesn't satisfy `NonCodec: parity_scale_codec::Decode`
...
7 | #[ink(message)]
| ^ method cannot be called on `CallBuilder<E, Set<Call<E>>, Set<ExecutionInput<ArgumentList<ArgumentListEnd, ArgumentListEnd>>>, Set<ReturnType<NonCodec>>>` due to unsatisfied trait bounds
Expand All @@ -35,5 +35,11 @@ error[E0599]: the method `fire` exists for struct `CallBuilder<E, Set<Call<E>>,
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)]
... |
| | }
| | }
| |_^

0 comments on commit ab18071

Please sign in to comment.