Skip to content

Infinite loop in macro expansion #3829

Description

@nikomatsakis

This program (which, as far as I can tell, is ok?) seems to loop infinitely:

fn macros() {
    macro_rules! if_ok(
        ($inp: expr) => (
            match $inp {
                Ok(move v) => { move v }
                Err(move e) => { return Err(e); }
            }
        )
    );
}

fn main() {
    let r = Ok(2);
    let p = if_ok!(move r);
    assert p == 2;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-syntaxextArea: Syntax extensionsI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions