-
Notifications
You must be signed in to change notification settings - Fork 99
Disallow duplicate indexes using constant evaluation #653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* improve error message * Apply suggestions from code review Co-authored-by: Bastian Köcher <[email protected]> * finally understanding rust const environment * fmt --------- Co-authored-by: Bastian Köcher <[email protected]>
I was basing my PR on top of yours, so I re-opened it. @bkchr if you like it we can merge it |
paritytech/parity-scale-codec/pull/653 disallowed duplicate indexes for variants.
paritytech/parity-scale-codec/pull/653 disallowed duplicate indexes for variants.
* chore: mark TypeInfo derived impl as automatically_derived As per rust-lang/rust#120185, functions with their enclosing impl body marked as `#[automatically_derived]` won't be featured in coverage reports. * chore: elide lifetimes * Update tests.rs paritytech/parity-scale-codec/pull/653 disallowed duplicate indexes for variants. * fix: ui tests were outdated
This was actually a major change that we released as a patch... it broke the docs build here https://docs.rs/crate/polkadot-sdk/0.12.1/builds/1788762 Also there was no CHANGELOG entry here? |
Since this is arguably a breaking fix, do you think patch is still fine? |
Yes, before this invalid code was emitted. |
A fix should have been pushed for the crates in 2412, 2409 and 2407, maybe polkadot-sdk 0.12.1 is an earlier version? or some crates have been missed. Because we released and yank versions, sorry for that, the automatic changelog missed, I manually added it. EDIT: I think
|
Since there hasn't been any error report from any customer could we just fix the docs and keep this release ? Sorry, I thought this change wasn't major since it doesn't change any interface or structure. It just adds a check for duplicate indexes, which should prevent misusing the library. |
Description
following a suggestion from here #628 (comment)
Notes
It seems that it's not possible to have a good error message this way, as
format!
in cant be used in constant_blocks, so string interpolation is not possible unless we pick upconst_format
and re-export it from the library.