Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom inner attribute #![rustfmt::skip] stopped working in Rust 1.52.0 (and 1.52.1) #86333

Closed
mikebenfield opened this issue Jun 15, 2021 · 2 comments
Labels
C-bug Category: This is a bug.

Comments

@mikebenfield
Copy link
Contributor

As I understand the comments on this tracking issue, the inner attribute #![rustfmt::skip] is supposed to work, and indeed it does on Rust 1.44 through 1.51. But on 1.52.0 and 1.52.1 it fails.

It's very possible I'm misunderstanding the comments on that issue, and this is a deliberate change; I certainly see that the error message says warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!, but I'm not sure whether that really is meant to apply to this version. It certainly seems from the issue comments that it was a deliberate choice to allow this to work.

Example:

mbenfield@mbenfield:~/Code$ git clone https://github.com/steveklabnik/semver-parser
<...snip...>
mbenfield@mbenfield:~/Code$ cd semver-parser/
mbenfield@mbenfield:~/Code/semver-parser$ git checkout 4ad3c7b10496d0007af2f327cb50a9897b5b969f
<...snip...>
mbenfield@mbenfield:~/Code/semver-parser$ rustup default 1.52.1
<...snip...>
mbenfield@mbenfield:~/Code/semver-parser$ cargo build
    Updating crates.io index
   Compiling ucd-trie v0.1.3
   Compiling pest v2.1.3
   Compiling semver-parser v0.10.1 (/usr/local/google/home/mbenfield/Code/semver-parser)
error: custom inner attributes are unstable
 --> src/generated.rs:4:4
  |
4 | #![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>

error: aborting due to previous error

error: could not compile `semver-parser`

To learn more, run the command again with --verbose.
mbenfield@mbenfield:~/Code/semver-parser$ rustup default 1.51.0
<...snip...>
mbenfield@mbenfield:~/Code/semver-parser$ cargo build
   Compiling ucd-trie v0.1.3
   Compiling pest v2.1.3
   Compiling semver-parser v0.10.1 (/usr/local/google/home/mbenfield/Code/semver-parser)
    Finished dev [unoptimized   debuginfo] target(s) in 3.56s

@mikebenfield mikebenfield added the C-bug Category: This is a bug. label Jun 15, 2021
@ehuss
Copy link
Contributor

ehuss commented Jun 15, 2021

This was an intended change as part of #82399. It was unintentionally ignored in 1.44, and should have required feature(custom_inner_attributes).

@JohnTitor
Copy link
Member

Going to close in favor of the above, thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants