This repository was archived by the owner on Nov 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
Guided renames by deprecations #151
Comments
Very interesting! Technically, this will require attibutes (or, this specific attribute) to produce diagnostic messages that contain suggestions -- which I think is already somewhat possible with proc macros? |
Technically, the attribute will already show the diagnostic message – we'd just need to match the note (e.g. "renamed to ...") and set the applicability if it fits. |
rustc_deprecated supports the |
This is tracked in rust-lang/rust#94785. |
Closing in preference to rust-lang/rust#94785. |
# for free
to subscribe to this conversation on GitHub.
Already have an account?
#.
Uh oh!
There was an error while loading. Please reload this page.
(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.Here's the rustc warning:
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")]
The text was updated successfully, but these errors were encountered: