Skip to content

array_vec! doesn't seem to work in all cases until you reorder macros' match arms. #142

@InnocentusLime

Description

@InnocentusLime

The current array_vec macro seems to have problems with some inputs. If you give it the following input

// Somewhere in your codebase
struct T(i32);

impl T {
    fn new(x:i32) -> T { T(x) }
}

// Calling the macro
fn main() {
  array_vec!(T::new(2));
}

The compilation will terminate with an error saying

Expected type, found 2

This seems to be an issue even in general cases as shown by this example.

As of this writing, I am not sure if this is because of some kind of bug inside rustc or not, so I am opening the issue here for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions