Skip to content

tool_attributes feature stops working when rust_2018_preview feature is enabled #51277

Closed
@flip1995

Description

@flip1995

If both features tool_attributes and rust_2018_preview are enabled, scoped attributes lead to the error message

error[E0658]: paths of length greater than one in macro invocations are currently unstable (see issue #38356)
 --> src/main.rs:4:3
  |
4 | #[rustfmt::skip]
  |   ^^^^^^^^^^^^^
  |
  = help: add #![feature(proc_macro_path_invoc)] to the crate attributes to enable

I think this can be fixed by doing this #47773 (review) right. I would like to try and fix this, but I need some pointers where to start.

This needs to be fixed, so clippy can use the new scoped attributes instead of the old cfg_attrs (rust-lang/rust-clippy#2823).

I tried this code:

#![feature(tool_attributes)]
#![feature(rust_2018_preview)]

#[rustfmt::skip]
fn main() {
    //code not to format
}

Playground
This should compile without errors, but gives the error above

Meta

rustc 1.28.0-nightly (5d0631a64 2018-05-30)
binary: rustc
commit-hash: 5d0631a6438cf30cac236b7176371663e35c8d07
commit-date: 2018-05-30
host: x86_64-unknown-linux-gnu
release: 1.28.0-nightly
LLVM version: 6.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions