Closed
Description
I'm seeing an internal compiler error on the following input (found by fuzz-rustc):
macro_rules! suite {
( $( $fn:ident; )* ) => {
$(
const A = "A".$fn();
)*
}
}
suite! {
len;
is_empty;
}
fn main() {}
$ rustc src/main.rs
error: internal compiler error: missing type for `const` item
--> src/main.rs:4:19
|
4 | const A = "A".$fn();
| ^ help: provide a type for the item: `A: <type>`
...
9 | / suite! {
10 | | len;
11 | | is_empty;
12 | | }
| |_- in this macro invocation
|
= note: src/librustc_errors/lib.rs:456: already existing stashed diagnostic with (span = Span { lo: BytePos(80), hi: BytePos(81), ctxt: #3 }, key = ItemNoType)
= note: this error: internal compiler error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:461:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.43.0-nightly (7760cd0fb 2020-02-19) running on x86_64-unknown-linux-gnu
error: missing type for `const` item
--> src/main.rs:4:19
|
4 | const A = "A".$fn();
| ^ help: provide a type for the item: `A: <type>`
...
9 | / suite! {
10 | | len;
11 | | is_empty;
12 | | }
| |_- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 2 previous errors
Metadata
Metadata
Assignees
Labels
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: The lexing & parsing of Rust source code to an ASTArea: Type systemCategory: This is a bug.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️High priorityRelevant to the compiler team, which will review and decide on the PR/issue.ICE tracked in rust-lang/glacier.Performance or correctness regression from one stable version to another.