Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
I
ink
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
parity
ink
Commits
a96f594d
Unverified
Commit
a96f594d
authored
Nov 10, 2019
by
Robin Freyler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[lang2/macro] add test for multiple #[ink(storage)] structs
parent
8c10bd44
Pipeline
#56452
failed with stages
in 1 minute and 47 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
0 deletions
+43
-0
lang2/macro/tests/compile_tests.rs
lang2/macro/tests/compile_tests.rs
+1
-0
lang2/macro/tests/ui/fail/15-multiple-storage-structs.rs
lang2/macro/tests/ui/fail/15-multiple-storage-structs.rs
+31
-0
lang2/macro/tests/ui/fail/15-multiple-storage-structs.stderr
lang2/macro/tests/ui/fail/15-multiple-storage-structs.stderr
+11
-0
No files found.
lang2/macro/tests/compile_tests.rs
View file @
a96f594d
...
...
@@ -38,4 +38,5 @@ fn compile_tests() {
t
.compile_fail
(
"tests/ui/fail/12-const-constructor.rs"
);
t
.compile_fail
(
"tests/ui/fail/13-abi-constructor.rs"
);
t
.compile_fail
(
"tests/ui/fail/14-missing-storage-struct.rs"
);
t
.compile_fail
(
"tests/ui/fail/15-multiple-storage-structs.rs"
);
}
lang2/macro/tests/ui/fail/15-multiple-storage-structs.rs
0 → 100644
View file @
a96f594d
#![feature(proc_macro_hygiene)]
use
ink_lang2
as
ink
;
#[ink::contract(version
=
"0.1.0"
)]
mod
noop
{
#[ink(storage)]
struct
FirstStorage
{}
// ink! currently doesn't allow for multiple #[ink(storage)] structs
#[ink(storage)]
struct
SecondStorage
{}
impl
FirstStorage
{
#[ink(constructor)]
fn
new
(
&
mut
self
)
{}
#[ink(message)]
fn
do_something
(
&
self
)
{}
}
impl
SecondStorage
{
#[ink(constructor)]
fn
new
(
&
mut
self
)
{}
#[ink(message)]
fn
do_something
(
&
self
)
{}
}
}
fn
main
()
{}
lang2/macro/tests/ui/fail/15-multiple-storage-structs.stderr
0 → 100644
View file @
a96f594d
error: 2 conflicting storage struct found
--> $DIR/15-multiple-storage-structs.rs:8:12
|
8 | struct FirstStorage {}
| ^^^^^^^^^^^^
error: 2 conflicting storage struct found
--> $DIR/15-multiple-storage-structs.rs:12:12
|
12 | struct SecondStorage {}
| ^^^^^^^^^^^^^
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment