Commit d5c95b21 authored by Robin Freyler's avatar Robin Freyler

[lang2/macro] improve diagnostics for unsupported ink! markers on structs

parent 273b68c1
......@@ -612,10 +612,23 @@ impl TryFrom<syn::Item> for ir::Item {
.map(ir::Item::Ink)
},
(None, None) => {
Err(format_err!(
item_struct,
"encountered unsupported ink! markers for struct",
))
Err(markers
.iter()
.map(|marker| {
format_err_span!(
marker.span(),
"unsupported ink! marker for struct")
})
.fold(
format_err!(
item_struct,
"encountered unsupported ink! markers for struct",
),
|mut err1, err2| {
err1.combine(err2);
err1
})
)
}
(Some(storage_marker), Some(event_marker)) => {
// Special case: We have both #[ink(storage)] and #[ink(event)].
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment