{"action":"opened","issue":{"url":"https://api.github.com/repos/rust-lang-nursery/rustfix/issues/151","repository_url":"https://api.github.com/repos/rust-lang-nursery/rustfix","labels_url":"https://api.github.com/repos/rust-lang-nursery/rustfix/issues/151/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang-nursery/rustfix/issues/151/comments","events_url":"https://api.github.com/repos/rust-lang-nursery/rustfix/issues/151/events","html_url":"https://github.com/rust-lang-nursery/rustfix/issues/151","id":382846254,"node_id":"MDU6SXNzdWUzODI4NDYyNTQ=","number":151,"title":"Guided renames by deprecations","user":{"login":"bluss","id":3209739,"node_id":"MDQ6VXNlcjMyMDk3Mzk=","avatar_url":"https://avatars1.githubusercontent.com/u/3209739?v=4","gravatar_id":"","url":"https://api.github.com/users/bluss","html_url":"https://github.com/bluss","followers_url":"https://api.github.com/users/bluss/followers","following_url":"https://api.github.com/users/bluss/following{/other_user}","gists_url":"https://api.github.com/users/bluss/gists{/gist_id}","starred_url":"https://api.github.com/users/bluss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluss/subscriptions","organizations_url":"https://api.github.com/users/bluss/orgs","repos_url":"https://api.github.com/users/bluss/repos","events_url":"https://api.github.com/users/bluss/events{/privacy}","received_events_url":"https://api.github.com/users/bluss/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-20T21:00:24Z","updated_at":"2018-11-20T21:00:24Z","closed_at":null,"author_association":"NONE","body":"Excuse me if this is not the right place to bring this up.\r\n\r\nWhat 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.\r\n\r\n```rust\r\n#[deprecated(note=\"Renamed to `new_name`\")]\r\npub fn old_name(x: i32) -> i32 {\r\n    new_name(x)\r\n}\r\n\r\npub fn new_name(x: i32) -> i32 {\r\n    unimplemented!()\r\n}\r\n```\r\n\r\nHere's the rustc warning:\r\n\r\n```rust\r\nWarning: use of deprecated item 'old_name': Renamed to `new_name`\r\n  --> src/visit/reversed.rs:56:40\r\n   |\r\n56 |         old_name(3)\r\n   |         ^^^^^^^^\r\n   |\r\n   = note: #[warn(deprecated)] on by default\r\n```\r\n\r\nIn 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\")]`"}}
{"actor":{"display_login":"bluss"}}