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

ICE when using macro as for loop parameter #27004

Closed
milesrout opened this issue Jul 13, 2015 · 1 comment
Closed

ICE when using macro as for loop parameter #27004

milesrout opened this issue Jul 13, 2015 · 1 comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@milesrout
Copy link

macro_rules! foo {
    () => ()
}

pub fn main () {
    for foo!() in (1..) {
    }
}

error:

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: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'fold_mac disabled by default', /home/rustbuild/src/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libsyntax/fold.rs:190


playpen: application terminated with error code 101

version is whatever is considered stable by play.rust-lang.org at 3:30pm UTC+12 13/07/2015, but also for the nightly and beta releases.

@Aatch Aatch added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) labels Jul 13, 2015
@Aatch
Copy link
Contributor

Aatch commented Jul 13, 2015

I haven't looked yet, but I assume that this is due to the order in which expansions happen. With the for expansion happening before macro expansions. I'm not familiar enough with the code to know if simply doing macro expansion first is a sensible fix or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants