Skip to content

[perf] proc-macro Ident should have method as_str #139953

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

Closed
loynoir opened this issue Apr 17, 2025 · 2 comments
Closed

[perf] proc-macro Ident should have method as_str #139953

loynoir opened this issue Apr 17, 2025 · 2 comments
Labels
A-proc-macros Area: Procedural macros C-feature-request Category: A feature request, i.e: not implemented / a PR. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@loynoir
Copy link

loynoir commented Apr 17, 2025

According to https://doc.rust-lang.org/proc_macro/struct.Ident.html

There are

  • pub fn new(string: &str, span: Span) -> Ident

  • ident.to_string()

Should provide below for performance

  • ident.as_str()

Very common actual usage

ident_string = ident.to_string()

match ident_string.as_str() { ... }

Expect usage

match ident.as_str() { ... }
@loynoir loynoir added the C-bug Category: This is a bug. label Apr 17, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 17, 2025
@jieyouxu jieyouxu added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. C-feature-request Category: A feature request, i.e: not implemented / a PR. A-proc-macros Area: Procedural macros and removed C-bug Category: This is a bug. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 17, 2025
@jieyouxu
Copy link
Member

cc @m-ou-se, maybe this issue should be an ACP aginst https://github.com/rust-lang/libs-team/issues instead?

@jieyouxu
Copy link
Member

The rust-lang/rust issue tracker is not suited to handle standard library (API) feature requests. Please consult The feature lifecycle — Standard library developers Guide for advice on (proposals to) adding new standard library features. If you have a concrete proposal, you should instead submit an API Change Proposal (ACP) against the rust-lang/libs-team repository.

You could also discuss your proposal on the #t-libs zulip channel by opening a new topic, and/or discuss your proposal on the Rust Internals forum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-proc-macros Area: Procedural macros C-feature-request Category: A feature request, i.e: not implemented / a PR. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants