Repository navigation
Macro ICE #68058
Copy link
Copy link
Closed
Labels
A-HIRArea: The high-level intermediate representation (HIR)Area: The high-level intermediate representation (HIR)A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-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) ❄️T-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.
Description
This code
macro_rules! def_target {
($target: expr) => {
#[target_feature(enable=$target)]
unsafe fn f() {
#[target_feature(enable=$target)]
()
}
};
}
def_target!("avx2");
fn main() {}Produces ICE on any channel:
Compiling playground v0.0.1 (/playground)
thread 'rustc' panicked at 'src/librustc/ich/impls_syntax.rs:326: interpolated tokens should not be present in the HIR', src/librustc/util/bug.rs:37:26
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/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.40.0 (73528e339 2019-12-16) running on x86_64-unknown-linux-gnu
note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type bin
note: some of the compiler flags provided by cargo are hidden
error: could not compile `playground`.
Metadata
Metadata
Assignees
Labels
A-HIRArea: The high-level intermediate representation (HIR)Area: The high-level intermediate representation (HIR)A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-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) ❄️T-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.
Activity
petrochenkov commentedon Jan 9, 2020
The fix is the
src/librustc/hir/lowering/expr.rspart of #67121, feel free to apply it and make a PR.Fix ICE rust-lang#68058
petrochenkov commentedon Jan 10, 2020
Fixed in #68072.
Rollup merge of rust-lang#68072 - JohnTitor:fix-macro-ice, r=petroche…
Rollup merge of rust-lang#68072 - JohnTitor:fix-macro-ice, r=petroche…
Rollup merge of rust-lang#68072 - JohnTitor:fix-macro-ice, r=petroche…
Auto merge of #68124 - Centril:rollup-4h2ybcj, r=Centril
Rollup merge of rust-lang#68072 - JohnTitor:fix-macro-ice, r=petroche…
Auto merge of #68126 - Centril:rollup-cz5u7xx, r=Centril