Skip to content

Commit

Permalink
Adapt fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
cmichi committed Nov 10, 2020
1 parent 846ec15 commit 174c012
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
8 changes: 6 additions & 2 deletions crates/lang/macro/tests/ui/fail/S-04-non-storage-ink-impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ mod non_storage_ink_impls {
// This ink! impl block is okay.
impl StorageStruct {
#[ink(constructor)]
pub fn constructor1() -> Self {}
pub fn constructor1() -> Self {
Self {}
}

#[ink(message)]
pub fn message1(&self) {}
Expand All @@ -25,7 +27,9 @@ mod non_storage_ink_impls {
// storage struct. We expect a failure here.
impl NonStorageStruct {
#[ink(constructor)]
pub fn constructor2() -> Self {}
pub fn constructor2() -> Self {
Self {}
}

#[ink(message)]
pub fn message2(&self) {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error[E0271]: type mismatch resolving `<NonStorageStruct as non_storage_ink_impls::_::_::{closure#0}::TypeEq>::This == StorageStruct`
--> $DIR/S-04-non-storage-ink-impls.rs:26:10
--> $DIR/S-04-non-storage-ink-impls.rs:28:10
|
26 | impl NonStorageStruct {
28 | impl NonStorageStruct {
| ^^^^^^^^^^^^^^^^
| |
| expected struct `StorageStruct`, found struct `NonStorageStruct`
Expand All @@ -11,24 +11,24 @@ error[E0271]: type mismatch resolving `<NonStorageStruct as non_storage_ink_impl
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no function or associated item named `constructor2` found for struct `StorageStruct` in the current scope
--> $DIR/S-04-non-storage-ink-impls.rs:28:16
--> $DIR/S-04-non-storage-ink-impls.rs:30:16
|
9 | pub struct StorageStruct {}
| ------------------------ function or associated item `constructor2` not found for this
...
28 | pub fn constructor2() -> Self {}
30 | pub fn constructor2() -> Self {
| ^^^^^^^^^^^^
| |
| function or associated item not found in `StorageStruct`
| help: there is an associated function with a similar name: `constructor1`

error[E0599]: no function or associated item named `message2` found for struct `StorageStruct` in the current scope
--> $DIR/S-04-non-storage-ink-impls.rs:31:16
--> $DIR/S-04-non-storage-ink-impls.rs:35:16
|
9 | pub struct StorageStruct {}
| ------------------------ function or associated item `message2` not found for this
...
31 | pub fn message2(&self) {}
35 | pub fn message2(&self) {}
| ^^^^^^^^
| |
| function or associated item not found in `StorageStruct`
Expand Down

0 comments on commit 174c012

Please sign in to comment.