Make ink! lang use ink_core::storage2 module (#422)

* [abi] create new layout trait and structures

* [abi] remove unused import

* [abi] add missing license header

* [abi] fix clippy warning

* [primitives] add KeyPtr to ink_primitives

* [core] use KeyPtr through ink_primitives and add ExtKeyPtr trait

* [abi] use KeyPtr of ink_primitives

* [abi] make EnumLayout use StructLayout

* [abi] implement custom serde::Serialize for LayoutKey

* [abi] implement IntoCompact for layout2 module types

* [abi] add doc comment

* [abi] apply rustfmt

* [abi] add unit test for LayoutKey serialization

* [abi] rename ArrayLayout::array -> new

* [abi] add dispatch_key field to enum layout

* [abi] derive From for all Layout variants

* [abi] add unit tests for the new layout traits and data structures

* [abi] add experimental CellLayout

* [abi] make tests work again for layout2

* [abi] use specialized serializer function for LayoutKey

* [abi] refactor UnboundedLayout

* [abi] add unit test for UnboundedLayout

* [abi] apply rustfmt

* [core/derive] slightly refactor code

* [abi] simplify enum test

* [primitives] derive Debug, Copy and Clone for KeyPtr

* [abi] simplify CellLayout::new

* [abi] fix calling incorrect constructor for LayoutKey

* [abi] move layout2 module file into directory

* [core] add StorageLayout trait to storage2 module

* [abi_derive, core_derive] remove unnecessary extern crate proc_macro

* [core] imply ink-generate-abi feature by std feature

* [core] derive Metadata for env types for std feature

* [core] add Key, Hash, AccountId and String StorageLayout impls

* [core/derive] add initial structure for StorageLayout derive

* [core] add StorageLayout impls for some more prelude types

* [core] fix Box<T> impl for StorageLayout trait

* [core] implement StorageLayout for storage2::{Memory, Pack, LazyArray}

* [core] fix StorageLayout impl for LazyArray

* [core] implement StorageLayout for LazyIndexMap

* [abi] add HashLayout

* [abi] rewrite UnboundedLayout test to HashLayout test

* [abi] remove unbounded layout

* [abi, core] apply rustfmt

* [core] add initial skeleton for StorageLayout tests

* [core] add StorageLayout impls for Lazy, LazyCell and LazyHashMap

* [core] add StorageLayout impls for Option and Result

* [core] add LayoutCryptoHasher trait

* [core] fix StorageLayout impl for LazyHashMap

* [core] apply rustfmt

* [core] add StorageLayout impl for storage2::Vec

* [core] add StorageLayout for storage2::SmallVec

* [core] implement StorageLayout for storage2::Stash

* [core] implement StorageLayout for storage BitStash, Bitvec and HashMap

* [core] improve StorageLayout impl for storage2::Vec

* [core] apply rustfmt

* [abi] fix clippy warning

* [core] add StorageLayout impl for storage2::alloc::Box

* [core] add StorageLayout impl for DynamicAllocator

* [core/derive] impl StorageLayout derive for struct items

* [core/derive] make StorageLayout derive work for enum items

* [core/derive] fix expansion for nested enums

* [core/derive] fix a bug with nested enums

* [core/derive] add unit test for MixedEnum

* [core/derive] apply rustfmt

* [lang] add revision 2 module

* [core] remove generic T: EnvTypes param from Dispatch trait

* [lang] remove unnecessary import

* [lang] remove unnecessary generic parameter

* [lang/macro] generate codegen for the new v2 traits

* [core] re-export SpreadLayout and PackedLayout macros from within ink_core

* [lang] further adjustments to make ink_lang_macro work with storage2

* [lang, core] apply rustfmt

* [lang] fix clippy warning

* [lang] fix some bugs with constructors without inputs

* [examples] adjust the Flipper example contract for the changes

* [lang] remove codegen for testing ink! contracts

No longer needed.

* [lang] remove test-env crate feature

* [lang] minor improvements to EnvAccess utility type

* [examples] remove unused import for Flipper

* [examples] remove test-env crate feature for Flipper

* [lang] remove unused IdentType::span method

* [examples] Flipper: adjust contract for ink_lang changes

* [examples] adjust Erc20 for the ink_lang changes

* [examples] fix some indentation in Cargo.toml

* [examples] adjust DNS contract for ink_lang changes

* [examples] adjust ERC721 for ink_lang changes

There is still a bug that we need to fix in ink_core.

* [example] adjust lib.rs of ERC721 to ink_lang changes

* [examples] adjust Delegator example contract for ink_lang changes

* [lang_macro] generate SpreadLayout and PackedLayout impls for cross-calling wrappers

* [core] release storage2::Stash::entries() iterator for non-testing API

* [core] add SpreadLayout and PackedLayout impls for () type

* [examples] convert multisig contract example to new ink_lang

* [examples] fix incrementer Cargo.toml indentations

* [examples] adjust runtime-storage example contract for ink_lang changes

* [core] apply rustfmt

* [lang] generate correct attributes for messages

* [examples] make use of derive(Default) for DNS example

* [lang_macro] improve some ink! error messages

* [lang_macro] update all compile tests

* [examples] multisig: ignore doc test

This needs serious fixing later! @athei

* [lang] remove old ink_lang abstractions

* [lang] remove no longer needed ink_lang modules

* [lang_macro] add compile test for derive on storage struct

* [examples] ignore failing doc test

* [examples] actually ignore the failing doc-test for multi-sig

* [lang] move v2 module back to origin

* [lang_macro] adjust codegen for new dispatch module structure of ink_lang

* [lang_macro] no longer impl ink_core::{Flush, AllocateUsing} for ink! dependencies

* [lang_macro] use root namespaces in codegen everywhere

* [lang] apply rustfmt

* [lang_macro] use only root namespaces in codegen (forgot some)

* [lang] remove nightly Rust feature usage

* [core] re-export StorageLayout from ink_core::storage2::traits

* [lang,abi] adjust ink! metadata generation codegen to new layout

* [lang] use root namespaces in codegen

* [examples] apply rustfmt

* [lang] update cross-calling codegen for new storage layout

* [examples] update Delegator example contract

* [examples] apply rustfmt

* [abi] remove StorageLayout trait from ink_abi crate

* [examples] apply rustfmt

* [examples] fix clippy warning

* [examples] fix multisig_plain contract

* [examples] apply rustfmt

* [examples] fix clippy warning

* [examples] remove commented out code from multisig_plain example

* [lang] refactor codegen for contract storage struct

* [lang] fix unused import warning

* [lang] eliminate CrossCallingConflictCfg

* [lang] do not generate normal storage struct as dependency

* [lang] re-introduce cross calling conflict cfg codegen

* [lang/macro] refactor codegen for cross-calling

* [lang] add new traits for Event connectors

* [lang/macro] use connectors API for event codegen

* [lang/macro] apply rustfmt

* [lang/macro] remove out-of-ink-module export

* [abi] fix selector encoding

* [lang/macro] fix unused warning

* [examples] adjust example smart contracts for recents ink_lang_macro changes

* [abi] fix unit test for selector

* [chores] update README ink! example

* [alloc] silence warnings of unused unsafe for core::intrinsics::abort

* [examples] apply rustfmt

* [lang/macro] fix codegen for `cargo test`

* [*] replace ink-generate-abi crate feature everywhere with std

* [examples] fix Cargo.toml for generating metadata

* [examples] move flipper/src/lib.rs one up

* [examples] move lib.rs to root folder

* [examples] fix Cargo.toml of ERC721

* [examples] apply rustfmt to ERC20

* [examples] apply rustfmt to ERC721

* [examples] apply rustfmt to all examples

* [abi] remove unused serialize_selector function

* [examples] fix bug that DNS example still used type-metadata crate

* [example] fix bug in multisig_plain example
16 jobs for master in 8 minutes and 16 seconds (queued for 3 seconds)
Status Job ID Name Coverage
  Check
passed #551886
linux-docker
check-std

00:01:46

passed #551887
linux-docker
check-wasm

00:02:00

 
  Workspace
passed #551888
linux-docker
build-std

00:01:01

passed #551889
linux-docker
build-wasm

00:02:39

passed #551892
linux-docker
clippy-std

00:01:46

passed #551893
linux-docker
clippy-wasm

00:00:49

passed #551891
linux-docker
codecov

00:02:58

passed #551894
linux-docker
fmt

00:00:36

passed #551890
linux-docker
test

00:02:57

 
  Examples
passed #551897
linux-docker
examples-clippy-std

00:00:46

passed #551898
linux-docker
examples-clippy-wasm

00:01:05

passed #551899
linux-docker
examples-contract-build

00:01:04

passed #551896
linux-docker
examples-fmt

00:00:16

passed #551900
linux-docker
examples-generate-metadata

00:01:59

passed #551895
linux-docker
examples-test

00:01:44

 
  Publish
passed #551901
linux-docker
publish-docs

00:01:34