[lang2/macro] improve diagnostics for multiple #[ink(storage)] structs

parent 8451cf37
...@@ -686,13 +686,16 @@ fn split_items( ...@@ -686,13 +686,16 @@ fn split_items(
Err(storages Err(storages
.iter() .iter()
.map(|storage| { .map(|storage| {
format_err!(storage.ident, "{} conflicting storage struct found", n) format_err!(storage.ident, "conflicting storage struct")
}) })
.fold1(|mut err1, err2| { .fold(
format_err_span!(Span::call_site(), "encountered {} conflicting storage structs", n),
|mut err1, err2| {
err1.combine(err2); err1.combine(err2);
err1 err1
}) }
.expect("there must be at least 2 conflicting storages; qed")) )
)
} }
}?; }?;
let (events, impl_blocks): (Vec<ir::ItemEvent>, Vec<ir::ItemImpl>) = let (events, impl_blocks): (Vec<ir::ItemEvent>, Vec<ir::ItemImpl>) =
......
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