Skip to content

ICE when using macro as for loop parameter #27004

Closed
@milesrout

Description

@milesrout
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions