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

Add *_value methods to proc_macro lib #136355

Merged

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Jan 31, 2025

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

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

Part of #136652.

r? libs-api

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 31, 2025
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
Copy link
Member Author

I opened a thread on zulip on how to correctly integrate this new lib into bootstrap build process.

@GuillaumeGomez GuillaumeGomez force-pushed the proc-macro_add_value_retrieval_methods branch from f9e8cc5 to 5c5ed38 Compare January 31, 2025 21:14
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez GuillaumeGomez force-pushed the proc-macro_add_value_retrieval_methods branch from 5c5ed38 to 27ab932 Compare January 31, 2025 22:13
@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jan 31, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez GuillaumeGomez force-pushed the proc-macro_add_value_retrieval_methods branch from f86a30d to 75aeabf Compare January 31, 2025 22:54
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the A-tidy Area: The tidy tool label Jan 31, 2025
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez GuillaumeGomez force-pushed the proc-macro_add_value_retrieval_methods branch from cf52b9f to e71c43b Compare January 31, 2025 23:33
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
Copy link
Member Author

I don't see how to fix this failure. I'll wait for someone from @rust-lang/bootstrap to take a look.

Apart from this, seems the PR is mostly ready. :)

Copy link
Member

@onur-ozkan onur-ozkan left a comment

Choose a reason for hiding this comment

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

just a tiny suggestion, LGTM otherwise

@onur-ozkan
Copy link
Member

onur-ozkan commented Feb 1, 2025

just a tiny suggestion, LGTM otherwise

Oh, tests are failing on bootstrap (due to "literal-escaper" if check)..

@GuillaumeGomez GuillaumeGomez force-pushed the proc-macro_add_value_retrieval_methods branch from e71c43b to 774a25c Compare February 3, 2025 22:10
@GuillaumeGomez GuillaumeGomez marked this pull request as ready for review February 4, 2025 10:04
@rustbot
Copy link
Collaborator

rustbot commented Feb 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.

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

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.

@GuillaumeGomez
Copy link
Member Author

PR is now ready for review!

@bors
Copy link
Contributor

bors commented Feb 6, 2025

☔ The latest upstream changes (presumably #136585) made this pull request unmergeable. Please resolve the merge conflicts.

@GuillaumeGomez GuillaumeGomez force-pushed the proc-macro_add_value_retrieval_methods branch from 774a25c to 1d10d7b Compare February 6, 2025 18:33
@GuillaumeGomez
Copy link
Member Author

Fixed merge conflicts.

@bors
Copy link
Contributor

bors commented Mar 17, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 17, 2025
@GuillaumeGomez
Copy link
Member Author

@bors r=Amanieu

@bors
Copy link
Contributor

bors commented Mar 17, 2025

📌 Commit 4394f94 has been approved by Amanieu

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 Mar 17, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 17, 2025
Rollup of 9 pull requests

Successful merges:

 - rust-lang#136355 (Add `*_value` methods to proc_macro lib)
 - rust-lang#137621 (Add std support to cygwin target)
 - rust-lang#137793 (Stablize anonymous pipe)
 - rust-lang#138341 (std: Mention clone-on-write mutation in Arc<T>)
 - rust-lang#138517 (Improve upvar analysis for deref of child capture)
 - rust-lang#138584 (Update Rust Foundation links in Readme)
 - rust-lang#138586 (Document `#![register_tool]`)
 - rust-lang#138590 (Flatten and simplify some control flow 🫓)
 - rust-lang#138592 (update change entry for rust-lang#137147)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 08dfbf4 into rust-lang:master Mar 17, 2025
6 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Mar 17, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 17, 2025
Rollup merge of rust-lang#136355 - GuillaumeGomez:proc-macro_add_value_retrieval_methods, r=Amanieu

Add `*_value` methods to proc_macro lib

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

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

Part of rust-lang#136652.

r? libs-api
@GuillaumeGomez GuillaumeGomez deleted the proc-macro_add_value_retrieval_methods branch March 17, 2025 14:07
@bors
Copy link
Contributor

bors commented Mar 18, 2025

⌛ Testing commit 4394f94 with merge 493c38b...

@bors
Copy link
Contributor

bors commented Mar 18, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 18, 2025
@jhpratt
Copy link
Member

jhpratt commented Mar 18, 2025

@bors r-

already merged, bors!

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 18, 2025
@RalfJung
Copy link
Member

I think this PR broke the rustc-src package:

$ cargo metadata --format-version 1 --manifest-path /home/runner/.rustup/toolchains/miri/lib/rustlib/rustc-src/rust/compiler/rustc/Cargo.toml
    Updating crates.io index
error: failed to get `literal-escaper` as a dependency of package `rustc_ast v0.0.0 (/home/runner/.rustup/toolchains/miri/lib/rustlib/rustc-src/rust/compiler/rustc_ast)`
    ... which satisfies path dependency `rustc_ast` of package `rustc_codegen_ssa v0.0.0 (/home/runner/.rustup/toolchains/miri/lib/rustlib/rustc-src/rust/compiler/rustc_codegen_ssa)`
    ... which satisfies path dependency `rustc_codegen_ssa` of package `rustc-main v0.0.0 (/home/runner/.rustup/toolchains/miri/lib/rustlib/rustc-src/rust/compiler/rustc)`

Caused by:
  failed to load source for dependency `literal-escaper`

Caused by:
  Unable to update /home/runner/.rustup/toolchains/miri/lib/rustlib/rustc-src/rust/library/literal-escaper

Caused by:
  failed to read `/home/runner/.rustup/toolchains/miri/lib/rustlib/rustc-src/rust/library/literal-escaper/Cargo.toml`

@RalfJung
Copy link
Member

I made an issue for this: #138647

RalfJung added a commit to RalfJung/rust that referenced this pull request Mar 18, 2025
…add_value_retrieval_methods, r=Amanieu"

This reverts commit 08dfbf4, reversing
changes made to 10bcdad.
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 18, 2025
…r=petrochenkov

Revert: Add *_value methods to proc_macro lib

This reverts rust-lang#136355. That PR caused unexpected breakage:
- the rustc-dev component can no longer be loaded by cargo, which impacts Miri and clippy and likely others
- rustc_lexer can no longer be published to crates.io, which impacts RA

See rust-lang#138647 for context.
Cc `@GuillaumeGomez` `@Amanieu`
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 18, 2025
…r=petrochenkov

Revert: Add *_value methods to proc_macro lib

This reverts rust-lang#136355. That PR caused unexpected breakage:
- the rustc-dev component can no longer be loaded by cargo, which impacts Miri and clippy and likely others
- rustc_lexer can no longer be published to crates.io, which impacts RA

See rust-lang#138647 for context.
Cc `@GuillaumeGomez` `@Amanieu`
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-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.