-
Notifications
You must be signed in to change notification settings - Fork 708
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
sp-api
: Propagate deprecation information to metadata from impl_runtime_apis!
blocks
#6394
base: master
Are you sure you want to change the base?
Conversation
/cmd fmt |
Command "fmt" has started 🚀 See logs here |
Command "fmt" has finished ✅ See logs here |
Why should I override the deprecation notice in the impl block? |
I guess I need to reword. In case of deprecation attribute being present on the same member in both |
Yeah, I mean I got this. My question still holds, why should I put a deprecate message into the impl block? IMO we should do what rust is doing and return an error: rust-lang/rust#78626 |
My 2c: In "normal" rust, it makes sense that deprecation attributes only exist on trait declarations: I define a trait and then want implementors of my trait to know if I am planning to remove some function of it, ie
In this runtime stuff, we may want to inform runtime developers that some runtime API trait function is deprecated (via usual rust mechanisms), but also we want to inform users calling into a runtime that some part of the runtime interface is deprecated (via metadata), so we have two targets now ie
And so, if I am a runtime developer, I may deprecate some Runtime API_implementations_ to signal that the runtime is moving to using some different Runtime APIs, or planning to jump to a newer version of some trait and stop supporting the older one, or just planning to remove some implementations entirely. It also makes sense to me that |
Yeah good argument. Maybe we should then differ between |
I haven't though about this long enough, but offhand I can't think of a time when it would matter to users where the deprecation came from at the moment; only that the method was deprecated and then the reason for it, if provided. |
Description
Now its possible to deprecate an
ApiTrait
or aMethod
insideimpl_runtime_apis!
blocks.If a deprecation attribute was present inside
decl_runtime_apis!
block then it is overriden with information fromimpl_runtime_apis!
block.ie:
The resulting deprecation string inside metadata for method
example
will be"overriden"
Review Notes
Adds additional argument to
<trait_>::runtime_metadata
to pass the deprecation information from the implementations.