rust-lang/rustfix

rustfix doesn't fix "use of deprecated item" warnings

samuela opened this issue · 2 comments

I have a bunch of "use of deprecated item warnings" that look like

warning: use of deprecated item 'libc::fixed_width_ints::uint32_t': Use u32 instead.
  --> util_linux/volume_id/xfs.rs:78:16
   |
78 |   pub dummy3: [uint32_t; 2],
   |                ^^^^^^^^

These would seem to be very straightforward to auto-fix since the alternative is presented in the warning itself.

Hey, thanks for the report! Sadly, this repo is just for the library that applies machine-readable suggestions. Making suggestions like this applicable is an issue for the main rust-lang/rust repo, as it is generated by the compiler. (Once it's fixed there, the rustfix tool can automatically apply it.)

I do however fear that it's not as easy as it seems: Library authors can pretty much add a random string there:

https://github.com/rust-lang/libc/blob/13d4a5da2eafd82d3ebb2acb729d8b8c9148fb1f/src/fixed_width_ints.rs#L17-L18

So there's no way for us to apply this suggestion without having a program interpret English text!

Can you maybe check if there is an issue alread on the rust-lang/rust repo for this? Otherwise you are very welcome to suggest how to extend this attribute to make it applicable!

Thanks again :)

@killercup Mm, I see. It would be great if there was more structured information in the deprecation notice. But of course that's an issue for rust-lang/rust...