rust-protobuf
rust-protobuf copied to clipboard
warning about rustfmt::skip with nightly rustc
I updated my rust toolchain today and it seems it started failing on rust-protobuf's generated code since then. The failures look like this:
|
9 | #![rustfmt::skip]
| ^^^^^^^^^^^^^
|
= note: `#[deny(soft_unstable)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #64266 <https://github.com/rust-lang/rust/issues/64266>
I have the same problem here.
I have the same problem here.
version:nightly-x86_64-pc-windows-msvc unchanged - rustc 1.52.0-nightly (107896c32 2021-03-15)
This is due to https://github.com/rust-lang/rust/pull/82399 although I can't figure out why we didn't see a warning before.
In case it helps someone: a workaround is to add #![allow(soft_unstable)] to your crate root (such as lib.rs).
Does anyone know how to fix the issue? (I don't have time right now to investigate, will return in a couple days, but right now I can commit a fix if the fix is known).
You can use #![cfg_attr(rustfmt, rustfmt_skip)] instead.
About a year ago we migrated from rustfmt_skip to rustfmt::skip because rustfmt_skip became deprecated. Did they undeprecate it back?
Moreover, rustfmt officially recommends using rustfmt::skip and does not even mention rustfmt_skip.
I think the problem is using it as an inner attribute (#![...]) rather than an outer attribute (#[...]). I'm not up to speed with why this is a problem now though. rustfmt_skip in cfg_attr is a desugaring, I think.
OK, I did this as temporary workaround until we find the proper fix: https://github.com/stepancheg/rust-protobuf/commit/6069c64ed162edcc4d89e000ef7abf027638548c.
Any reason not to release a new stable version with this change?
Published version 2.22.1 with the workaround. Let me know if similar fix is needed in older 2.x versions.
Keeping this issue open because we need to find a proper fix.