You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 24, 2023. It is now read-only.
(Excuse me if this is not the right place to bring this up.)
What if a library could use #[deprecated] + a convention about what to put in the note to enable cargo fix to automatically fix the deprecation, if it's due to a rename.
#[deprecated(note="Renamed to `new_name`")]pubfnold_name(x:i32) -> i32{new_name(x)}pubfnnew_name(x:i32) -> i32{unimplemented!()}
Here's the rustc warning:
Warning:use of deprecated item 'old_name':Renamed to `new_name`
--> src/visit/reversed.rs:56:40
|
56 | old_name(3)
| ^^^^^^^^
|
= note: #[warn(deprecated)] on by default
In that sense it is guided by rustc. I don't know at all if this is doable, but I imagine it would require some kind of agreed "protocol" for the format of the deprecation message. A more formal way to go about it would be to design this in rustc and for example use a new attribute or a new option on the attribute like #[deprecated(renamed_to="new_name")]