-
-
Notifications
You must be signed in to change notification settings - Fork 313
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 create an ident from a string #546
Comments
|
👍 |
closing because I fold. I couldn't find a |
One of the main reasons |
The 1.15 compatibility is a side benefit. The main reason is that none of the data structures from I would like to see even more code move to proc-macro2 by having the compiler accept proc-macro2 types in the signature of #[proc_macro_derive] functions. That way nothing would depend on |
Yeah, I forgot that I used
With rust-lang/rust#49219 using |
@hcpl rust-lang/rust#49219 is not related to this. It does not make proc_macro usable outside of a procedural macro. It is still the case that proc-macro2 is required if I want to support build.rs and main.rs use cases. Try running: extern crate proc_macro;
use proc_macro::{Ident, Span};
fn main() {
println!("{}", Ident::new("i", Span::call_site()));
} |
Huh, I didn't follow the thread and assumed that decoupling |
I'm in the process of a crate from 0.11 => 0.15.22 ( the latest as of today ) and am trying to figure out what the equivalent of 0.11's
From
impl for strs is in the latest release.Ident::from(format!("{}Key", name))
. There is a new method but requires proc_macro2 for Span::call_site() however this Span comes from theproc_macro2
crate which I haven't needed to depend on yet. I see that the rust properproc_macro
crate has a stable version of that hereIs there a way to construct an Ident in the latest syn without pulling in the proc_macro2 crate?
The text was updated successfully, but these errors were encountered: