From 7fcc484ff41c7c34ee8c95225aefc9e0678189d2 Mon Sep 17 00:00:00 2001 From: Sasha Gryaznov Date: Tue, 13 Sep 2022 18:22:21 +0300 Subject: [PATCH 1/6] Add `ink_env::pay_with_call!` helper macro for off-chain emulation of sending payments with contract msg calls (#1379) * first ver.: transfer_in api function implememted but we can't have it in on-chain env * transfer_in moved to test_api * doc + example updated * Update examples/contract-transfer/lib.rs Co-authored-by: Hernando Castano * use stmt moved to macro * docs and nitty gritties * moved the macro to the test mod * spell fix * next review round suggestions applied * Use four spaces for macro indentation Co-authored-by: Hernando Castano Co-authored-by: Hernando Castano --- crates/env/src/engine/off_chain/test_api.rs | 49 +++++++++++++++++++++ examples/contract-transfer/lib.rs | 23 +++++++--- 2 files changed, 66 insertions(+), 6 deletions(-) diff --git a/crates/env/src/engine/off_chain/test_api.rs b/crates/env/src/engine/off_chain/test_api.rs index 4d73be03ac3..09f9c82ad2d 100644 --- a/crates/env/src/engine/off_chain/test_api.rs +++ b/crates/env/src/engine/off_chain/test_api.rs @@ -200,6 +200,8 @@ where } /// Sets the value transferred from the caller to the callee as part of the call. +/// +/// Please note that the acting accounts should be set with [`set_caller()`] and [`set_callee()`] beforehand. pub fn set_value_transferred(value: T::Balance) where T: Environment, // Just temporary for the MVP! @@ -209,6 +211,44 @@ where }) } +/// Transfers value from the caller account to the contract. +/// +/// Please note that the acting accounts should be set with [`set_caller()`] and [`set_callee()`] beforehand. +pub fn transfer_in(value: T::Balance) +where + T: Environment, // Just temporary for the MVP! +{ + ::on_instance(|instance| { + let caller = instance + .engine + .exec_context + .caller + .as_ref() + .expect("no caller has been set") + .as_bytes() + .to_vec(); + + let caller_old_balance = instance + .engine + .get_balance(caller.clone()) + .unwrap_or_default(); + + let callee = instance.engine.get_callee(); + let contract_old_balance = instance + .engine + .get_balance(callee.clone()) + .unwrap_or_default(); + + instance + .engine + .set_balance(caller, caller_old_balance - value); + instance + .engine + .set_balance(callee, contract_old_balance + value); + instance.engine.set_value_transferred(value); + }); +} + /// Returns the amount of storage cells used by the account `account_id`. /// /// Returns `None` if the `account_id` is non-existent. @@ -355,3 +395,12 @@ pub fn assert_contract_termination( assert_eq!(value_transferred, expected_value_transferred_to_beneficiary); assert_eq!(beneficiary, expected_beneficiary); } + +/// Prepend contract message call with value transfer. Used for tests in off-chain environment. +#[macro_export] +macro_rules! pay_with_call { + ($contract:ident . $message:ident ( $($params:ty)? ) , $amount:expr) => {{ + $crate::test::transfer_in::($amount); + $contract.$message($($params:ty)?) + }} +} diff --git a/examples/contract-transfer/lib.rs b/examples/contract-transfer/lib.rs index a46da79f193..27e419dadd9 100644 --- a/examples/contract-transfer/lib.rs +++ b/examples/contract-transfer/lib.rs @@ -101,20 +101,31 @@ pub mod give_me { #[ink::test] fn test_transferred_value() { + use ink_lang::codegen::Env; // given let accounts = default_accounts(); let give_me = create_contract(100); + let contract_account = give_me.env().account_id(); // when - // Push the new execution context which sets Eve as caller and - // the `mock_transferred_value` as the value which the contract - // will see as transferred to it. + // Push the new execution context which sets initial balances and + // sets Eve as the caller + set_balance(accounts.eve, 100); + set_balance(contract_account, 0); set_sender(accounts.eve); - ink_env::test::set_value_transferred::(10); // then - // there must be no panic - give_me.was_it_ten(); + // we use helper macro to emulate method invocation coming with payment, + // and there must be no panic + ink_env::pay_with_call!(give_me.was_it_ten(), 10); + + // and + // balances should be changed properly + let contract_new_balance = get_balance(contract_account); + let caller_new_balance = get_balance(accounts.eve); + + assert_eq!(caller_new_balance, 100 - 10); + assert_eq!(contract_new_balance, 10); } #[ink::test] From 7c0bf8657ffbecc2286659825d20bc0954855f53 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Wed, 21 Sep 2022 10:26:25 +0200 Subject: [PATCH 2/6] Allow `pay_with_call` to take multiple arguments (#1401) --- crates/env/src/engine/off_chain/test_api.rs | 4 +-- crates/lang/tests/compile_tests.rs | 2 ++ .../ui/pay_with_call/pass/multiple_args.rs | 29 +++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 crates/lang/tests/ui/pay_with_call/pass/multiple_args.rs diff --git a/crates/env/src/engine/off_chain/test_api.rs b/crates/env/src/engine/off_chain/test_api.rs index 09f9c82ad2d..01bef923811 100644 --- a/crates/env/src/engine/off_chain/test_api.rs +++ b/crates/env/src/engine/off_chain/test_api.rs @@ -399,8 +399,8 @@ pub fn assert_contract_termination( /// Prepend contract message call with value transfer. Used for tests in off-chain environment. #[macro_export] macro_rules! pay_with_call { - ($contract:ident . $message:ident ( $($params:ty)? ) , $amount:expr) => {{ + ($contract:ident . $message:ident ( $( $params:expr ),* ) , $amount:expr) => {{ $crate::test::transfer_in::($amount); - $contract.$message($($params:ty)?) + $contract.$message($ ($params) ,*) }} } diff --git a/crates/lang/tests/compile_tests.rs b/crates/lang/tests/compile_tests.rs index b24bb0409eb..aca8882eddc 100644 --- a/crates/lang/tests/compile_tests.rs +++ b/crates/lang/tests/compile_tests.rs @@ -32,4 +32,6 @@ fn ui_tests() { t.compile_fail("tests/ui/trait_def/fail/*.rs"); t.pass("tests/ui/chain_extension/E-01-simple.rs"); + + t.pass("tests/ui/pay_with_call/pass/multiple_args.rs"); } diff --git a/crates/lang/tests/ui/pay_with_call/pass/multiple_args.rs b/crates/lang/tests/ui/pay_with_call/pass/multiple_args.rs new file mode 100644 index 00000000000..77fbfdab6ff --- /dev/null +++ b/crates/lang/tests/ui/pay_with_call/pass/multiple_args.rs @@ -0,0 +1,29 @@ +#[ink::contract] +mod contract { + #[ink(storage)] + pub struct Contract {} + + impl Contract { + #[ink(constructor)] + pub fn new() -> Self { + Self {} + } + + #[ink(message)] + pub fn message0(&self) {} + + #[ink(message)] + pub fn message1(&self, _arg1: u8) {} + + #[ink(message)] + pub fn message2(&self, _arg1: u8, _arg2: (u8, AccountId)) {} + + fn check_compiles(&self) { + ink::env::pay_with_call!(self.message0(), 0); + ink::env::pay_with_call!(self.message1(0), 0); + ink::env::pay_with_call!(self.message2(0, (0, Self::env().account_id())), 0); + } + } +} + +fn main() {} From 9df05146905244fea56893be31ba8931a07a1a39 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 26 Sep 2022 16:07:30 +0100 Subject: [PATCH 3/6] Fix UI tests for latest stable `1.64` (#1416) --- .../fail/constructor-self-receiver-03.stderr | 35 ++++++ .../trait-message-selector-overlap-1.stderr | 17 +++ .../trait-message-selector-overlap-2.stderr | 17 +++ .../trait-message-selector-overlap-3.stderr | 17 +++ .../fail/collections_only_packed_1.stderr | 118 ++++++++++++++++++ .../fail/collections_only_packed_2.stderr | 109 ++++++++++++++++ .../event-too-many-topics-anonymous.stderr | 24 ++-- .../fail/event-too-many-topics.stderr | 24 ++-- .../fail/impl-block-for-non-storage-01.stderr | 10 ++ ...pl-block-using-static-env-no-marker.stderr | 5 + .../fail/message-returns-non-codec.stderr | 15 ++- .../trait-message-selector-mismatch.stderr | 9 +- .../fail/message_output_non_codec.stderr | 15 ++- 13 files changed, 381 insertions(+), 34 deletions(-) create mode 100644 crates/ink/tests/ui/contract/fail/constructor-self-receiver-03.stderr create mode 100644 crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-1.stderr create mode 100644 crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-2.stderr create mode 100644 crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-3.stderr create mode 100644 crates/ink/tests/ui/storage_item/fail/collections_only_packed_1.stderr create mode 100644 crates/ink/tests/ui/storage_item/fail/collections_only_packed_2.stderr diff --git a/crates/ink/tests/ui/contract/fail/constructor-self-receiver-03.stderr b/crates/ink/tests/ui/contract/fail/constructor-self-receiver-03.stderr new file mode 100644 index 00000000000..e836a609d24 --- /dev/null +++ b/crates/ink/tests/ui/contract/fail/constructor-self-receiver-03.stderr @@ -0,0 +1,35 @@ +error[E0637]: `&` without an explicit lifetime name cannot be used here + --> tests/ui/contract/fail/constructor-self-receiver-03.rs:8:34 + | +8 | 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:8:35 + | +4 | pub struct Contract {} + | --- `Self` not allowed in a constant item +... +8 | 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:8:35 + | +1 | #[ink::contract] + | ---------------- `Self` not allowed in a function +... +8 | 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:8:9 + | +8 | pub fn constructor(this: &Self) -> Self { + | ^^^ the trait `WrapperTypeDecode` is not implemented for `&'static Contract` + | + = 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` diff --git a/crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-1.stderr b/crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-1.stderr new file mode 100644 index 00000000000..9d94b80f2b7 --- /dev/null +++ b/crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-1.stderr @@ -0,0 +1,17 @@ +error[E0119]: conflicting implementations of trait `ink::reflect::DispatchableMessageInfo<1083895717>` for type `contract::Contract` + --> tests/ui/contract/fail/trait-message-selector-overlap-1.rs:41:9 + | +36 | fn message(&self) {} + | -- first implementation here +... +41 | fn message(&self) {} + | ^^ conflicting implementation for `contract::Contract` + +error[E0119]: conflicting implementations of trait `ink::codegen::TraitCallForwarderFor<1083895717>` for type `contract::_::CallBuilder` + --> tests/ui/contract/fail/trait-message-selector-overlap-1.rs:39:5 + | +34 | impl TraitDefinition1 for Contract { + | ---- first implementation here +... +39 | impl TraitDefinition2 for Contract { + | ^^^^ conflicting implementation for `contract::_::CallBuilder` diff --git a/crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-2.stderr b/crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-2.stderr new file mode 100644 index 00000000000..dcfcb832bfc --- /dev/null +++ b/crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-2.stderr @@ -0,0 +1,17 @@ +error[E0119]: conflicting implementations of trait `ink::reflect::DispatchableMessageInfo<1518209067>` for type `contract::Contract` + --> tests/ui/contract/fail/trait-message-selector-overlap-2.rs:41:9 + | +36 | fn message(&self) {} + | -- first implementation here +... +41 | fn message(&self) {} + | ^^ conflicting implementation for `contract::Contract` + +error[E0119]: conflicting implementations of trait `ink::codegen::TraitCallForwarderFor<1518209067>` for type `contract::_::CallBuilder` + --> tests/ui/contract/fail/trait-message-selector-overlap-2.rs:39:5 + | +34 | impl TraitDefinition1 for Contract { + | ---- first implementation here +... +39 | impl TraitDefinition2 for Contract { + | ^^^^ conflicting implementation for `contract::_::CallBuilder` diff --git a/crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-3.stderr b/crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-3.stderr new file mode 100644 index 00000000000..27a02c68329 --- /dev/null +++ b/crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-3.stderr @@ -0,0 +1,17 @@ +error[E0119]: conflicting implementations of trait `ink::reflect::DispatchableMessageInfo<42>` for type `contract::Contract` + --> tests/ui/contract/fail/trait-message-selector-overlap-3.rs:41:9 + | +36 | fn message1(&self) {} + | -- first implementation here +... +41 | fn message2(&self) {} + | ^^ conflicting implementation for `contract::Contract` + +error[E0119]: conflicting implementations of trait `ink::codegen::TraitCallForwarderFor<42>` for type `contract::_::CallBuilder` + --> tests/ui/contract/fail/trait-message-selector-overlap-3.rs:39:5 + | +34 | impl TraitDefinition1 for Contract { + | ---- first implementation here +... +39 | impl TraitDefinition2 for Contract { + | ^^^^ conflicting implementation for `contract::_::CallBuilder` diff --git a/crates/ink/tests/ui/storage_item/fail/collections_only_packed_1.stderr b/crates/ink/tests/ui/storage_item/fail/collections_only_packed_1.stderr new file mode 100644 index 00000000000..9c68f5283b8 --- /dev/null +++ b/crates/ink/tests/ui/storage_item/fail/collections_only_packed_1.stderr @@ -0,0 +1,118 @@ +error[E0277]: the trait bound `Vec: parity_scale_codec::Decode` is not satisfied + --> tests/ui/storage_item/fail/collections_only_packed_1.rs:11:8 + | +11 | a: Vec, + | ^^^ the trait `parity_scale_codec::Decode` is not implemented for `Vec` + | + = help: the trait `parity_scale_codec::Decode` is implemented for `Vec` + = note: required because of the requirements on the impl of `Packed` for `Vec` + = note: required because of the requirements on the impl of `StorableHint<()>` for `Vec` + = note: required because of the requirements on the impl of `AutoStorableHint>` for `Vec` + +error[E0277]: the trait bound `[NonPacked]: Encode` is not satisfied + --> tests/ui/storage_item/fail/collections_only_packed_1.rs:11:8 + | +11 | a: Vec, + | ^^^ the trait `Encode` is not implemented for `[NonPacked]` + | + = help: the following other types implement trait `Encode`: + [T; N] + [T] + = note: required because of the requirements on the impl of `Encode` for `Vec` + = note: required because of the requirements on the impl of `Packed` for `Vec` + = note: required because of the requirements on the impl of `StorableHint<()>` for `Vec` + = note: required because of the requirements on the impl of `AutoStorableHint>` for `Vec` + +error[E0277]: the trait bound `Vec: parity_scale_codec::Decode` is not satisfied + --> tests/ui/storage_item/fail/collections_only_packed_1.rs:9:1 + | +9 | #[ink::storage_item] + | ^^^^^^^^^^^^^^^^^^^^ the trait `parity_scale_codec::Decode` is not implemented for `Vec` + | + = help: the trait `parity_scale_codec::Decode` is implemented for `Vec` + = note: required because of the requirements on the impl of `Packed` for `Vec` + = note: required because of the requirements on the impl of `StorableHint<()>` for `Vec` + = note: required because of the requirements on the impl of `AutoStorableHint>` for `Vec` +note: required because it appears within the type `Contract` + --> tests/ui/storage_item/fail/collections_only_packed_1.rs:10:8 + | +10 | struct Contract { + | ^^^^^^^^ +note: required by a bound in `Storable` + --> $WORKSPACE/crates/storage/traits/src/storage.rs + | + | pub trait Storable: Sized { + | ^^^^^ required by this bound in `Storable` + = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `[NonPacked]: Encode` is not satisfied + --> tests/ui/storage_item/fail/collections_only_packed_1.rs:9:1 + | +9 | #[ink::storage_item] + | ^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `[NonPacked]` + | + = help: the following other types implement trait `Encode`: + [T; N] + [T] + = note: required because of the requirements on the impl of `Encode` for `Vec` + = note: required because of the requirements on the impl of `Packed` for `Vec` + = note: required because of the requirements on the impl of `StorableHint<()>` for `Vec` + = note: required because of the requirements on the impl of `AutoStorableHint>` for `Vec` +note: required because it appears within the type `Contract` + --> tests/ui/storage_item/fail/collections_only_packed_1.rs:10:8 + | +10 | struct Contract { + | ^^^^^^^^ +note: required by a bound in `Storable` + --> $WORKSPACE/crates/storage/traits/src/storage.rs + | + | pub trait Storable: Sized { + | ^^^^^ required by this bound in `Storable` + = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `Vec: parity_scale_codec::Decode` is not satisfied + --> tests/ui/storage_item/fail/collections_only_packed_1.rs:9:1 + | +9 | #[ink::storage_item] + | ^^^^^^^^^^^^^^^^^^^^ the trait `parity_scale_codec::Decode` is not implemented for `Vec` + | + = help: the trait `parity_scale_codec::Decode` is implemented for `Vec` + = note: required because of the requirements on the impl of `Packed` for `Vec` + = note: required because of the requirements on the impl of `StorableHint<()>` for `Vec` + = note: required because of the requirements on the impl of `AutoStorableHint>` for `Vec` +note: required because it appears within the type `Contract` + --> tests/ui/storage_item/fail/collections_only_packed_1.rs:10:8 + | +10 | struct Contract { + | ^^^^^^^^ +note: required by a bound in `Result` + --> $RUST/core/src/result.rs + | + | pub enum Result { + | ^ required by this bound in `Result` + = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `[NonPacked]: Encode` is not satisfied + --> tests/ui/storage_item/fail/collections_only_packed_1.rs:9:1 + | +9 | #[ink::storage_item] + | ^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `[NonPacked]` + | + = help: the following other types implement trait `Encode`: + [T; N] + [T] + = note: required because of the requirements on the impl of `Encode` for `Vec` + = note: required because of the requirements on the impl of `Packed` for `Vec` + = note: required because of the requirements on the impl of `StorableHint<()>` for `Vec` + = note: required because of the requirements on the impl of `AutoStorableHint>` for `Vec` +note: required because it appears within the type `Contract` + --> tests/ui/storage_item/fail/collections_only_packed_1.rs:10:8 + | +10 | struct Contract { + | ^^^^^^^^ +note: required by a bound in `Result` + --> $RUST/core/src/result.rs + | + | pub enum Result { + | ^ required by this bound in `Result` + = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/crates/ink/tests/ui/storage_item/fail/collections_only_packed_2.stderr b/crates/ink/tests/ui/storage_item/fail/collections_only_packed_2.stderr new file mode 100644 index 00000000000..49afbd5933c --- /dev/null +++ b/crates/ink/tests/ui/storage_item/fail/collections_only_packed_2.stderr @@ -0,0 +1,109 @@ +error[E0277]: the trait bound `BTreeMap: parity_scale_codec::Decode` is not satisfied + --> tests/ui/storage_item/fail/collections_only_packed_2.rs:11:8 + | +11 | a: BTreeMap, + | ^^^^^^^^ the trait `parity_scale_codec::Decode` is not implemented for `BTreeMap` + | + = help: the trait `parity_scale_codec::Decode` is implemented for `BTreeMap` + = note: required because of the requirements on the impl of `Packed` for `BTreeMap` + = note: required because of the requirements on the impl of `StorableHint<()>` for `BTreeMap` + = note: required because of the requirements on the impl of `AutoStorableHint>` for `BTreeMap` + +error[E0277]: the trait bound `BTreeMap: Encode` is not satisfied + --> tests/ui/storage_item/fail/collections_only_packed_2.rs:11:8 + | +11 | a: BTreeMap, + | ^^^^^^^^ the trait `Encode` is not implemented for `BTreeMap` + | + = help: the trait `Encode` is implemented for `BTreeMap` + = note: required because of the requirements on the impl of `Packed` for `BTreeMap` + = note: required because of the requirements on the impl of `StorableHint<()>` for `BTreeMap` + = note: required because of the requirements on the impl of `AutoStorableHint>` for `BTreeMap` + +error[E0277]: the trait bound `BTreeMap: parity_scale_codec::Decode` is not satisfied + --> tests/ui/storage_item/fail/collections_only_packed_2.rs:9:1 + | +9 | #[ink::storage_item] + | ^^^^^^^^^^^^^^^^^^^^ the trait `parity_scale_codec::Decode` is not implemented for `BTreeMap` + | + = help: the trait `parity_scale_codec::Decode` is implemented for `BTreeMap` + = note: required because of the requirements on the impl of `Packed` for `BTreeMap` + = note: required because of the requirements on the impl of `StorableHint<()>` for `BTreeMap` + = note: required because of the requirements on the impl of `AutoStorableHint>` for `BTreeMap` +note: required because it appears within the type `Contract` + --> tests/ui/storage_item/fail/collections_only_packed_2.rs:10:8 + | +10 | struct Contract { + | ^^^^^^^^ +note: required by a bound in `Storable` + --> $WORKSPACE/crates/storage/traits/src/storage.rs + | + | pub trait Storable: Sized { + | ^^^^^ required by this bound in `Storable` + = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `BTreeMap: Encode` is not satisfied + --> tests/ui/storage_item/fail/collections_only_packed_2.rs:9:1 + | +9 | #[ink::storage_item] + | ^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `BTreeMap` + | + = help: the trait `Encode` is implemented for `BTreeMap` + = note: required because of the requirements on the impl of `Packed` for `BTreeMap` + = note: required because of the requirements on the impl of `StorableHint<()>` for `BTreeMap` + = note: required because of the requirements on the impl of `AutoStorableHint>` for `BTreeMap` +note: required because it appears within the type `Contract` + --> tests/ui/storage_item/fail/collections_only_packed_2.rs:10:8 + | +10 | struct Contract { + | ^^^^^^^^ +note: required by a bound in `Storable` + --> $WORKSPACE/crates/storage/traits/src/storage.rs + | + | pub trait Storable: Sized { + | ^^^^^ required by this bound in `Storable` + = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `BTreeMap: parity_scale_codec::Decode` is not satisfied + --> tests/ui/storage_item/fail/collections_only_packed_2.rs:9:1 + | +9 | #[ink::storage_item] + | ^^^^^^^^^^^^^^^^^^^^ the trait `parity_scale_codec::Decode` is not implemented for `BTreeMap` + | + = help: the trait `parity_scale_codec::Decode` is implemented for `BTreeMap` + = note: required because of the requirements on the impl of `Packed` for `BTreeMap` + = note: required because of the requirements on the impl of `StorableHint<()>` for `BTreeMap` + = note: required because of the requirements on the impl of `AutoStorableHint>` for `BTreeMap` +note: required because it appears within the type `Contract` + --> tests/ui/storage_item/fail/collections_only_packed_2.rs:10:8 + | +10 | struct Contract { + | ^^^^^^^^ +note: required by a bound in `Result` + --> $RUST/core/src/result.rs + | + | pub enum Result { + | ^ required by this bound in `Result` + = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `BTreeMap: Encode` is not satisfied + --> tests/ui/storage_item/fail/collections_only_packed_2.rs:9:1 + | +9 | #[ink::storage_item] + | ^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `BTreeMap` + | + = help: the trait `Encode` is implemented for `BTreeMap` + = note: required because of the requirements on the impl of `Packed` for `BTreeMap` + = note: required because of the requirements on the impl of `StorableHint<()>` for `BTreeMap` + = note: required because of the requirements on the impl of `AutoStorableHint>` for `BTreeMap` +note: required because it appears within the type `Contract` + --> tests/ui/storage_item/fail/collections_only_packed_2.rs:10:8 + | +10 | struct Contract { + | ^^^^^^^^ +note: required by a bound in `Result` + --> $RUST/core/src/result.rs + | + | pub enum Result { + | ^ required by this bound in `Result` + = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) 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 f33a62ce9ad..d40b1e6fc2a 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,3 +1,4 @@ +<<<<<<< HEAD:crates/lang/tests/ui/contract/fail/event-too-many-topics-anonymous.stderr 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 | @@ -9,16 +10,23 @@ error[E0277]: the trait bound `EventTopics<4_usize>: RespectTopicLimit<2_usize>` 34 | | arg_4: i32, 35 | | } | |_____^ the trait `RespectTopicLimit<2_usize>` is not implemented for `EventTopics<4_usize>` +======= +error[E0277]: the trait bound `EventTopics<4>: RespectTopicLimit<2>` is not satisfied + --> tests/ui/contract/fail/event-too-many-topics-anonymous.rs:25:5 + | +25 | pub struct Event { + | ^^^ the trait `RespectTopicLimit<2>` is not implemented for `EventTopics<4>` +>>>>>>> 9fe9a4224... Fix UI tests for latest stable `1.64` (#1416):crates/ink/tests/ui/contract/fail/event-too-many-topics-anonymous.stderr | = help: the following other types implement trait `RespectTopicLimit`: - 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>> + as RespectTopicLimit<0>> + as RespectTopicLimit<10>> + as RespectTopicLimit<11>> + as RespectTopicLimit<12>> + as RespectTopicLimit<1>> + as RespectTopicLimit<2>> + as RespectTopicLimit<3>> + as RespectTopicLimit<4>> 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 390b822b341..f651c3dd3ed 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,3 +1,4 @@ +<<<<<<< HEAD:crates/lang/tests/ui/contract/fail/event-too-many-topics.stderr 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 | @@ -9,16 +10,23 @@ error[E0277]: the trait bound `EventTopics<3_usize>: RespectTopicLimit<2_usize>` 32 | | arg_3: i32, 33 | | } | |_____^ the trait `RespectTopicLimit<2_usize>` is not implemented for `EventTopics<3_usize>` +======= +error[E0277]: the trait bound `EventTopics<3>: RespectTopicLimit<2>` is not satisfied + --> tests/ui/contract/fail/event-too-many-topics.rs:25:5 + | +25 | pub struct Event { + | ^^^ the trait `RespectTopicLimit<2>` is not implemented for `EventTopics<3>` +>>>>>>> 9fe9a4224... Fix UI tests for latest stable `1.64` (#1416):crates/ink/tests/ui/contract/fail/event-too-many-topics.stderr | = help: the following other types implement trait `RespectTopicLimit`: - 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>> + as RespectTopicLimit<0>> + as RespectTopicLimit<10>> + as RespectTopicLimit<11>> + as RespectTopicLimit<12>> + as RespectTopicLimit<1>> + as RespectTopicLimit<2>> + as RespectTopicLimit<3>> + as RespectTopicLimit<4>> 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 50d787d6130..bc8e21612c6 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 @@ -10,8 +10,13 @@ error[E0308]: mismatched types error[E0599]: no function or associated item named `constructor_2` found for struct `Contract` in the current scope --> tests/ui/contract/fail/impl-block-for-non-storage-01.rs:22:16 | +<<<<<<< HEAD:crates/lang/tests/ui/contract/fail/impl-block-for-non-storage-01.stderr 6 | pub struct Contract {} | ------------------- function or associated item `constructor_2` not found for this +======= +4 | pub struct Contract {} + | --- function or associated item `constructor_2` not found for this struct +>>>>>>> 9fe9a4224... Fix UI tests for latest stable `1.64` (#1416):crates/ink/tests/ui/contract/fail/impl-block-for-non-storage-01.stderr ... 22 | pub fn constructor_2() -> Self { | ^^^^^^^^^^^^^ @@ -22,8 +27,13 @@ error[E0599]: no function or associated item named `constructor_2` found for str error[E0599]: no function or associated item named `message_2` found for struct `Contract` in the current scope --> tests/ui/contract/fail/impl-block-for-non-storage-01.rs:27:16 | +<<<<<<< HEAD:crates/lang/tests/ui/contract/fail/impl-block-for-non-storage-01.stderr 6 | pub struct Contract {} | ------------------- function or associated item `message_2` not found for this +======= +4 | pub struct Contract {} + | --- function or associated item `message_2` not found for this struct +>>>>>>> 9fe9a4224... Fix UI tests for latest stable `1.64` (#1416):crates/ink/tests/ui/contract/fail/impl-block-for-non-storage-01.stderr ... 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 de2a07cc208..4a76e0b158a 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 @@ -1,8 +1,13 @@ error[E0599]: no function or associated item named `env` found for struct `Contract` in the current scope --> tests/ui/contract/fail/impl-block-using-static-env-no-marker.rs:22:27 | +<<<<<<< HEAD:crates/lang/tests/ui/contract/fail/impl-block-using-static-env-no-marker.stderr 6 | pub struct Contract {} | ------------------- function or associated item `env` not found for this +======= +4 | pub struct Contract {} + | --- function or associated item `env` not found for this struct +>>>>>>> 9fe9a4224... Fix UI tests for latest stable `1.64` (#1416):crates/ink/tests/ui/contract/fail/impl-block-using-static-env-no-marker.stderr ... 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 e4eb2a04588..a48ab9c4ab1 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 @@ -49,8 +49,13 @@ note: required by a bound in `return_value` error[E0599]: the method `fire` exists for struct `ink_env::call::CallBuilder>, Set>>, Set>>`, but its trait bounds were not satisfied --> tests/ui/contract/fail/message-returns-non-codec.rs:18:9 | +<<<<<<< HEAD:crates/lang/tests/ui/contract/fail/message-returns-non-codec.stderr 6 | pub struct NonCodecType; | ------------------------ doesn't satisfy `NonCodecType: parity_scale_codec::Decode` +======= +4 | pub struct NonCodecType; + | ----------------------- doesn't satisfy `NonCodecType: parity_scale_codec::Decode` +>>>>>>> 9fe9a4224... Fix UI tests for latest stable `1.64` (#1416):crates/ink/tests/ui/contract/fail/message-returns-non-codec.stderr ... 18 | / pub fn message(&self) -> NonCodecType { 19 | | NonCodecType @@ -62,11 +67,5 @@ error[E0599]: the method `fire` exists for struct `ink_env::call::CallBuilder $CARGO/parity-scale-codec-3.1.5/src/codec.rs | - | / pub trait Decode: Sized { - | | // !INTERNAL USE ONLY! - | | // This const helps SCALE to optimize the encoding/decoding by doing fake specialization. - | | #[doc(hidden)] -... | - | | } - | | } - | |_^ + | pub trait Decode: Sized { + | ^^^^^^^^^^^^^^^^^^^^^^^ 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 5e93d3f7594..ab366b9ec2c 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 @@ -1,8 +1,13 @@ error[E0308]: mismatched types --> tests/ui/contract/fail/trait-message-selector-mismatch.rs:25:9 | +<<<<<<< HEAD:crates/lang/tests/ui/contract/fail/trait-message-selector-mismatch.stderr 25 | fn message(&self) {} | ^^^^^^^^^^^^^^^^^^^^ expected `1_u32`, found `2_u32` +======= +23 | fn message(&self) {} + | ^^ expected `1`, found `2` +>>>>>>> 9fe9a4224... Fix UI tests for latest stable `1.64` (#1416):crates/ink/tests/ui/contract/fail/trait-message-selector-mismatch.stderr | - = note: expected struct `TraitMessageSelector<1_u32>` - found struct `TraitMessageSelector<2_u32>` + = note: expected struct `TraitMessageSelector<1>` + found struct `TraitMessageSelector<2>` 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 76c2ef384b4..de3f611b91e 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 @@ -24,8 +24,13 @@ note: required by a bound in `DispatchOutput` error[E0599]: the method `fire` exists for struct `CallBuilder>, Set>>, Set>>`, but its trait bounds were not satisfied --> tests/ui/trait_def/fail/message_output_non_codec.rs:7:5 | +<<<<<<< HEAD:crates/lang/tests/ui/trait_def/fail/message_output_non_codec.stderr 3 | pub struct NonCodec; | -------------------- doesn't satisfy `NonCodec: parity_scale_codec::Decode` +======= +1 | pub struct NonCodec; + | ------------------- doesn't satisfy `NonCodec: parity_scale_codec::Decode` +>>>>>>> 9fe9a4224... Fix UI tests for latest stable `1.64` (#1416):crates/ink/tests/ui/trait_def/fail/message_output_non_codec.stderr ... 7 | / #[ink(message)] 8 | | fn message(&self) -> NonCodec; @@ -36,11 +41,5 @@ error[E0599]: the method `fire` exists for struct `CallBuilder>, note: the following trait must be implemented --> $CARGO/parity-scale-codec-3.1.5/src/codec.rs | - | / pub trait Decode: Sized { - | | // !INTERNAL USE ONLY! - | | // This const helps SCALE to optimize the encoding/decoding by doing fake specialization. - | | #[doc(hidden)] -... | - | | } - | | } - | |_^ + | pub trait Decode: Sized { + | ^^^^^^^^^^^^^^^^^^^^^^^ From 9254b772316e08597cce54027b25000a2b830e32 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Tue, 18 Oct 2022 15:43:36 +0300 Subject: [PATCH 4/6] fix tests --- .../fail/constructor-self-receiver-03.stderr | 35 ------ .../trait-message-selector-overlap-1.stderr | 17 --- .../trait-message-selector-overlap-2.stderr | 17 --- .../trait-message-selector-overlap-3.stderr | 17 --- .../fail/collections_only_packed_1.stderr | 118 ------------------ .../fail/collections_only_packed_2.stderr | 109 ---------------- .../fail/constructor-input-non-codec.stderr | 14 +-- ...tructor-multiple-wildcard-selectors.stderr | 12 +- ...ctor-selector-and-wildcard-selector.stderr | 4 +- .../fail/constructor-self-receiver-03.stderr | 33 +++-- .../event-too-many-topics-anonymous.stderr | 18 +-- .../fail/event-too-many-topics.stderr | 18 +-- .../fail/impl-block-for-non-storage-01.stderr | 10 -- .../impl-block-namespace-invalid-type.stderr | 2 +- ...pl-block-using-static-env-no-marker.stderr | 5 - .../fail/message-input-non-codec.stderr | 8 +- ...message-multiple-wildcard-selectors.stderr | 4 +- .../fail/message-returns-non-codec.stderr | 21 +--- ...sage-selector-and-wildcard-selector.stderr | 4 +- .../message-selector-invalid-type-01.stderr | 2 +- .../message-selector-invalid-type-02.stderr | 2 +- .../message-self-receiver-invalid-01.stderr | 2 +- .../message-self-receiver-invalid-02.stderr | 2 +- .../fail/message-self-receiver-missing.stderr | 5 +- .../fail/module-missing-constructor.stderr | 14 +-- .../fail/module-missing-message.stderr | 14 +-- .../fail/module-missing-storage.stderr | 14 +-- .../fail/module-multiple-storages.stderr | 18 +-- .../fail/trait-impl-namespace-invalid.stderr | 8 +- .../trait-message-payable-mismatch.stderr | 2 +- .../trait-message-selector-mismatch.stderr | 5 - .../trait-message-selector-overlap-1.stderr | 12 +- .../trait-message-selector-overlap-2.stderr | 12 +- .../trait-message-selector-overlap-3.stderr | 12 +- .../trait-message-wildcard-selector.stderr | 4 +- .../ui/pay_with_call/pass/multiple_args.rs | 10 +- .../fail/definition_constructor.stderr | 5 +- .../ui/trait_def/fail/definition_empty.stderr | 2 +- .../fail/message_input_non_codec.stderr | 16 ++- .../fail/message_output_non_codec.stderr | 14 +-- .../fail/message_selector_invalid_1.stderr | 2 +- 41 files changed, 124 insertions(+), 519 deletions(-) delete mode 100644 crates/ink/tests/ui/contract/fail/constructor-self-receiver-03.stderr delete mode 100644 crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-1.stderr delete mode 100644 crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-2.stderr delete mode 100644 crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-3.stderr delete mode 100644 crates/ink/tests/ui/storage_item/fail/collections_only_packed_1.stderr delete mode 100644 crates/ink/tests/ui/storage_item/fail/collections_only_packed_2.stderr diff --git a/crates/ink/tests/ui/contract/fail/constructor-self-receiver-03.stderr b/crates/ink/tests/ui/contract/fail/constructor-self-receiver-03.stderr deleted file mode 100644 index e836a609d24..00000000000 --- a/crates/ink/tests/ui/contract/fail/constructor-self-receiver-03.stderr +++ /dev/null @@ -1,35 +0,0 @@ -error[E0637]: `&` without an explicit lifetime name cannot be used here - --> tests/ui/contract/fail/constructor-self-receiver-03.rs:8:34 - | -8 | 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:8:35 - | -4 | pub struct Contract {} - | --- `Self` not allowed in a constant item -... -8 | 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:8:35 - | -1 | #[ink::contract] - | ---------------- `Self` not allowed in a function -... -8 | 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:8:9 - | -8 | pub fn constructor(this: &Self) -> Self { - | ^^^ the trait `WrapperTypeDecode` is not implemented for `&'static Contract` - | - = 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` diff --git a/crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-1.stderr b/crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-1.stderr deleted file mode 100644 index 9d94b80f2b7..00000000000 --- a/crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-1.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0119]: conflicting implementations of trait `ink::reflect::DispatchableMessageInfo<1083895717>` for type `contract::Contract` - --> tests/ui/contract/fail/trait-message-selector-overlap-1.rs:41:9 - | -36 | fn message(&self) {} - | -- first implementation here -... -41 | fn message(&self) {} - | ^^ conflicting implementation for `contract::Contract` - -error[E0119]: conflicting implementations of trait `ink::codegen::TraitCallForwarderFor<1083895717>` for type `contract::_::CallBuilder` - --> tests/ui/contract/fail/trait-message-selector-overlap-1.rs:39:5 - | -34 | impl TraitDefinition1 for Contract { - | ---- first implementation here -... -39 | impl TraitDefinition2 for Contract { - | ^^^^ conflicting implementation for `contract::_::CallBuilder` diff --git a/crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-2.stderr b/crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-2.stderr deleted file mode 100644 index dcfcb832bfc..00000000000 --- a/crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-2.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0119]: conflicting implementations of trait `ink::reflect::DispatchableMessageInfo<1518209067>` for type `contract::Contract` - --> tests/ui/contract/fail/trait-message-selector-overlap-2.rs:41:9 - | -36 | fn message(&self) {} - | -- first implementation here -... -41 | fn message(&self) {} - | ^^ conflicting implementation for `contract::Contract` - -error[E0119]: conflicting implementations of trait `ink::codegen::TraitCallForwarderFor<1518209067>` for type `contract::_::CallBuilder` - --> tests/ui/contract/fail/trait-message-selector-overlap-2.rs:39:5 - | -34 | impl TraitDefinition1 for Contract { - | ---- first implementation here -... -39 | impl TraitDefinition2 for Contract { - | ^^^^ conflicting implementation for `contract::_::CallBuilder` diff --git a/crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-3.stderr b/crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-3.stderr deleted file mode 100644 index 27a02c68329..00000000000 --- a/crates/ink/tests/ui/contract/fail/trait-message-selector-overlap-3.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0119]: conflicting implementations of trait `ink::reflect::DispatchableMessageInfo<42>` for type `contract::Contract` - --> tests/ui/contract/fail/trait-message-selector-overlap-3.rs:41:9 - | -36 | fn message1(&self) {} - | -- first implementation here -... -41 | fn message2(&self) {} - | ^^ conflicting implementation for `contract::Contract` - -error[E0119]: conflicting implementations of trait `ink::codegen::TraitCallForwarderFor<42>` for type `contract::_::CallBuilder` - --> tests/ui/contract/fail/trait-message-selector-overlap-3.rs:39:5 - | -34 | impl TraitDefinition1 for Contract { - | ---- first implementation here -... -39 | impl TraitDefinition2 for Contract { - | ^^^^ conflicting implementation for `contract::_::CallBuilder` diff --git a/crates/ink/tests/ui/storage_item/fail/collections_only_packed_1.stderr b/crates/ink/tests/ui/storage_item/fail/collections_only_packed_1.stderr deleted file mode 100644 index 9c68f5283b8..00000000000 --- a/crates/ink/tests/ui/storage_item/fail/collections_only_packed_1.stderr +++ /dev/null @@ -1,118 +0,0 @@ -error[E0277]: the trait bound `Vec: parity_scale_codec::Decode` is not satisfied - --> tests/ui/storage_item/fail/collections_only_packed_1.rs:11:8 - | -11 | a: Vec, - | ^^^ the trait `parity_scale_codec::Decode` is not implemented for `Vec` - | - = help: the trait `parity_scale_codec::Decode` is implemented for `Vec` - = note: required because of the requirements on the impl of `Packed` for `Vec` - = note: required because of the requirements on the impl of `StorableHint<()>` for `Vec` - = note: required because of the requirements on the impl of `AutoStorableHint>` for `Vec` - -error[E0277]: the trait bound `[NonPacked]: Encode` is not satisfied - --> tests/ui/storage_item/fail/collections_only_packed_1.rs:11:8 - | -11 | a: Vec, - | ^^^ the trait `Encode` is not implemented for `[NonPacked]` - | - = help: the following other types implement trait `Encode`: - [T; N] - [T] - = note: required because of the requirements on the impl of `Encode` for `Vec` - = note: required because of the requirements on the impl of `Packed` for `Vec` - = note: required because of the requirements on the impl of `StorableHint<()>` for `Vec` - = note: required because of the requirements on the impl of `AutoStorableHint>` for `Vec` - -error[E0277]: the trait bound `Vec: parity_scale_codec::Decode` is not satisfied - --> tests/ui/storage_item/fail/collections_only_packed_1.rs:9:1 - | -9 | #[ink::storage_item] - | ^^^^^^^^^^^^^^^^^^^^ the trait `parity_scale_codec::Decode` is not implemented for `Vec` - | - = help: the trait `parity_scale_codec::Decode` is implemented for `Vec` - = note: required because of the requirements on the impl of `Packed` for `Vec` - = note: required because of the requirements on the impl of `StorableHint<()>` for `Vec` - = note: required because of the requirements on the impl of `AutoStorableHint>` for `Vec` -note: required because it appears within the type `Contract` - --> tests/ui/storage_item/fail/collections_only_packed_1.rs:10:8 - | -10 | struct Contract { - | ^^^^^^^^ -note: required by a bound in `Storable` - --> $WORKSPACE/crates/storage/traits/src/storage.rs - | - | pub trait Storable: Sized { - | ^^^^^ required by this bound in `Storable` - = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the trait bound `[NonPacked]: Encode` is not satisfied - --> tests/ui/storage_item/fail/collections_only_packed_1.rs:9:1 - | -9 | #[ink::storage_item] - | ^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `[NonPacked]` - | - = help: the following other types implement trait `Encode`: - [T; N] - [T] - = note: required because of the requirements on the impl of `Encode` for `Vec` - = note: required because of the requirements on the impl of `Packed` for `Vec` - = note: required because of the requirements on the impl of `StorableHint<()>` for `Vec` - = note: required because of the requirements on the impl of `AutoStorableHint>` for `Vec` -note: required because it appears within the type `Contract` - --> tests/ui/storage_item/fail/collections_only_packed_1.rs:10:8 - | -10 | struct Contract { - | ^^^^^^^^ -note: required by a bound in `Storable` - --> $WORKSPACE/crates/storage/traits/src/storage.rs - | - | pub trait Storable: Sized { - | ^^^^^ required by this bound in `Storable` - = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the trait bound `Vec: parity_scale_codec::Decode` is not satisfied - --> tests/ui/storage_item/fail/collections_only_packed_1.rs:9:1 - | -9 | #[ink::storage_item] - | ^^^^^^^^^^^^^^^^^^^^ the trait `parity_scale_codec::Decode` is not implemented for `Vec` - | - = help: the trait `parity_scale_codec::Decode` is implemented for `Vec` - = note: required because of the requirements on the impl of `Packed` for `Vec` - = note: required because of the requirements on the impl of `StorableHint<()>` for `Vec` - = note: required because of the requirements on the impl of `AutoStorableHint>` for `Vec` -note: required because it appears within the type `Contract` - --> tests/ui/storage_item/fail/collections_only_packed_1.rs:10:8 - | -10 | struct Contract { - | ^^^^^^^^ -note: required by a bound in `Result` - --> $RUST/core/src/result.rs - | - | pub enum Result { - | ^ required by this bound in `Result` - = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the trait bound `[NonPacked]: Encode` is not satisfied - --> tests/ui/storage_item/fail/collections_only_packed_1.rs:9:1 - | -9 | #[ink::storage_item] - | ^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `[NonPacked]` - | - = help: the following other types implement trait `Encode`: - [T; N] - [T] - = note: required because of the requirements on the impl of `Encode` for `Vec` - = note: required because of the requirements on the impl of `Packed` for `Vec` - = note: required because of the requirements on the impl of `StorableHint<()>` for `Vec` - = note: required because of the requirements on the impl of `AutoStorableHint>` for `Vec` -note: required because it appears within the type `Contract` - --> tests/ui/storage_item/fail/collections_only_packed_1.rs:10:8 - | -10 | struct Contract { - | ^^^^^^^^ -note: required by a bound in `Result` - --> $RUST/core/src/result.rs - | - | pub enum Result { - | ^ required by this bound in `Result` - = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/crates/ink/tests/ui/storage_item/fail/collections_only_packed_2.stderr b/crates/ink/tests/ui/storage_item/fail/collections_only_packed_2.stderr deleted file mode 100644 index 49afbd5933c..00000000000 --- a/crates/ink/tests/ui/storage_item/fail/collections_only_packed_2.stderr +++ /dev/null @@ -1,109 +0,0 @@ -error[E0277]: the trait bound `BTreeMap: parity_scale_codec::Decode` is not satisfied - --> tests/ui/storage_item/fail/collections_only_packed_2.rs:11:8 - | -11 | a: BTreeMap, - | ^^^^^^^^ the trait `parity_scale_codec::Decode` is not implemented for `BTreeMap` - | - = help: the trait `parity_scale_codec::Decode` is implemented for `BTreeMap` - = note: required because of the requirements on the impl of `Packed` for `BTreeMap` - = note: required because of the requirements on the impl of `StorableHint<()>` for `BTreeMap` - = note: required because of the requirements on the impl of `AutoStorableHint>` for `BTreeMap` - -error[E0277]: the trait bound `BTreeMap: Encode` is not satisfied - --> tests/ui/storage_item/fail/collections_only_packed_2.rs:11:8 - | -11 | a: BTreeMap, - | ^^^^^^^^ the trait `Encode` is not implemented for `BTreeMap` - | - = help: the trait `Encode` is implemented for `BTreeMap` - = note: required because of the requirements on the impl of `Packed` for `BTreeMap` - = note: required because of the requirements on the impl of `StorableHint<()>` for `BTreeMap` - = note: required because of the requirements on the impl of `AutoStorableHint>` for `BTreeMap` - -error[E0277]: the trait bound `BTreeMap: parity_scale_codec::Decode` is not satisfied - --> tests/ui/storage_item/fail/collections_only_packed_2.rs:9:1 - | -9 | #[ink::storage_item] - | ^^^^^^^^^^^^^^^^^^^^ the trait `parity_scale_codec::Decode` is not implemented for `BTreeMap` - | - = help: the trait `parity_scale_codec::Decode` is implemented for `BTreeMap` - = note: required because of the requirements on the impl of `Packed` for `BTreeMap` - = note: required because of the requirements on the impl of `StorableHint<()>` for `BTreeMap` - = note: required because of the requirements on the impl of `AutoStorableHint>` for `BTreeMap` -note: required because it appears within the type `Contract` - --> tests/ui/storage_item/fail/collections_only_packed_2.rs:10:8 - | -10 | struct Contract { - | ^^^^^^^^ -note: required by a bound in `Storable` - --> $WORKSPACE/crates/storage/traits/src/storage.rs - | - | pub trait Storable: Sized { - | ^^^^^ required by this bound in `Storable` - = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the trait bound `BTreeMap: Encode` is not satisfied - --> tests/ui/storage_item/fail/collections_only_packed_2.rs:9:1 - | -9 | #[ink::storage_item] - | ^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `BTreeMap` - | - = help: the trait `Encode` is implemented for `BTreeMap` - = note: required because of the requirements on the impl of `Packed` for `BTreeMap` - = note: required because of the requirements on the impl of `StorableHint<()>` for `BTreeMap` - = note: required because of the requirements on the impl of `AutoStorableHint>` for `BTreeMap` -note: required because it appears within the type `Contract` - --> tests/ui/storage_item/fail/collections_only_packed_2.rs:10:8 - | -10 | struct Contract { - | ^^^^^^^^ -note: required by a bound in `Storable` - --> $WORKSPACE/crates/storage/traits/src/storage.rs - | - | pub trait Storable: Sized { - | ^^^^^ required by this bound in `Storable` - = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the trait bound `BTreeMap: parity_scale_codec::Decode` is not satisfied - --> tests/ui/storage_item/fail/collections_only_packed_2.rs:9:1 - | -9 | #[ink::storage_item] - | ^^^^^^^^^^^^^^^^^^^^ the trait `parity_scale_codec::Decode` is not implemented for `BTreeMap` - | - = help: the trait `parity_scale_codec::Decode` is implemented for `BTreeMap` - = note: required because of the requirements on the impl of `Packed` for `BTreeMap` - = note: required because of the requirements on the impl of `StorableHint<()>` for `BTreeMap` - = note: required because of the requirements on the impl of `AutoStorableHint>` for `BTreeMap` -note: required because it appears within the type `Contract` - --> tests/ui/storage_item/fail/collections_only_packed_2.rs:10:8 - | -10 | struct Contract { - | ^^^^^^^^ -note: required by a bound in `Result` - --> $RUST/core/src/result.rs - | - | pub enum Result { - | ^ required by this bound in `Result` - = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the trait bound `BTreeMap: Encode` is not satisfied - --> tests/ui/storage_item/fail/collections_only_packed_2.rs:9:1 - | -9 | #[ink::storage_item] - | ^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `BTreeMap` - | - = help: the trait `Encode` is implemented for `BTreeMap` - = note: required because of the requirements on the impl of `Packed` for `BTreeMap` - = note: required because of the requirements on the impl of `StorableHint<()>` for `BTreeMap` - = note: required because of the requirements on the impl of `AutoStorableHint>` for `BTreeMap` -note: required because it appears within the type `Contract` - --> tests/ui/storage_item/fail/collections_only_packed_2.rs:10:8 - | -10 | struct Contract { - | ^^^^^^^^ -note: required by a bound in `Result` - --> $RUST/core/src/result.rs - | - | pub enum Result { - | ^ required by this bound in `Result` - = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/crates/lang/tests/ui/contract/fail/constructor-input-non-codec.stderr b/crates/lang/tests/ui/contract/fail/constructor-input-non-codec.stderr index 11181e8168f..dd654902eac 100644 --- a/crates/lang/tests/ui/contract/fail/constructor-input-non-codec.stderr +++ b/crates/lang/tests/ui/contract/fail/constructor-input-non-codec.stderr @@ -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 @@ -18,10 +18,8 @@ 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 @@ -32,10 +30,8 @@ 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 { -14 | | Self {} -15 | | } - | |_________^ the trait `WrapperTypeEncode` is not implemented for `NonCodecType` +13 | pub fn constructor(_input: NonCodecType) -> Self { + | ^^^ the trait `WrapperTypeEncode` is not implemented for `NonCodecType` | = help: the following other types implement trait `WrapperTypeEncode`: &T diff --git a/crates/lang/tests/ui/contract/fail/constructor-multiple-wildcard-selectors.stderr b/crates/lang/tests/ui/contract/fail/constructor-multiple-wildcard-selectors.stderr index 658bd706146..229b3749d48 100644 --- a/crates/lang/tests/ui/contract/fail/constructor-multiple-wildcard-selectors.stderr +++ b/crates/lang/tests/ui/contract/fail/constructor-multiple-wildcard-selectors.stderr @@ -1,15 +1,11 @@ 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 { + | ^^^ diff --git a/crates/lang/tests/ui/contract/fail/constructor-selector-and-wildcard-selector.stderr b/crates/lang/tests/ui/contract/fail/constructor-selector-and-wildcard-selector.stderr index 9c2c985c235..fb79614beb0 100644 --- a/crates/lang/tests/ui/contract/fail/constructor-selector-and-wildcard-selector.stderr +++ b/crates/lang/tests/ui/contract/fail/constructor-selector-and-wildcard-selector.stderr @@ -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 = _)] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ 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 30cdf70f020..baba8081131 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,18 +1,35 @@ +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[E0106]: missing lifetime specifier - --> tests/ui/contract/fail/constructor-self-receiver-03.rs:10:34 +error[E0411]: cannot find type `Self` in this scope + --> tests/ui/contract/fail/constructor-self-receiver-03.rs:10:35 | +3 | #[ink::contract] + | ---------------- `Self` not allowed in a function +... 10 | pub fn constructor(this: &Self) -> Self { - | ^ expected named lifetime parameter - | -help: consider introducing a named lifetime parameter + | ^^^^ `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 | -10 ~ pub fn constructor(this: &'a Self) -> Self { -11 | Self {} -12 ~ }<'a> +10 | pub fn constructor(this: &Self) -> Self { + | ^^^ the trait `WrapperTypeDecode` is not implemented for `&'static Contract` | + = 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` 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 d40b1e6fc2a..d3a3e05ccb9 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,22 +1,8 @@ -<<<<<<< HEAD:crates/lang/tests/ui/contract/fail/event-too-many-topics-anonymous.stderr -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_usize>` is not implemented for `EventTopics<4_usize>` -======= error[E0277]: the trait bound `EventTopics<4>: RespectTopicLimit<2>` is not satisfied - --> tests/ui/contract/fail/event-too-many-topics-anonymous.rs:25:5 + --> tests/ui/contract/fail/event-too-many-topics-anonymous.rs:26:5 | -25 | pub struct Event { +26 | pub struct Event { | ^^^ the trait `RespectTopicLimit<2>` is not implemented for `EventTopics<4>` ->>>>>>> 9fe9a4224... Fix UI tests for latest stable `1.64` (#1416):crates/ink/tests/ui/contract/fail/event-too-many-topics-anonymous.stderr | = help: the following other types implement trait `RespectTopicLimit`: as RespectTopicLimit<0>> 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 f651c3dd3ed..bde29e339e4 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,22 +1,8 @@ -<<<<<<< HEAD:crates/lang/tests/ui/contract/fail/event-too-many-topics.stderr -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_usize>` is not implemented for `EventTopics<3_usize>` -======= error[E0277]: the trait bound `EventTopics<3>: RespectTopicLimit<2>` is not satisfied - --> tests/ui/contract/fail/event-too-many-topics.rs:25:5 + --> tests/ui/contract/fail/event-too-many-topics.rs:26:5 | -25 | pub struct Event { +26 | pub struct Event { | ^^^ the trait `RespectTopicLimit<2>` is not implemented for `EventTopics<3>` ->>>>>>> 9fe9a4224... Fix UI tests for latest stable `1.64` (#1416):crates/ink/tests/ui/contract/fail/event-too-many-topics.stderr | = help: the following other types implement trait `RespectTopicLimit`: as RespectTopicLimit<0>> 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 bc8e21612c6..3474fc5b664 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 @@ -10,13 +10,8 @@ error[E0308]: mismatched types error[E0599]: no function or associated item named `constructor_2` found for struct `Contract` in the current scope --> tests/ui/contract/fail/impl-block-for-non-storage-01.rs:22:16 | -<<<<<<< HEAD:crates/lang/tests/ui/contract/fail/impl-block-for-non-storage-01.stderr 6 | pub struct Contract {} - | ------------------- function or associated item `constructor_2` not found for this -======= -4 | pub struct Contract {} | --- function or associated item `constructor_2` not found for this struct ->>>>>>> 9fe9a4224... Fix UI tests for latest stable `1.64` (#1416):crates/ink/tests/ui/contract/fail/impl-block-for-non-storage-01.stderr ... 22 | pub fn constructor_2() -> Self { | ^^^^^^^^^^^^^ @@ -27,13 +22,8 @@ error[E0599]: no function or associated item named `constructor_2` found for str error[E0599]: no function or associated item named `message_2` found for struct `Contract` in the current scope --> tests/ui/contract/fail/impl-block-for-non-storage-01.rs:27:16 | -<<<<<<< HEAD:crates/lang/tests/ui/contract/fail/impl-block-for-non-storage-01.stderr 6 | pub struct Contract {} - | ------------------- function or associated item `message_2` not found for this -======= -4 | pub struct Contract {} | --- function or associated item `message_2` not found for this struct ->>>>>>> 9fe9a4224... Fix UI tests for latest stable `1.64` (#1416):crates/ink/tests/ui/contract/fail/impl-block-for-non-storage-01.stderr ... 27 | pub fn message_2(&self) {} | ^^^^^^^^^ diff --git a/crates/lang/tests/ui/contract/fail/impl-block-namespace-invalid-type.stderr b/crates/lang/tests/ui/contract/fail/impl-block-namespace-invalid-type.stderr index a6014a9e97b..0f34c5f10e7 100644 --- a/crates/lang/tests/ui/contract/fail/impl-block-namespace-invalid-type.stderr +++ b/crates/lang/tests/ui/contract/fail/impl-block-namespace-invalid-type.stderr @@ -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)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ 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 4a76e0b158a..a3f7c18ee82 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 @@ -1,13 +1,8 @@ error[E0599]: no function or associated item named `env` found for struct `Contract` in the current scope --> tests/ui/contract/fail/impl-block-using-static-env-no-marker.rs:22:27 | -<<<<<<< HEAD:crates/lang/tests/ui/contract/fail/impl-block-using-static-env-no-marker.stderr 6 | pub struct Contract {} - | ------------------- function or associated item `env` not found for this -======= -4 | pub struct Contract {} | --- function or associated item `env` not found for this struct ->>>>>>> 9fe9a4224... Fix UI tests for latest stable `1.64` (#1416):crates/ink/tests/ui/contract/fail/impl-block-using-static-env-no-marker.stderr ... 22 | let _ = Self::env().caller(); | ^^^ function or associated item not found in `Contract` diff --git a/crates/lang/tests/ui/contract/fail/message-input-non-codec.stderr b/crates/lang/tests/ui/contract/fail/message-input-non-codec.stderr index 360b344495d..966210367c2 100644 --- a/crates/lang/tests/ui/contract/fail/message-input-non-codec.stderr +++ b/crates/lang/tests/ui/contract/fail/message-input-non-codec.stderr @@ -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 @@ -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 @@ -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 @@ -54,7 +54,7 @@ error[E0599]: the method `fire` exists for struct `ink_env::call::CallBuilder 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>, Set, ArgumentList>>>, Set>>` due to unsatisfied trait bounds + | ^^^ method cannot be called on `ink_env::call::CallBuilder>, Set, ArgumentList>>>, Set>>` due to unsatisfied trait bounds | ::: $WORKSPACE/crates/env/src/call/execution_input.rs | diff --git a/crates/lang/tests/ui/contract/fail/message-multiple-wildcard-selectors.stderr b/crates/lang/tests/ui/contract/fail/message-multiple-wildcard-selectors.stderr index d063519224f..dad7a2df787 100644 --- a/crates/lang/tests/ui/contract/fail/message-multiple-wildcard-selectors.stderr +++ b/crates/lang/tests/ui/contract/fail/message-multiple-wildcard-selectors.stderr @@ -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) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^ 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 a48ab9c4ab1..098befa790e 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 @@ -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 @@ -49,23 +47,16 @@ note: required by a bound in `return_value` error[E0599]: the method `fire` exists for struct `ink_env::call::CallBuilder>, Set>>, Set>>`, but its trait bounds were not satisfied --> tests/ui/contract/fail/message-returns-non-codec.rs:18:9 | -<<<<<<< HEAD:crates/lang/tests/ui/contract/fail/message-returns-non-codec.stderr -6 | pub struct NonCodecType; - | ------------------------ doesn't satisfy `NonCodecType: parity_scale_codec::Decode` -======= -4 | pub struct NonCodecType; +6 | pub struct NonCodecType; | ----------------------- doesn't satisfy `NonCodecType: parity_scale_codec::Decode` ->>>>>>> 9fe9a4224... Fix UI tests for latest stable `1.64` (#1416):crates/ink/tests/ui/contract/fail/message-returns-non-codec.stderr ... -18 | / pub fn message(&self) -> NonCodecType { -19 | | NonCodecType -20 | | } - | |_________^ method cannot be called on `ink_env::call::CallBuilder>, Set>>, Set>>` due to unsatisfied trait bounds +18 | pub fn message(&self) -> NonCodecType { + | ^^^ method cannot be called on `ink_env::call::CallBuilder>, Set>>, Set>>` 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 + --> $CARGO/parity-scale-codec-3.2.1/src/codec.rs | | pub trait Decode: Sized { | ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/crates/lang/tests/ui/contract/fail/message-selector-and-wildcard-selector.stderr b/crates/lang/tests/ui/contract/fail/message-selector-and-wildcard-selector.stderr index 246e1a606e6..cf79612b7db 100644 --- a/crates/lang/tests/ui/contract/fail/message-selector-and-wildcard-selector.stderr +++ b/crates/lang/tests/ui/contract/fail/message-selector-and-wildcard-selector.stderr @@ -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 = _)] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ diff --git a/crates/lang/tests/ui/contract/fail/message-selector-invalid-type-01.stderr b/crates/lang/tests/ui/contract/fail/message-selector-invalid-type-01.stderr index 91585edc1b0..3660e33fbe2 100644 --- a/crates/lang/tests/ui/contract/fail/message-selector-invalid-type-01.stderr +++ b/crates/lang/tests/ui/contract/fail/message-selector-invalid-type-01.stderr @@ -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")] - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ diff --git a/crates/lang/tests/ui/contract/fail/message-selector-invalid-type-02.stderr b/crates/lang/tests/ui/contract/fail/message-selector-invalid-type-02.stderr index 893067fe7c4..2924628b6fc 100644 --- a/crates/lang/tests/ui/contract/fail/message-selector-invalid-type-02.stderr +++ b/crates/lang/tests/ui/contract/fail/message-selector-invalid-type-02.stderr @@ -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)] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^ diff --git a/crates/lang/tests/ui/contract/fail/message-self-receiver-invalid-01.stderr b/crates/lang/tests/ui/contract/fail/message-self-receiver-invalid-01.stderr index 2f8df8130e3..881158eae5e 100644 --- a/crates/lang/tests/ui/contract/fail/message-self-receiver-invalid-01.stderr +++ b/crates/lang/tests/ui/contract/fail/message-self-receiver-invalid-01.stderr @@ -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) {} - | ^^^^^^^^^^^ + | ^^^^ diff --git a/crates/lang/tests/ui/contract/fail/message-self-receiver-invalid-02.stderr b/crates/lang/tests/ui/contract/fail/message-self-receiver-invalid-02.stderr index 3caaa0e6a71..6a78845dbb5 100644 --- a/crates/lang/tests/ui/contract/fail/message-self-receiver-invalid-02.stderr +++ b/crates/lang/tests/ui/contract/fail/message-self-receiver-invalid-02.stderr @@ -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) {} - | ^^^^^^^^^^^^^^^ + | ^^^^ diff --git a/crates/lang/tests/ui/contract/fail/message-self-receiver-missing.stderr b/crates/lang/tests/ui/contract/fail/message-self-receiver-missing.stderr index 5a145a27650..44ca13ad68b 100644 --- a/crates/lang/tests/ui/contract/fail/message-self-receiver-missing.stderr +++ b/crates/lang/tests/ui/contract/fail/message-self-receiver-missing.stderr @@ -1,6 +1,5 @@ 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)] + | ^ diff --git a/crates/lang/tests/ui/contract/fail/module-missing-constructor.stderr b/crates/lang/tests/ui/contract/fail/module-missing-constructor.stderr index fa0735e4b7c..4ffe5418fda 100644 --- a/crates/lang/tests/ui/contract/fail/module-missing-constructor.stderr +++ b/crates/lang/tests/ui/contract/fail/module-missing-constructor.stderr @@ -1,11 +1,5 @@ error: missing ink! constructor - --> tests/ui/contract/fail/module-missing-constructor.rs:4:1 - | -4 | / mod contract { -5 | | #[ink(storage)] -6 | | pub struct Contract {} -7 | | -... | -11 | | } -12 | | } - | |_^ + --> tests/ui/contract/fail/module-missing-constructor.rs:4:1 + | +4 | mod contract { + | ^^^ diff --git a/crates/lang/tests/ui/contract/fail/module-missing-message.stderr b/crates/lang/tests/ui/contract/fail/module-missing-message.stderr index b71b1d5bd4b..e8bb3b90b98 100644 --- a/crates/lang/tests/ui/contract/fail/module-missing-message.stderr +++ b/crates/lang/tests/ui/contract/fail/module-missing-message.stderr @@ -1,11 +1,5 @@ error: missing ink! message - --> tests/ui/contract/fail/module-missing-message.rs:4:1 - | -4 | / mod contract { -5 | | #[ink(storage)] -6 | | pub struct Contract {} -7 | | -... | -13 | | } -14 | | } - | |_^ + --> tests/ui/contract/fail/module-missing-message.rs:4:1 + | +4 | mod contract { + | ^^^ diff --git a/crates/lang/tests/ui/contract/fail/module-missing-storage.stderr b/crates/lang/tests/ui/contract/fail/module-missing-storage.stderr index 2559d3726bb..854257d829e 100644 --- a/crates/lang/tests/ui/contract/fail/module-missing-storage.stderr +++ b/crates/lang/tests/ui/contract/fail/module-missing-storage.stderr @@ -1,11 +1,5 @@ error: missing ink! storage struct - --> tests/ui/contract/fail/module-missing-storage.rs:4:1 - | -4 | / mod contract { -5 | | // #[ink(storage)] -6 | | pub struct Contract {} -7 | | -... | -14 | | } -15 | | } - | |_^ + --> tests/ui/contract/fail/module-missing-storage.rs:4:1 + | +4 | mod contract { + | ^^^ diff --git a/crates/lang/tests/ui/contract/fail/module-multiple-storages.stderr b/crates/lang/tests/ui/contract/fail/module-multiple-storages.stderr index 98faa7ab857..38f800e5b63 100644 --- a/crates/lang/tests/ui/contract/fail/module-multiple-storages.stderr +++ b/crates/lang/tests/ui/contract/fail/module-multiple-storages.stderr @@ -1,23 +1,17 @@ error: encountered multiple ink! storage structs, expected exactly one - --> tests/ui/contract/fail/module-multiple-storages.rs:4:1 - | -4 | / mod contract { -5 | | #[ink(storage)] -6 | | pub struct Contract {} -7 | | -... | -29 | | } -30 | | } - | |_^ + --> tests/ui/contract/fail/module-multiple-storages.rs:4:1 + | +4 | mod contract { + | ^^^ error: ink! storage struct here --> tests/ui/contract/fail/module-multiple-storages.rs:6:5 | 6 | pub struct Contract {} - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^ error: ink! storage struct here --> tests/ui/contract/fail/module-multiple-storages.rs:19:5 | 19 | pub struct Contract2 {} - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^ diff --git a/crates/lang/tests/ui/contract/fail/trait-impl-namespace-invalid.stderr b/crates/lang/tests/ui/contract/fail/trait-impl-namespace-invalid.stderr index bf03fd4337f..1b2c5693382 100644 --- a/crates/lang/tests/ui/contract/fail/trait-impl-namespace-invalid.stderr +++ b/crates/lang/tests/ui/contract/fail/trait-impl-namespace-invalid.stderr @@ -1,9 +1,5 @@ error: namespace ink! property is not allowed on ink! trait implementation blocks --> tests/ui/contract/fail/trait-impl-namespace-invalid.rs:23:5 | -23 | / #[ink(namespace = "namespace")] -24 | | impl TraitDefinition for Contract { -25 | | #[ink(message)] -26 | | fn message(&self) {} -27 | | } - | |_____^ +23 | #[ink(namespace = "namespace")] + | ^ diff --git a/crates/lang/tests/ui/contract/fail/trait-message-payable-mismatch.stderr b/crates/lang/tests/ui/contract/fail/trait-message-payable-mismatch.stderr index 4c6a717217f..79c50458870 100644 --- a/crates/lang/tests/ui/contract/fail/trait-message-payable-mismatch.stderr +++ b/crates/lang/tests/ui/contract/fail/trait-message-payable-mismatch.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> tests/ui/contract/fail/trait-message-payable-mismatch.rs:25:9 | 25 | fn message(&self) {} - | ^^^^^^^^^^^^^^^^^^^^ expected `false`, found `true` + | ^^ expected `false`, found `true` | = note: expected struct `TraitMessagePayable` found struct `TraitMessagePayable` 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 ab366b9ec2c..8bc751aaa90 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 @@ -1,13 +1,8 @@ error[E0308]: mismatched types --> tests/ui/contract/fail/trait-message-selector-mismatch.rs:25:9 | -<<<<<<< HEAD:crates/lang/tests/ui/contract/fail/trait-message-selector-mismatch.stderr 25 | fn message(&self) {} - | ^^^^^^^^^^^^^^^^^^^^ expected `1_u32`, found `2_u32` -======= -23 | fn message(&self) {} | ^^ expected `1`, found `2` ->>>>>>> 9fe9a4224... Fix UI tests for latest stable `1.64` (#1416):crates/ink/tests/ui/contract/fail/trait-message-selector-mismatch.stderr | = note: expected struct `TraitMessageSelector<1>` found struct `TraitMessageSelector<2>` 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 6ea91ecc4eb..81a7e8d0cca 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,17 +1,17 @@ -error[E0119]: conflicting implementations of trait `ink_lang::reflect::DispatchableMessageInfo<1083895717_u32>` for type `contract::Contract` +error[E0119]: conflicting implementations of trait `ink_lang::reflect::DispatchableMessageInfo<1083895717>` for type `contract::Contract` --> tests/ui/contract/fail/trait-message-selector-overlap-1.rs:47:9 | 42 | fn message(&self) {} - | ----------------- first implementation here + | -- first implementation here ... 47 | fn message(&self) {} - | ^^^^^^^^^^^^^^^^^ conflicting implementation for `contract::Contract` + | ^^ conflicting implementation for `contract::Contract` -error[E0119]: conflicting implementations of trait `ink_lang::codegen::TraitCallForwarderFor<1083895717_u32>` for type `contract::_::CallBuilder` +error[E0119]: conflicting implementations of trait `ink_lang::codegen::TraitCallForwarderFor<1083895717>` for type `contract::_::CallBuilder` --> tests/ui/contract/fail/trait-message-selector-overlap-1.rs:45:5 | 40 | impl TraitDefinition1 for Contract { - | ---------------------------------- first implementation here + | ---- first implementation here ... 45 | impl TraitDefinition2 for Contract { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `contract::_::CallBuilder` + | ^^^^ conflicting implementation for `contract::_::CallBuilder` 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 9fd4346af04..a2eabcb9a01 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,17 +1,17 @@ -error[E0119]: conflicting implementations of trait `ink_lang::reflect::DispatchableMessageInfo<1518209067_u32>` for type `contract::Contract` +error[E0119]: conflicting implementations of trait `ink_lang::reflect::DispatchableMessageInfo<1518209067>` for type `contract::Contract` --> tests/ui/contract/fail/trait-message-selector-overlap-2.rs:47:9 | 42 | fn message(&self) {} - | ----------------- first implementation here + | -- first implementation here ... 47 | fn message(&self) {} - | ^^^^^^^^^^^^^^^^^ conflicting implementation for `contract::Contract` + | ^^ conflicting implementation for `contract::Contract` -error[E0119]: conflicting implementations of trait `ink_lang::codegen::TraitCallForwarderFor<1518209067_u32>` for type `contract::_::CallBuilder` +error[E0119]: conflicting implementations of trait `ink_lang::codegen::TraitCallForwarderFor<1518209067>` for type `contract::_::CallBuilder` --> tests/ui/contract/fail/trait-message-selector-overlap-2.rs:45:5 | 40 | impl TraitDefinition1 for Contract { - | ---------------------------------- first implementation here + | ---- first implementation here ... 45 | impl TraitDefinition2 for Contract { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `contract::_::CallBuilder` + | ^^^^ conflicting implementation for `contract::_::CallBuilder` 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 d8b948ebb4e..32b0c56157d 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,17 +1,17 @@ -error[E0119]: conflicting implementations of trait `ink_lang::reflect::DispatchableMessageInfo<42_u32>` for type `contract::Contract` +error[E0119]: conflicting implementations of trait `ink_lang::reflect::DispatchableMessageInfo<42>` for type `contract::Contract` --> tests/ui/contract/fail/trait-message-selector-overlap-3.rs:47:9 | 42 | fn message1(&self) {} - | ------------------ first implementation here + | -- first implementation here ... 47 | fn message2(&self) {} - | ^^^^^^^^^^^^^^^^^^ conflicting implementation for `contract::Contract` + | ^^ conflicting implementation for `contract::Contract` -error[E0119]: conflicting implementations of trait `ink_lang::codegen::TraitCallForwarderFor<42_u32>` for type `contract::_::CallBuilder` +error[E0119]: conflicting implementations of trait `ink_lang::codegen::TraitCallForwarderFor<42>` for type `contract::_::CallBuilder` --> tests/ui/contract/fail/trait-message-selector-overlap-3.rs:45:5 | 40 | impl TraitDefinition1 for Contract { - | ---------------------------------- first implementation here + | ---- first implementation here ... 45 | impl TraitDefinition2 for Contract { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `contract::_::CallBuilder` + | ^^^^ conflicting implementation for `contract::_::CallBuilder` diff --git a/crates/lang/tests/ui/contract/fail/trait-message-wildcard-selector.stderr b/crates/lang/tests/ui/contract/fail/trait-message-wildcard-selector.stderr index a9c620180ad..2bc0c5dbcaa 100644 --- a/crates/lang/tests/ui/contract/fail/trait-message-wildcard-selector.stderr +++ b/crates/lang/tests/ui/contract/fail/trait-message-wildcard-selector.stderr @@ -2,13 +2,13 @@ error: encountered conflicting ink! attribute argument --> tests/ui/contract/fail/trait-message-wildcard-selector.rs:6:24 | 6 | #[ink(message, selector = _)] - | ^^^^^^^^^^^^ + | ^^^^^^^^ error: wildcard selectors are only supported for inherent ink! messages or constructors, not for traits. --> tests/ui/contract/fail/trait-message-wildcard-selector.rs:6:24 | 6 | #[ink(message, selector = _)] - | ^^^^^^^^^^^^ + | ^^^^^^^^ error[E0432]: unresolved import `super::foo::TraitDefinition` --> tests/ui/contract/fail/trait-message-wildcard-selector.rs:15:9 diff --git a/crates/lang/tests/ui/pay_with_call/pass/multiple_args.rs b/crates/lang/tests/ui/pay_with_call/pass/multiple_args.rs index 77fbfdab6ff..a9500cdec9d 100644 --- a/crates/lang/tests/ui/pay_with_call/pass/multiple_args.rs +++ b/crates/lang/tests/ui/pay_with_call/pass/multiple_args.rs @@ -1,5 +1,9 @@ +use ink_lang as ink; + #[ink::contract] mod contract { + use ink_env as env; + #[ink(storage)] pub struct Contract {} @@ -19,9 +23,9 @@ mod contract { pub fn message2(&self, _arg1: u8, _arg2: (u8, AccountId)) {} fn check_compiles(&self) { - ink::env::pay_with_call!(self.message0(), 0); - ink::env::pay_with_call!(self.message1(0), 0); - ink::env::pay_with_call!(self.message2(0, (0, Self::env().account_id())), 0); + env::pay_with_call!(self.message0(), 0); + env::pay_with_call!(self.message1(0), 0); + env::pay_with_call!(self.message2(0, (0, Self::env().account_id())), 0); } } } diff --git a/crates/lang/tests/ui/trait_def/fail/definition_constructor.stderr b/crates/lang/tests/ui/trait_def/fail/definition_constructor.stderr index 3460253bf3b..7bdbe3f5e0f 100644 --- a/crates/lang/tests/ui/trait_def/fail/definition_constructor.stderr +++ b/crates/lang/tests/ui/trait_def/fail/definition_constructor.stderr @@ -1,6 +1,5 @@ error: ink! trait definitions must not have constructors --> tests/ui/trait_def/fail/definition_constructor.rs:5:5 | -5 | / #[ink(constructor)] -6 | | fn constructor() -> Self; - | |_____________________________^ +5 | #[ink(constructor)] + | ^ diff --git a/crates/lang/tests/ui/trait_def/fail/definition_empty.stderr b/crates/lang/tests/ui/trait_def/fail/definition_empty.stderr index 4b9db3aacf7..9771116e22c 100644 --- a/crates/lang/tests/ui/trait_def/fail/definition_empty.stderr +++ b/crates/lang/tests/ui/trait_def/fail/definition_empty.stderr @@ -2,4 +2,4 @@ error: encountered invalid empty ink! trait definition --> tests/ui/trait_def/fail/definition_empty.rs:4:1 | 4 | pub trait TraitDefinition {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^ diff --git a/crates/lang/tests/ui/trait_def/fail/message_input_non_codec.stderr b/crates/lang/tests/ui/trait_def/fail/message_input_non_codec.stderr index 33c26ef4339..90e3ff499e6 100644 --- a/crates/lang/tests/ui/trait_def/fail/message_input_non_codec.stderr +++ b/crates/lang/tests/ui/trait_def/fail/message_input_non_codec.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `NonCodec: WrapperTypeDecode` is not satisfied --> tests/ui/trait_def/fail/message_input_non_codec.rs:8:23 | 8 | fn message(&self, input: NonCodec); - | ^^^^^^^^^^^^^^^ the trait `WrapperTypeDecode` is not implemented for `NonCodec` + | ^^^^^ the trait `WrapperTypeDecode` is not implemented for `NonCodec` | = help: the following other types implement trait `WrapperTypeDecode`: Arc @@ -18,9 +18,8 @@ note: required by a bound in `DispatchInput` error[E0277]: the trait bound `NonCodec: WrapperTypeEncode` is not satisfied --> tests/ui/trait_def/fail/message_input_non_codec.rs:7:5 | -7 | / #[ink(message)] -8 | | fn message(&self, input: NonCodec); - | |_______________________________________^ the trait `WrapperTypeEncode` is not implemented for `NonCodec` +7 | #[ink(message)] + | ^ the trait `WrapperTypeEncode` is not implemented for `NonCodec` | = help: the following other types implement trait `WrapperTypeEncode`: &T @@ -42,14 +41,13 @@ note: required by a bound in `ExecutionInput::>, Set, ArgumentList>>>, Set>>`, but its trait bounds were not satisfied --> tests/ui/trait_def/fail/message_input_non_codec.rs:7:5 | -7 | / #[ink(message)] -8 | | fn message(&self, input: NonCodec); - | |_______________________________________^ method cannot be called on `CallBuilder>, Set, ArgumentList>>>, Set>>` due to unsatisfied trait bounds +7 | #[ink(message)] + | ^ method cannot be called on `CallBuilder>, Set, ArgumentList>>>, Set>>` due to unsatisfied trait bounds | ::: $WORKSPACE/crates/env/src/call/execution_input.rs | - | pub struct ArgumentList { - | ----------------------------------- doesn't satisfy `_: Encode` + | pub struct ArgumentList { + | ----------------------------------- doesn't satisfy `_: Encode` | = note: the following trait bounds were not satisfied: `ArgumentList, ArgumentList>: Encode` 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 de3f611b91e..bc8f966df11 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 @@ -24,22 +24,16 @@ note: required by a bound in `DispatchOutput` error[E0599]: the method `fire` exists for struct `CallBuilder>, Set>>, Set>>`, but its trait bounds were not satisfied --> tests/ui/trait_def/fail/message_output_non_codec.rs:7:5 | -<<<<<<< HEAD:crates/lang/tests/ui/trait_def/fail/message_output_non_codec.stderr -3 | pub struct NonCodec; - | -------------------- doesn't satisfy `NonCodec: parity_scale_codec::Decode` -======= -1 | pub struct NonCodec; +3 | pub struct NonCodec; | ------------------- doesn't satisfy `NonCodec: parity_scale_codec::Decode` ->>>>>>> 9fe9a4224... Fix UI tests for latest stable `1.64` (#1416):crates/ink/tests/ui/trait_def/fail/message_output_non_codec.stderr ... -7 | / #[ink(message)] -8 | | fn message(&self) -> NonCodec; - | |__________________________________^ method cannot be called on `CallBuilder>, Set>>, Set>>` due to unsatisfied trait bounds +7 | #[ink(message)] + | ^ method cannot be called on `CallBuilder>, Set>>, Set>>` due to unsatisfied trait bounds | = note: the following trait bounds were not satisfied: `NonCodec: parity_scale_codec::Decode` note: the following trait must be implemented - --> $CARGO/parity-scale-codec-3.1.5/src/codec.rs + --> $CARGO/parity-scale-codec-3.2.1/src/codec.rs | | pub trait Decode: Sized { | ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/crates/lang/tests/ui/trait_def/fail/message_selector_invalid_1.stderr b/crates/lang/tests/ui/trait_def/fail/message_selector_invalid_1.stderr index 1de6c7b6c3d..97517012dc5 100644 --- a/crates/lang/tests/ui/trait_def/fail/message_selector_invalid_1.stderr +++ b/crates/lang/tests/ui/trait_def/fail/message_selector_invalid_1.stderr @@ -2,4 +2,4 @@ error: expected 4-digit hexcode for `selector` argument, e.g. #[ink(selector = 0 --> tests/ui/trait_def/fail/message_selector_invalid_1.rs:5:20 | 5 | #[ink(message, selector = true)] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^ From 23d61d42d8be5353a53674f35002594634155af2 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Tue, 18 Oct 2022 16:27:54 +0300 Subject: [PATCH 5/6] Moved constants from `match` to a separate constants (#1418) --- crates/lang/codegen/src/generator/dispatch.rs | 51 +++++++++++++------ 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/crates/lang/codegen/src/generator/dispatch.rs b/crates/lang/codegen/src/generator/dispatch.rs index fee922033e5..623e86d0e93 100644 --- a/crates/lang/codegen/src/generator/dispatch.rs +++ b/crates/lang/codegen/src/generator/dispatch.rs @@ -25,6 +25,7 @@ use ir::{ }; use proc_macro2::TokenStream as TokenStream2; use quote::{ + format_ident, quote, quote_spanned, }; @@ -488,19 +489,25 @@ impl Dispatch<'_> { #constructor_ident(#constructor_input) ) }); - let constructor_match = (0..count_constructors).map(|index| { - let constructor_span = constructor_spans[index]; - let constructor_ident = constructor_variant_ident(index); - let constructor_selector = quote_spanned!(span=> - <#storage_ident as ::ink_lang::reflect::DispatchableConstructorInfo<{ + + let constructor_selector = (0..count_constructors).map(|index| { + let const_ident = format_ident!("CONSTRUCTOR_{}", index); + quote_spanned!(span=> + const #const_ident: [::core::primitive::u8; 4usize] = <#storage_ident as ::ink_lang::reflect::DispatchableConstructorInfo<{ <#storage_ident as ::ink_lang::reflect::ContractDispatchableConstructors<{ <#storage_ident as ::ink_lang::reflect::ContractAmountDispatchables>::CONSTRUCTORS }>>::IDS[#index] - }>>::SELECTOR - ); + }>>::SELECTOR; + ) + }); + + let constructor_match = (0..count_constructors).map(|index| { + let constructor_span = constructor_spans[index]; + let constructor_ident = constructor_variant_ident(index); + let const_ident = format_ident!("CONSTRUCTOR_{}", index); let constructor_input = expand_constructor_input(constructor_span, storage_ident, index); quote_spanned!(constructor_span=> - #constructor_selector => { + #const_ident => { ::core::result::Result::Ok(Self::#constructor_ident( <#constructor_input as ::scale::Decode>::decode(input) .map_err(|_| ::ink_lang::reflect::DispatchError::InvalidParameters)? @@ -576,6 +583,9 @@ impl Dispatch<'_> { where I: ::scale::Input, { + #( + #constructor_selector + )* match <[::core::primitive::u8; 4usize] as ::scale::Decode>::decode(input) .map_err(|_| ::ink_lang::reflect::DispatchError::InvalidSelector)? { @@ -653,19 +663,25 @@ impl Dispatch<'_> { #message_ident(#message_input) ) }); - let message_match = (0..count_messages).map(|index| { - let message_span = message_spans[index]; - let message_ident = message_variant_ident(index); - let message_selector = quote_spanned!(span=> - <#storage_ident as ::ink_lang::reflect::DispatchableMessageInfo<{ + + let message_selector = (0..count_messages).map(|index| { + let const_ident = format_ident!("MESSAGE_{}", index); + quote_spanned!(span=> + const #const_ident: [::core::primitive::u8; 4usize] = <#storage_ident as ::ink_lang::reflect::DispatchableMessageInfo<{ <#storage_ident as ::ink_lang::reflect::ContractDispatchableMessages<{ <#storage_ident as ::ink_lang::reflect::ContractAmountDispatchables>::MESSAGES }>>::IDS[#index] - }>>::SELECTOR - ); + }>>::SELECTOR; + ) + }); + + let message_match = (0..count_messages).map(|index| { + let message_span = message_spans[index]; + let message_ident = message_variant_ident(index); + let const_ident = format_ident!("MESSAGE_{}", index); let message_input = expand_message_input(message_span, storage_ident, index); quote_spanned!(message_span=> - #message_selector => { + #const_ident => { ::core::result::Result::Ok(Self::#message_ident( <#message_input as ::scale::Decode>::decode(input) .map_err(|_| ::ink_lang::reflect::DispatchError::InvalidParameters)? @@ -772,6 +788,9 @@ impl Dispatch<'_> { where I: ::scale::Input, { + #( + #message_selector + )* match <[::core::primitive::u8; 4usize] as ::scale::Decode>::decode(input) .map_err(|_| ::ink_lang::reflect::DispatchError::InvalidSelector)? { From 8e3bb51f72188e508bbd6f40d93cc3fe500af510 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Wed, 19 Oct 2022 14:16:42 +0300 Subject: [PATCH 6/6] fix ui tests again --- .../fail/constructor-input-non-codec.stderr | 14 +++++--- ...tructor-multiple-wildcard-selectors.stderr | 12 ++++--- ...ctor-selector-and-wildcard-selector.stderr | 4 +-- .../fail/constructor-self-receiver-03.stderr | 33 +++++-------------- .../event-too-many-topics-anonymous.stderr | 28 +++++++++------- .../fail/event-too-many-topics.stderr | 28 +++++++++------- .../fail/impl-block-for-non-storage-01.stderr | 4 +-- .../impl-block-namespace-invalid-type.stderr | 2 +- ...pl-block-using-static-env-no-marker.stderr | 2 +- .../fail/message-input-non-codec.stderr | 8 ++--- ...message-multiple-wildcard-selectors.stderr | 4 +-- .../fail/message-returns-non-codec.stderr | 26 ++++++++++----- ...sage-selector-and-wildcard-selector.stderr | 4 +-- .../message-selector-invalid-type-01.stderr | 2 +- .../message-selector-invalid-type-02.stderr | 2 +- .../message-self-receiver-invalid-01.stderr | 2 +- .../message-self-receiver-invalid-02.stderr | 2 +- .../fail/message-self-receiver-missing.stderr | 5 +-- .../fail/module-missing-constructor.stderr | 14 +++++--- .../fail/module-missing-message.stderr | 14 +++++--- .../fail/module-missing-storage.stderr | 14 +++++--- .../fail/module-multiple-storages.stderr | 18 ++++++---- .../fail/trait-impl-namespace-invalid.stderr | 8 +++-- .../trait-message-payable-mismatch.stderr | 2 +- .../trait-message-selector-mismatch.stderr | 6 ++-- .../trait-message-selector-overlap-1.stderr | 12 +++---- .../trait-message-selector-overlap-2.stderr | 12 +++---- .../trait-message-selector-overlap-3.stderr | 12 +++---- .../trait-message-wildcard-selector.stderr | 4 +-- .../fail/definition_constructor.stderr | 5 +-- .../ui/trait_def/fail/definition_empty.stderr | 2 +- .../fail/message_input_non_codec.stderr | 16 +++++---- .../fail/message_output_non_codec.stderr | 19 +++++++---- .../fail/message_selector_invalid_1.stderr | 2 +- 34 files changed, 197 insertions(+), 145 deletions(-) diff --git a/crates/lang/tests/ui/contract/fail/constructor-input-non-codec.stderr b/crates/lang/tests/ui/contract/fail/constructor-input-non-codec.stderr index dd654902eac..11181e8168f 100644 --- a/crates/lang/tests/ui/contract/fail/constructor-input-non-codec.stderr +++ b/crates/lang/tests/ui/contract/fail/constructor-input-non-codec.stderr @@ -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 @@ -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 @@ -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 diff --git a/crates/lang/tests/ui/contract/fail/constructor-multiple-wildcard-selectors.stderr b/crates/lang/tests/ui/contract/fail/constructor-multiple-wildcard-selectors.stderr index 229b3749d48..658bd706146 100644 --- a/crates/lang/tests/ui/contract/fail/constructor-multiple-wildcard-selectors.stderr +++ b/crates/lang/tests/ui/contract/fail/constructor-multiple-wildcard-selectors.stderr @@ -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 | | } + | |_________^ diff --git a/crates/lang/tests/ui/contract/fail/constructor-selector-and-wildcard-selector.stderr b/crates/lang/tests/ui/contract/fail/constructor-selector-and-wildcard-selector.stderr index fb79614beb0..9c2c985c235 100644 --- a/crates/lang/tests/ui/contract/fail/constructor-selector-and-wildcard-selector.stderr +++ b/crates/lang/tests/ui/contract/fail/constructor-selector-and-wildcard-selector.stderr @@ -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 = _)] - | ^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ 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..30cdf70f020 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,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 - Box - Rc - = note: required because of the requirements on the impl of `parity_scale_codec::Decode` for `&'static Contract` 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..f33a62ce9ad 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,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`: - 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..390b822b341 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,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`: - 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..50d787d6130 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-namespace-invalid-type.stderr b/crates/lang/tests/ui/contract/fail/impl-block-namespace-invalid-type.stderr index 0f34c5f10e7..a6014a9e97b 100644 --- a/crates/lang/tests/ui/contract/fail/impl-block-namespace-invalid-type.stderr +++ b/crates/lang/tests/ui/contract/fail/impl-block-namespace-invalid-type.stderr @@ -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)] - | ^^^^^^^^^ + | ^^^^^^^^^^^^^^^^ 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..de2a07cc208 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-input-non-codec.stderr b/crates/lang/tests/ui/contract/fail/message-input-non-codec.stderr index 966210367c2..360b344495d 100644 --- a/crates/lang/tests/ui/contract/fail/message-input-non-codec.stderr +++ b/crates/lang/tests/ui/contract/fail/message-input-non-codec.stderr @@ -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 @@ -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 @@ -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 @@ -54,7 +54,7 @@ error[E0599]: the method `fire` exists for struct `ink_env::call::CallBuilder 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>, Set, ArgumentList>>>, Set>>` due to unsatisfied trait bounds + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `ink_env::call::CallBuilder>, Set, ArgumentList>>>, Set>>` due to unsatisfied trait bounds | ::: $WORKSPACE/crates/env/src/call/execution_input.rs | diff --git a/crates/lang/tests/ui/contract/fail/message-multiple-wildcard-selectors.stderr b/crates/lang/tests/ui/contract/fail/message-multiple-wildcard-selectors.stderr index dad7a2df787..d063519224f 100644 --- a/crates/lang/tests/ui/contract/fail/message-multiple-wildcard-selectors.stderr +++ b/crates/lang/tests/ui/contract/fail/message-multiple-wildcard-selectors.stderr @@ -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) {} - | ^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ 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..574191435b8 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 @@ -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 @@ -47,16 +49,24 @@ note: required by a bound in `return_value` error[E0599]: the method `fire` exists for struct `ink_env::call::CallBuilder>, Set>>, Set>>`, 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>, Set>>, Set>>` due to unsatisfied trait bounds +18 | / pub fn message(&self) -> NonCodecType { +19 | | NonCodecType +20 | | } + | |_________^ method cannot be called on `ink_env::call::CallBuilder>, Set>>, Set>>` 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)] +... | + | | } + | | } + | |_^ diff --git a/crates/lang/tests/ui/contract/fail/message-selector-and-wildcard-selector.stderr b/crates/lang/tests/ui/contract/fail/message-selector-and-wildcard-selector.stderr index cf79612b7db..246e1a606e6 100644 --- a/crates/lang/tests/ui/contract/fail/message-selector-and-wildcard-selector.stderr +++ b/crates/lang/tests/ui/contract/fail/message-selector-and-wildcard-selector.stderr @@ -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 = _)] - | ^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ diff --git a/crates/lang/tests/ui/contract/fail/message-selector-invalid-type-01.stderr b/crates/lang/tests/ui/contract/fail/message-selector-invalid-type-01.stderr index 3660e33fbe2..91585edc1b0 100644 --- a/crates/lang/tests/ui/contract/fail/message-selector-invalid-type-01.stderr +++ b/crates/lang/tests/ui/contract/fail/message-selector-invalid-type-01.stderr @@ -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")] - | ^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/crates/lang/tests/ui/contract/fail/message-selector-invalid-type-02.stderr b/crates/lang/tests/ui/contract/fail/message-selector-invalid-type-02.stderr index 2924628b6fc..893067fe7c4 100644 --- a/crates/lang/tests/ui/contract/fail/message-selector-invalid-type-02.stderr +++ b/crates/lang/tests/ui/contract/fail/message-selector-invalid-type-02.stderr @@ -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)] - | ^^^^^^^^ + | ^^^^^^^^^^^^^^^ diff --git a/crates/lang/tests/ui/contract/fail/message-self-receiver-invalid-01.stderr b/crates/lang/tests/ui/contract/fail/message-self-receiver-invalid-01.stderr index 881158eae5e..2f8df8130e3 100644 --- a/crates/lang/tests/ui/contract/fail/message-self-receiver-invalid-01.stderr +++ b/crates/lang/tests/ui/contract/fail/message-self-receiver-invalid-01.stderr @@ -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) {} - | ^^^^ + | ^^^^^^^^^^^ diff --git a/crates/lang/tests/ui/contract/fail/message-self-receiver-invalid-02.stderr b/crates/lang/tests/ui/contract/fail/message-self-receiver-invalid-02.stderr index 6a78845dbb5..3caaa0e6a71 100644 --- a/crates/lang/tests/ui/contract/fail/message-self-receiver-invalid-02.stderr +++ b/crates/lang/tests/ui/contract/fail/message-self-receiver-invalid-02.stderr @@ -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) {} - | ^^^^ + | ^^^^^^^^^^^^^^^ diff --git a/crates/lang/tests/ui/contract/fail/message-self-receiver-missing.stderr b/crates/lang/tests/ui/contract/fail/message-self-receiver-missing.stderr index 44ca13ad68b..5a145a27650 100644 --- a/crates/lang/tests/ui/contract/fail/message-self-receiver-missing.stderr +++ b/crates/lang/tests/ui/contract/fail/message-self-receiver-missing.stderr @@ -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() {} + | |___________________________^ diff --git a/crates/lang/tests/ui/contract/fail/module-missing-constructor.stderr b/crates/lang/tests/ui/contract/fail/module-missing-constructor.stderr index 4ffe5418fda..fa0735e4b7c 100644 --- a/crates/lang/tests/ui/contract/fail/module-missing-constructor.stderr +++ b/crates/lang/tests/ui/contract/fail/module-missing-constructor.stderr @@ -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 | | } + | |_^ diff --git a/crates/lang/tests/ui/contract/fail/module-missing-message.stderr b/crates/lang/tests/ui/contract/fail/module-missing-message.stderr index e8bb3b90b98..b71b1d5bd4b 100644 --- a/crates/lang/tests/ui/contract/fail/module-missing-message.stderr +++ b/crates/lang/tests/ui/contract/fail/module-missing-message.stderr @@ -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 | | } + | |_^ diff --git a/crates/lang/tests/ui/contract/fail/module-missing-storage.stderr b/crates/lang/tests/ui/contract/fail/module-missing-storage.stderr index 854257d829e..2559d3726bb 100644 --- a/crates/lang/tests/ui/contract/fail/module-missing-storage.stderr +++ b/crates/lang/tests/ui/contract/fail/module-missing-storage.stderr @@ -1,5 +1,11 @@ error: missing ink! storage struct - --> tests/ui/contract/fail/module-missing-storage.rs:4:1 - | -4 | mod contract { - | ^^^ + --> tests/ui/contract/fail/module-missing-storage.rs:4:1 + | +4 | / mod contract { +5 | | // #[ink(storage)] +6 | | pub struct Contract {} +7 | | +... | +14 | | } +15 | | } + | |_^ diff --git a/crates/lang/tests/ui/contract/fail/module-multiple-storages.stderr b/crates/lang/tests/ui/contract/fail/module-multiple-storages.stderr index 38f800e5b63..98faa7ab857 100644 --- a/crates/lang/tests/ui/contract/fail/module-multiple-storages.stderr +++ b/crates/lang/tests/ui/contract/fail/module-multiple-storages.stderr @@ -1,17 +1,23 @@ error: encountered multiple ink! storage structs, expected exactly one - --> tests/ui/contract/fail/module-multiple-storages.rs:4:1 - | -4 | mod contract { - | ^^^ + --> tests/ui/contract/fail/module-multiple-storages.rs:4:1 + | +4 | / mod contract { +5 | | #[ink(storage)] +6 | | pub struct Contract {} +7 | | +... | +29 | | } +30 | | } + | |_^ error: ink! storage struct here --> tests/ui/contract/fail/module-multiple-storages.rs:6:5 | 6 | pub struct Contract {} - | ^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ error: ink! storage struct here --> tests/ui/contract/fail/module-multiple-storages.rs:19:5 | 19 | pub struct Contract2 {} - | ^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/crates/lang/tests/ui/contract/fail/trait-impl-namespace-invalid.stderr b/crates/lang/tests/ui/contract/fail/trait-impl-namespace-invalid.stderr index 1b2c5693382..bf03fd4337f 100644 --- a/crates/lang/tests/ui/contract/fail/trait-impl-namespace-invalid.stderr +++ b/crates/lang/tests/ui/contract/fail/trait-impl-namespace-invalid.stderr @@ -1,5 +1,9 @@ error: namespace ink! property is not allowed on ink! trait implementation blocks --> tests/ui/contract/fail/trait-impl-namespace-invalid.rs:23:5 | -23 | #[ink(namespace = "namespace")] - | ^ +23 | / #[ink(namespace = "namespace")] +24 | | impl TraitDefinition for Contract { +25 | | #[ink(message)] +26 | | fn message(&self) {} +27 | | } + | |_____^ diff --git a/crates/lang/tests/ui/contract/fail/trait-message-payable-mismatch.stderr b/crates/lang/tests/ui/contract/fail/trait-message-payable-mismatch.stderr index 79c50458870..4c6a717217f 100644 --- a/crates/lang/tests/ui/contract/fail/trait-message-payable-mismatch.stderr +++ b/crates/lang/tests/ui/contract/fail/trait-message-payable-mismatch.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> tests/ui/contract/fail/trait-message-payable-mismatch.rs:25:9 | 25 | fn message(&self) {} - | ^^ expected `false`, found `true` + | ^^^^^^^^^^^^^^^^^^^^ expected `false`, found `true` | = note: expected struct `TraitMessagePayable` found struct `TraitMessagePayable` 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..5e93d3f7594 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..6ea91ecc4eb 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,17 +1,17 @@ -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) {} - | -- first implementation here + | ----------------- first implementation here ... 47 | fn message(&self) {} - | ^^ conflicting implementation for `contract::Contract` + | ^^^^^^^^^^^^^^^^^ 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 { - | ---- first implementation here + | ---------------------------------- first implementation here ... 45 | impl TraitDefinition2 for Contract { - | ^^^^ conflicting implementation for `contract::_::CallBuilder` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `contract::_::CallBuilder` 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..9fd4346af04 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,17 +1,17 @@ -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) {} - | -- first implementation here + | ----------------- first implementation here ... 47 | fn message(&self) {} - | ^^ conflicting implementation for `contract::Contract` + | ^^^^^^^^^^^^^^^^^ 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 { - | ---- first implementation here + | ---------------------------------- first implementation here ... 45 | impl TraitDefinition2 for Contract { - | ^^^^ conflicting implementation for `contract::_::CallBuilder` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `contract::_::CallBuilder` 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..d8b948ebb4e 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,17 +1,17 @@ -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) {} - | -- first implementation here + | ------------------ first implementation here ... 47 | fn message2(&self) {} - | ^^ conflicting implementation for `contract::Contract` + | ^^^^^^^^^^^^^^^^^^ 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 { - | ---- first implementation here + | ---------------------------------- first implementation here ... 45 | impl TraitDefinition2 for Contract { - | ^^^^ conflicting implementation for `contract::_::CallBuilder` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `contract::_::CallBuilder` diff --git a/crates/lang/tests/ui/contract/fail/trait-message-wildcard-selector.stderr b/crates/lang/tests/ui/contract/fail/trait-message-wildcard-selector.stderr index 2bc0c5dbcaa..a9c620180ad 100644 --- a/crates/lang/tests/ui/contract/fail/trait-message-wildcard-selector.stderr +++ b/crates/lang/tests/ui/contract/fail/trait-message-wildcard-selector.stderr @@ -2,13 +2,13 @@ error: encountered conflicting ink! attribute argument --> tests/ui/contract/fail/trait-message-wildcard-selector.rs:6:24 | 6 | #[ink(message, selector = _)] - | ^^^^^^^^ + | ^^^^^^^^^^^^ error: wildcard selectors are only supported for inherent ink! messages or constructors, not for traits. --> tests/ui/contract/fail/trait-message-wildcard-selector.rs:6:24 | 6 | #[ink(message, selector = _)] - | ^^^^^^^^ + | ^^^^^^^^^^^^ error[E0432]: unresolved import `super::foo::TraitDefinition` --> tests/ui/contract/fail/trait-message-wildcard-selector.rs:15:9 diff --git a/crates/lang/tests/ui/trait_def/fail/definition_constructor.stderr b/crates/lang/tests/ui/trait_def/fail/definition_constructor.stderr index 7bdbe3f5e0f..3460253bf3b 100644 --- a/crates/lang/tests/ui/trait_def/fail/definition_constructor.stderr +++ b/crates/lang/tests/ui/trait_def/fail/definition_constructor.stderr @@ -1,5 +1,6 @@ error: ink! trait definitions must not have constructors --> tests/ui/trait_def/fail/definition_constructor.rs:5:5 | -5 | #[ink(constructor)] - | ^ +5 | / #[ink(constructor)] +6 | | fn constructor() -> Self; + | |_____________________________^ diff --git a/crates/lang/tests/ui/trait_def/fail/definition_empty.stderr b/crates/lang/tests/ui/trait_def/fail/definition_empty.stderr index 9771116e22c..4b9db3aacf7 100644 --- a/crates/lang/tests/ui/trait_def/fail/definition_empty.stderr +++ b/crates/lang/tests/ui/trait_def/fail/definition_empty.stderr @@ -2,4 +2,4 @@ error: encountered invalid empty ink! trait definition --> tests/ui/trait_def/fail/definition_empty.rs:4:1 | 4 | pub trait TraitDefinition {} - | ^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/crates/lang/tests/ui/trait_def/fail/message_input_non_codec.stderr b/crates/lang/tests/ui/trait_def/fail/message_input_non_codec.stderr index 90e3ff499e6..33c26ef4339 100644 --- a/crates/lang/tests/ui/trait_def/fail/message_input_non_codec.stderr +++ b/crates/lang/tests/ui/trait_def/fail/message_input_non_codec.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `NonCodec: WrapperTypeDecode` is not satisfied --> tests/ui/trait_def/fail/message_input_non_codec.rs:8:23 | 8 | fn message(&self, input: NonCodec); - | ^^^^^ the trait `WrapperTypeDecode` is not implemented for `NonCodec` + | ^^^^^^^^^^^^^^^ the trait `WrapperTypeDecode` is not implemented for `NonCodec` | = help: the following other types implement trait `WrapperTypeDecode`: Arc @@ -18,8 +18,9 @@ note: required by a bound in `DispatchInput` error[E0277]: the trait bound `NonCodec: WrapperTypeEncode` is not satisfied --> tests/ui/trait_def/fail/message_input_non_codec.rs:7:5 | -7 | #[ink(message)] - | ^ the trait `WrapperTypeEncode` is not implemented for `NonCodec` +7 | / #[ink(message)] +8 | | fn message(&self, input: NonCodec); + | |_______________________________________^ the trait `WrapperTypeEncode` is not implemented for `NonCodec` | = help: the following other types implement trait `WrapperTypeEncode`: &T @@ -41,13 +42,14 @@ note: required by a bound in `ExecutionInput::>, Set, ArgumentList>>>, Set>>`, but its trait bounds were not satisfied --> tests/ui/trait_def/fail/message_input_non_codec.rs:7:5 | -7 | #[ink(message)] - | ^ method cannot be called on `CallBuilder>, Set, ArgumentList>>>, Set>>` due to unsatisfied trait bounds +7 | / #[ink(message)] +8 | | fn message(&self, input: NonCodec); + | |_______________________________________^ method cannot be called on `CallBuilder>, Set, ArgumentList>>>, Set>>` due to unsatisfied trait bounds | ::: $WORKSPACE/crates/env/src/call/execution_input.rs | - | pub struct ArgumentList { - | ----------------------------------- doesn't satisfy `_: Encode` + | pub struct ArgumentList { + | ----------------------------------- doesn't satisfy `_: Encode` | = note: the following trait bounds were not satisfied: `ArgumentList, ArgumentList>: Encode` 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..e6b9ea797b8 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 @@ -24,16 +24,23 @@ note: required by a bound in `DispatchOutput` error[E0599]: the method `fire` exists for struct `CallBuilder>, Set>>, Set>>`, but its trait bounds were not satisfied --> tests/ui/trait_def/fail/message_output_non_codec.rs:7:5 | -3 | pub struct NonCodec; - | ------------------- doesn't satisfy `NonCodec: parity_scale_codec::Decode` +3 | pub struct NonCodec; + | -------------------- doesn't satisfy `NonCodec: parity_scale_codec::Decode` ... -7 | #[ink(message)] - | ^ method cannot be called on `CallBuilder>, Set>>, Set>>` due to unsatisfied trait bounds +7 | / #[ink(message)] +8 | | fn message(&self) -> NonCodec; + | |__________________________________^ method cannot be called on `CallBuilder>, Set>>, Set>>` due to unsatisfied trait bounds | = note: the following trait bounds were not satisfied: `NonCodec: 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)] +... | + | | } + | | } + | |_^ diff --git a/crates/lang/tests/ui/trait_def/fail/message_selector_invalid_1.stderr b/crates/lang/tests/ui/trait_def/fail/message_selector_invalid_1.stderr index 97517012dc5..1de6c7b6c3d 100644 --- a/crates/lang/tests/ui/trait_def/fail/message_selector_invalid_1.stderr +++ b/crates/lang/tests/ui/trait_def/fail/message_selector_invalid_1.stderr @@ -2,4 +2,4 @@ error: expected 4-digit hexcode for `selector` argument, e.g. #[ink(selector = 0 --> tests/ui/trait_def/fail/message_selector_invalid_1.rs:5:20 | 5 | #[ink(message, selector = true)] - | ^^^^^^^^ + | ^^^^^^^^^^^^^^^