Skip to content

Add *_value methods to proc_macro lib #139367

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

Merged
merged 7 commits into from
Apr 6, 2025

Conversation

GuillaumeGomez
Copy link
Member

This is the (re-)implementation of rust-lang/libs-team#459.

It allows to get the actual value (unescaped) of the different string literals.

It was originally done in #136355 but it broke the artifacts build so we decided to move the crate to crates.io to go around this limitation.

Part of #136652.

Considering this is a copy-paste of the originally approved PR, no need to go through the whole process again. \o/

r? @Urgau

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 4, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 4, 2025

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead.

cc @rust-lang/rust-analyzer

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
Copy link
Member Author

Blocked on rust-lang/literal-escaper#4.

@rustbot
Copy link
Collaborator

rustbot commented Apr 4, 2025

These commits modify the library/Cargo.lock file. Unintentional changes to library/Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the A-tidy Area: The tidy tool label Apr 4, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 4, 2025

The list of allowed third-party dependencies may have been modified! You must ensure that any new dependencies have compatible licenses before merging.

cc @davidtwco, @wesleywiser

@GuillaumeGomez
Copy link
Member Author

Applied suggestions. :)

@@ -51,11 +52,24 @@ use std::{error, fmt};

#[unstable(feature = "proc_macro_diagnostic", issue = "54140")]
pub use diagnostic::{Diagnostic, Level, MultiSpan};
#[unstable(feature = "proc_macro_value", issue = "136652")]
pub use rustc_literal_escaper::EscapeError;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to define our own error enum instead of using the rustc_literal_escaper one since any changes to it will directly impact the proc-macro crate.

@Urgau
Copy link
Member

Urgau commented Apr 6, 2025

Compiler changes looks good, rust-analyzer looks good, library changes are the same as in #136355.

Since this is mostly #136355, modulo referencing a external crate instead of an in-tree one, let's approve it.

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 6, 2025

📌 Commit 5797532 has been approved by Urgau

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 6, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 6, 2025
…llaumeGomez

Rollup of 6 pull requests

Successful merges:

 - rust-lang#138562 (Optimize slice {Chunks,Windows}::nth)
 - rust-lang#138876 (Trusty: Implement `write_vectored` for stdio )
 - rust-lang#139072 (Add `slice::align_to_uninit_mut`)
 - rust-lang#139367 (Add `*_value` methods to proc_macro lib)
 - rust-lang#139391 (Check if merged attributes list is empty in expr)
 - rust-lang#139414 (Fix typo in `RawList`'s documentation)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ed81e34 into rust-lang:master Apr 6, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 6, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 6, 2025
Rollup merge of rust-lang#139367 - GuillaumeGomez:proc-macro-values, r=Urgau

Add `*_value` methods to proc_macro lib

This is the (re-)implementation of rust-lang/libs-team#459.

It allows to get the actual value (unescaped) of the different string literals.

It was originally done in rust-lang#136355 but it broke the artifacts build so we decided to move the crate to crates.io to go around this limitation.

Part of rust-lang#136652.

Considering this is a copy-paste of the originally approved PR, no need to go through the whole process again. \o/

r? `@Urgau`
@GuillaumeGomez GuillaumeGomez deleted the proc-macro-values branch April 6, 2025 20:30
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Apr 11, 2025
…r=Urgau

Add `*_value` methods to proc_macro lib

This is the (re-)implementation of rust-lang/libs-team#459.

It allows to get the actual value (unescaped) of the different string literals.

It was originally done in rust-lang#136355 but it broke the artifacts build so we decided to move the crate to crates.io to go around this limitation.

Part of rust-lang#136652.

Considering this is a copy-paste of the originally approved PR, no need to go through the whole process again. \o/

r? `@Urgau`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tidy Area: The tidy tool S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants