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

Expose proc_macro::Span::source_text #349

Closed
dtolnay opened this issue Sep 24, 2022 · 2 comments · Fixed by #350
Closed

Expose proc_macro::Span::source_text #349

dtolnay opened this issue Sep 24, 2022 · 2 comments · Fixed by #350

Comments

@dtolnay
Copy link
Owner

dtolnay commented Sep 24, 2022

Tracking issue: rust-lang/rust#54725. See also rust-lang/rust#101991.

This will involve TokenStream's FromStr impl saving the original source string into https://github.com/dtolnay/proc-macro2/blob/1.0.43/src/fallback.rs#L350, which previously only held the filename and the newline offsets. We'll need to check the performance implications.

@MingweiSamuel
Copy link

Is checking performance implications the current next step for this?

@dtolnay
Copy link
Owner Author

dtolnay commented Mar 22, 2023

It's probably fine.

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

Successfully merging a pull request may close this issue.

2 participants