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

Can't bound types with paths from macros #8521

Closed
alexcrichton opened this issue Aug 15, 2013 · 4 comments
Closed

Can't bound types with paths from macros #8521

alexcrichton opened this issue Aug 15, 2013 · 4 comments
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-syntaxext Area: Syntax extensions P-low Low priority

Comments

@alexcrichton
Copy link
Member

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?

@emberian
Copy link
Member

Still an issue with 63cfc99

@pnkfelix
Copy link
Member

Assigning P-low, not a 1.0 blocker.

@steveklabnik
Copy link
Member

Triage:

hello.rs:2:16: 2:18 error: expected one of `,`, `=`, `>`, or `?`, found `A`
hello.rs:2         impl<T:$t> Foo for T {}
                          ^~

@steveklabnik steveklabnik added the A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) label Apr 20, 2015
@arielb1 arielb1 removed the I-wrong label Dec 2, 2015
@KalitaAlexey
Copy link
Contributor

KalitaAlexey commented Dec 7, 2016

Hi @steveklabnik,
I am working on it. Please assign it to me.

bors added a commit that referenced this issue Dec 17, 2016
macros: allow a `path` fragment to be parsed as a type parameter bound

Allow a `path` fragment to be parsed as a type parameter bound.
Fixes #8521.
flip1995 pushed a commit to flip1995/rust that referenced this issue May 5, 2022
add `trim_split_whitespace`

Closes rust-lang#8521

changelog: [`trim_split_whitespace`]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-syntaxext Area: Syntax extensions P-low Low priority
Projects
None yet
Development

No branches or pull requests

6 participants