Idea: run migration scripts on cargo upgrade
This may be out of scope of cargo-edit, but my writing this down not to forget it.
The idea is that when library authors make a breaking change, they also write a script e.g. in ra_ssr that does the migration for your code wherever possible.
Then cargo-upgrade would pull these migration scripts (assuming some convention for a standard location) and run them.
Imagine a world where even a major upgrade e.g. from tokio 0.2 to tokio 0.3 can be done with a single cargo upgrade :)
This shouldn't be a separate script, just an attribute on a function. See prior art:
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-deprecated/replace-with.html
https://hackernoon.com/how-kotlins-deprecated-relieves-pain-of-colossal-refactoring-8577545aaed
@matklad thanks for the reply. If I understand correctly, an attribute is only capable of replacing invocation of one function with a code snippet, whereas scripts are more flexible and allow you to specify e.g. if you pass this parameter then use that instead or if you're calling this function inside of that function, here is a migration script for you. But to be fair, this is all speculative ATM.
Yup, attrs are indeed restricted, but my gut feeling is that they should cover 80 of automatable migrations.