Skip to content

Failed to automatically apply fixes to a procedural macro crate #6101

Closed
@dtolnay

Description

@dtolnay

Cargo.toml

[package]
name = "procedural"
version = "0.0.1"
authors = ["David Tolnay <[email protected]>"]
edition = "2018"

[lib]
proc-macro = true

src/lib.rs

extern crate proc_macro;
use self::proc_macro::TokenStream;

#[proc_macro]
pub fn demo(_input: TokenStream) -> TokenStream {
    TokenStream::new()
}

Running cargo fix --edition-idioms I get:

warning: failed to automatically apply fixes suggested by rustc to crate `procedural`

after fixes were automatically applied the compiler reported errors within these files:

  * src/lib.rs

This likely indicates a bug in either rustc or cargo itself,
and we would appreciate a bug report! You're likely to see 
a number of compiler warnings after this message which cargo
attempted to fix but failed. If you could open an issue at
https://github.com/rust-lang/cargo/issues
quoting the full output of this command we'd be very appreciative!

warning: `extern crate` is not idiomatic in the new edition
 --> src/lib.rs:1:1
  |
1 | extern crate proc_macro;
  | ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert it to a `use`
  |
  = note: `-W unused-extern-crates` implied by `-W rust-2018-idioms`

warning: `extern crate` is not idiomatic in the new edition
 --> src/lib.rs:1:1
  |
1 | extern crate proc_macro;
  | ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert it to a `use`
  |
  = note: `-W unused-extern-crates` implied by `-W rust-2018-idioms`

Metadata

Metadata

Assignees

No one assigned

    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