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: parenthesized parameters cannot appear in ExprPath #39749

Closed
matt36 opened this issue Feb 11, 2017 · 1 comment
Closed

ICE: parenthesized parameters cannot appear in ExprPath #39749

matt36 opened this issue Feb 11, 2017 · 1 comment

Comments

@matt36
Copy link

matt36 commented Feb 11, 2017

Code

https://play.rust-lang.org/?gist=2eb5e614583b7612d132678938efd615&version=nightly&backtrace=0

enum Foo {
    X,
}

enum Bar {
    Y(Foo),
}

struct Entry {
    op: Bar,
}

macro_rules! entry {
    ($op:path) => (
        Entry { op: $op }
    )
}

static TABLE: [Entry; 1] = [
    entry!(Bar::Y(Foo::X)),
];

Result

error[E0573]: expected type, found variant `Foo::X`
  --> <anon>:20:19
   |
20 |     entry!(Bar::Y(Foo::X)),
   |     --------------^^^^^^--
   |     |             |
   |     |             not a type
   |     in this macro invocation

error: internal compiler error: /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/librustc_typeck/check/mod.rs:4507: parenthesized parameters cannot appear in ExprPath
  --> <anon>:15:25
   |
15 |         Entry { op: $op }
   |                         ^
...
20 |     entry!(Bar::Y(Foo::X)),
   |     ---------------------- in this macro invocation

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

thread 'rustc' panicked at 'Box<Any>', /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/librustc_errors/lib.rs:376
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Meta

Same result on these versions of rust currently available on play.rust-lang.org

rustc 1.15.1 (021bd294c 2017-02-08)
rustc 1.16.0-beta.1 (5276ba72e 2017-01-31)
rustc 1.17.0-nightly (24a70eb59 2017-02-09)
@petrochenkov
Copy link
Contributor

Duplicate of #39687

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants