From ab18071bda3509fdb2ef9e4dfd6f06d6ab2cf6b3 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Wed, 19 Oct 2022 14:16:42 +0300 Subject: [PATCH] fix ui tests again --- .../fail/constructor-self-receiver-03.stderr | 31 ++++--------------- .../event-too-many-topics-anonymous.stderr | 20 ++++++------ .../fail/event-too-many-topics.stderr | 20 ++++++------ .../fail/impl-block-for-non-storage-01.stderr | 4 +-- ...pl-block-using-static-env-no-marker.stderr | 2 +- .../fail/message-returns-non-codec.stderr | 12 +++++-- .../trait-message-selector-mismatch.stderr | 6 ++-- .../trait-message-selector-overlap-1.stderr | 4 +-- .../trait-message-selector-overlap-2.stderr | 4 +-- .../trait-message-selector-overlap-3.stderr | 4 +-- .../fail/message_output_non_codec.stderr | 12 +++++-- 11 files changed, 56 insertions(+), 63 deletions(-) diff --git a/crates/lang/tests/ui/contract/fail/constructor-self-receiver-03.stderr b/crates/lang/tests/ui/contract/fail/constructor-self-receiver-03.stderr index baba8081131..15679939012 100644 --- a/crates/lang/tests/ui/contract/fail/constructor-self-receiver-03.stderr +++ b/crates/lang/tests/ui/contract/fail/constructor-self-receiver-03.stderr @@ -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 - Box - Rc - = 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 { + | ++++ ++ diff --git a/crates/lang/tests/ui/contract/fail/event-too-many-topics-anonymous.stderr b/crates/lang/tests/ui/contract/fail/event-too-many-topics-anonymous.stderr index d3a3e05ccb9..29cd6daf0d0 100644 --- a/crates/lang/tests/ui/contract/fail/event-too-many-topics-anonymous.stderr +++ b/crates/lang/tests/ui/contract/fail/event-too-many-topics-anonymous.stderr @@ -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`: - as RespectTopicLimit<0>> - as RespectTopicLimit<10>> - as RespectTopicLimit<11>> - as RespectTopicLimit<12>> - as RespectTopicLimit<1>> - as RespectTopicLimit<2>> - as RespectTopicLimit<3>> - as RespectTopicLimit<4>> + as RespectTopicLimit<0_usize>> + as RespectTopicLimit<10_usize>> + as RespectTopicLimit<11_usize>> + as RespectTopicLimit<12_usize>> + as RespectTopicLimit<1_usize>> + as RespectTopicLimit<2_usize>> + as RespectTopicLimit<3_usize>> + as RespectTopicLimit<4_usize>> and 83 others note: required by a bound in `EventRespectsTopicLimit` --> src/codegen/event/topics.rs diff --git a/crates/lang/tests/ui/contract/fail/event-too-many-topics.stderr b/crates/lang/tests/ui/contract/fail/event-too-many-topics.stderr index bde29e339e4..472de268a23 100644 --- a/crates/lang/tests/ui/contract/fail/event-too-many-topics.stderr +++ b/crates/lang/tests/ui/contract/fail/event-too-many-topics.stderr @@ -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`: - as RespectTopicLimit<0>> - as RespectTopicLimit<10>> - as RespectTopicLimit<11>> - as RespectTopicLimit<12>> - as RespectTopicLimit<1>> - as RespectTopicLimit<2>> - as RespectTopicLimit<3>> - as RespectTopicLimit<4>> + as RespectTopicLimit<0_usize>> + as RespectTopicLimit<10_usize>> + as RespectTopicLimit<11_usize>> + as RespectTopicLimit<12_usize>> + as RespectTopicLimit<1_usize>> + as RespectTopicLimit<2_usize>> + as RespectTopicLimit<3_usize>> + as RespectTopicLimit<4_usize>> and 83 others note: required by a bound in `EventRespectsTopicLimit` --> src/codegen/event/topics.rs diff --git a/crates/lang/tests/ui/contract/fail/impl-block-for-non-storage-01.stderr b/crates/lang/tests/ui/contract/fail/impl-block-for-non-storage-01.stderr index 3474fc5b664..319d43ae79b 100644 --- a/crates/lang/tests/ui/contract/fail/impl-block-for-non-storage-01.stderr +++ b/crates/lang/tests/ui/contract/fail/impl-block-for-non-storage-01.stderr @@ -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) {} | ^^^^^^^^^ diff --git a/crates/lang/tests/ui/contract/fail/impl-block-using-static-env-no-marker.stderr b/crates/lang/tests/ui/contract/fail/impl-block-using-static-env-no-marker.stderr index a3f7c18ee82..dc1d8d72b37 100644 --- a/crates/lang/tests/ui/contract/fail/impl-block-using-static-env-no-marker.stderr +++ b/crates/lang/tests/ui/contract/fail/impl-block-using-static-env-no-marker.stderr @@ -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` diff --git a/crates/lang/tests/ui/contract/fail/message-returns-non-codec.stderr b/crates/lang/tests/ui/contract/fail/message-returns-non-codec.stderr index 098befa790e..a43868505cd 100644 --- a/crates/lang/tests/ui/contract/fail/message-returns-non-codec.stderr +++ b/crates/lang/tests/ui/contract/fail/message-returns-non-codec.stderr @@ -48,7 +48,7 @@ error[E0599]: the method `fire` exists for struct `ink_env::call::CallBuilder 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>, Set>>, Set>>` due to unsatisfied trait bounds @@ -58,5 +58,11 @@ error[E0599]: the method `fire` exists for struct `ink_env::call::CallBuilder $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)] +... | + | | } + | | } + | |_^ diff --git a/crates/lang/tests/ui/contract/fail/trait-message-selector-mismatch.stderr b/crates/lang/tests/ui/contract/fail/trait-message-selector-mismatch.stderr index 8bc751aaa90..26c441d140c 100644 --- a/crates/lang/tests/ui/contract/fail/trait-message-selector-mismatch.stderr +++ b/crates/lang/tests/ui/contract/fail/trait-message-selector-mismatch.stderr @@ -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>` diff --git a/crates/lang/tests/ui/contract/fail/trait-message-selector-overlap-1.stderr b/crates/lang/tests/ui/contract/fail/trait-message-selector-overlap-1.stderr index 81a7e8d0cca..7c0aa4e8320 100644 --- a/crates/lang/tests/ui/contract/fail/trait-message-selector-overlap-1.stderr +++ b/crates/lang/tests/ui/contract/fail/trait-message-selector-overlap-1.stderr @@ -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) {} @@ -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 { diff --git a/crates/lang/tests/ui/contract/fail/trait-message-selector-overlap-2.stderr b/crates/lang/tests/ui/contract/fail/trait-message-selector-overlap-2.stderr index a2eabcb9a01..91689c8315b 100644 --- a/crates/lang/tests/ui/contract/fail/trait-message-selector-overlap-2.stderr +++ b/crates/lang/tests/ui/contract/fail/trait-message-selector-overlap-2.stderr @@ -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) {} @@ -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 { diff --git a/crates/lang/tests/ui/contract/fail/trait-message-selector-overlap-3.stderr b/crates/lang/tests/ui/contract/fail/trait-message-selector-overlap-3.stderr index 32b0c56157d..06d2d37e211 100644 --- a/crates/lang/tests/ui/contract/fail/trait-message-selector-overlap-3.stderr +++ b/crates/lang/tests/ui/contract/fail/trait-message-selector-overlap-3.stderr @@ -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) {} @@ -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 { diff --git a/crates/lang/tests/ui/trait_def/fail/message_output_non_codec.stderr b/crates/lang/tests/ui/trait_def/fail/message_output_non_codec.stderr index bc8f966df11..073fbb3486b 100644 --- a/crates/lang/tests/ui/trait_def/fail/message_output_non_codec.stderr +++ b/crates/lang/tests/ui/trait_def/fail/message_output_non_codec.stderr @@ -25,7 +25,7 @@ error[E0599]: the method `fire` exists for struct `CallBuilder>, --> 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>, Set>>, Set>>` due to unsatisfied trait bounds @@ -35,5 +35,11 @@ error[E0599]: the method `fire` exists for struct `CallBuilder>, 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)] +... | + | | } + | | } + | |_^