-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-proc-macrosArea: Procedural macrosArea: Procedural macrosC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-criticalCritical priorityCritical priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Description
Between nightly-2020-08-29 and nightly-2020-09-02, the following began printing an ICE message (despite compiling successfully).
The relevant compiler commit range is d006f57...130359c. #75082 appears extremely relevant so mentioning @Aaron1011 @petrochenkov. From the PR description it sounds like the PR was intended to have no effect unless the new -Z flag is passed. Is it possible it could be causing this?
Cargo.toml
[package]
name = "repro"
version = "0.0.0"
edition = "2018"
[lib]
proc-macro = true
src/lib.rs
use proc_macro::{Ident, Span, TokenStream};
#[proc_macro]
pub fn m(_input: TokenStream) -> TokenStream {
let _ = std::panic::catch_unwind(|| Ident::new("", Span::call_site()));
TokenStream::new()
}
src/main.rs
repro::m!();
fn main() {}
Before:
$ cargo +nightly-2020-08-29 check
Compiling repro v0.0.0
Finished dev [unoptimized + debuginfo] target(s) in 0.28s
After:
$ cargo +nightly-2020-09-02 check
Compiling repro v0.0.0
thread 'rustc' panicked at '`""` is not a valid identifier', compiler/rustc_expand/src/proc_macro_server.rs:332:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.48.0-nightly (80fc9b0ec 2020-09-02) running on x86_64-unknown-linux-gnu
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin
note: some of the compiler flags provided by cargo are hidden
Finished dev [unoptimized + debuginfo] target(s) in 0.17s
Metadata
Metadata
Assignees
Labels
A-proc-macrosArea: Procedural macrosArea: Procedural macrosC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-criticalCritical priorityCritical priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.