Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
I
ink
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
parity
ink
Commits
71f62058
Unverified
Commit
71f62058
authored
Nov 10, 2019
by
Robin Freyler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[lang2/macro] add ui test for storage-impl conflict
parent
a96f594d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
lang2/macro/tests/compile_tests.rs
lang2/macro/tests/compile_tests.rs
+1
-0
lang2/macro/tests/ui/fail/16-storage-impl-ident-conflict.rs
lang2/macro/tests/ui/fail/16-storage-impl-ident-conflict.rs
+37
-0
No files found.
lang2/macro/tests/compile_tests.rs
View file @
71f62058
...
...
@@ -39,4 +39,5 @@ fn compile_tests() {
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"
);
t
.compile_fail
(
"tests/ui/fail/16-storage-impl-ident-conflict.rs"
);
}
lang2/macro/tests/ui/fail/16-storage-impl-ident-conflict.rs
0 → 100644
View file @
71f62058
#![feature(proc_macro_hygiene)]
use
ink_lang2
as
ink
;
#[ink::contract(version
=
"0.1.0"
)]
mod
noop
{
// This test ensures that ink! impl blocks are always
// implemented on the only storage struct definition.
#[ink(storage)]
struct
StorageStruct
{}
// This ink! impl block is okay.
impl
StorageStruct
{
#[ink(constructor)]
fn
new1
(
&
mut
self
)
{}
#[ink(message)]
fn
do_something1
(
&
self
)
{}
}
// Missing the #[ink(storage)] attribute on purpose.
struct
NonStorageStruct
{}
// This ink! impl block is invalid in that it implement
// the messages and constructors for a non-existing ink!
// storage struct. We expect a failure here.
impl
NonStorageStruct
{
#[ink(constructor)]
fn
new2
(
&
mut
self
)
{}
#[ink(message)]
fn
do_something2
(
&
self
)
{}
}
}
fn
main
()
{}
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