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

rustc fails with unknown feature proc_macro_span_shrink #113170

Closed
dubek opened this issue Jun 29, 2023 · 2 comments
Closed

rustc fails with unknown feature proc_macro_span_shrink #113170

dubek opened this issue Jun 29, 2023 · 2 comments
Labels
C-bug Category: This is a bug.

Comments

@dubek
Copy link

dubek commented Jun 29, 2023

I tried to build this simple project (mainly I tried to compile the proc-macro2 crate):

Cargo.toml:

[package]
name = "t1"
version = "0.1.0"
edition = "2021"

[dependencies]
proc-macro2 = "=1.0.56"

rust-toolchain.toml:

[toolchain]
channel = "nightly"

src/main.rs:

fn main() {
    println!("Hello, world!");
}

I expected to see this happen: it compiles

Instead, this happened:

$ cargo build
   Compiling proc-macro2 v1.0.56
   Compiling unicode-ident v1.0.9
error[E0635]: unknown feature `proc_macro_span_shrink`
  --> /home/dov/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.56/src/lib.rs:92:30
   |
92 |     feature(proc_macro_span, proc_macro_span_shrink)
   |                              ^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0635`.
error: could not compile `proc-macro2` (lib) due to previous error

Meta

rustc --version --verbose:

rustc 1.72.0-nightly (5bd28f5ea 2023-06-28)
binary: rustc
commit-hash: 5bd28f5eac1ba3569bfa8d49ec3f5acbdfdff7a0
commit-date: 2023-06-28
host: x86_64-unknown-linux-gnu
release: 1.72.0-nightly
LLVM version: 16.0.5
Backtrace

   Compiling proc-macro2 v1.0.56
   Compiling unicode-ident v1.0.9
error[E0635]: unknown feature `proc_macro_span_shrink`
  --> /home/dov/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.56/src/lib.rs:92:30
   |
92 |     feature(proc_macro_span, proc_macro_span_shrink)
   |                              ^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0635`.
error: could not compile `proc-macro2` (lib) due to previous error

@dubek dubek added the C-bug Category: This is a bug. label Jun 29, 2023
@dubek
Copy link
Author

dubek commented Jun 29, 2023

hmm, it seems that this is solved in proc_macro2 1.0.60 (and newer).

so maybe not a rustc problem?

@lqd
Copy link
Member

lqd commented Jun 29, 2023

Yes, this is #113152

@jyn514 jyn514 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 30, 2023
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