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

How to build path of two idents? #279

Open
obsoleszenz opened this issue Aug 21, 2024 · 1 comment
Open

How to build path of two idents? #279

obsoleszenz opened this issue Aug 21, 2024 · 1 comment

Comments

@obsoleszenz
Copy link

I want to create a Foo::Bartoken stream and am currently trying it like this:

let foo = format_ident!("Foo");
let bar = format_ident!("Bar");
quote! {
  #foo::#bar
}

but this results in a token stream of `Foo :: Bar` which the compiler doesn't accept. 
@Odilf
Copy link

Odilf commented Oct 26, 2024

You can do it with format_ident

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