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

Calling a non-function as a function in a macro causes panic #26237

Closed
grantslatton opened this issue Jun 12, 2015 · 2 comments
Closed

Calling a non-function as a function in a macro causes panic #26237

grantslatton opened this issue Jun 12, 2015 · 2 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@grantslatton
Copy link

See http://is.gd/X3gtGi

Code:

macro_rules! macro_panic {
    ($not_a_function:expr, $some_argument:ident) => { 
        $not_a_function($some_argument)
    }   
}

fn main() {
    let mut value_a = 0;
    let mut value_b = 0;
    macro_panic!(value_a, value_b);
}

Output:

error: expected function, found `_`
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
@mitaa
Copy link
Contributor

mitaa commented Jun 12, 2015

Related to #25385, #26093, #26094

@steveklabnik steveklabnik added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jun 12, 2015
@arielb1
Copy link
Contributor

arielb1 commented Oct 23, 2015

This is another "internal compiler error: unprintable span"

@bors bors closed this as completed in b285ebc Jan 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants