Skip to content

Can't bound types with paths from macros #8521

@alexcrichton

Description

@alexcrichton

This code:

macro_rules! foo(($t:path) => {
    impl<T:$t> Foo for T {}
})

foo!(A)

fn main() {}

fails with

foo.rs:2:12: 2:13 error: expected `,` but found `an interpolated path`
foo.rs:2     impl<T:$t> Foo for T {}
                     ^

I may be doing something wrong, but this should be allowed, right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-syntaxextArea: Syntax extensionsP-lowLow priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions