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
Prev Previous commit
Next Next commit
Reexport literal-escaper from rustc_lexer to allow rust-analyzer …
…to compile
GuillaumeGomez committed Feb 10, 2025
commit 94f0f2b603bdd10fabc7e06e29d25f230d22a93f
1 change: 1 addition & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
@@ -4074,6 +4074,7 @@ name = "rustc_lexer"
version = "0.0.0"
dependencies = [
"expect-test",
"literal-escaper",
"memchr",
"unicode-properties",
"unicode-xid",
1 change: 1 addition & 0 deletions compiler/rustc_lexer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ Rust lexer used by rustc. No stability guarantees are provided.
[dependencies]
memchr = "2.7.4"
unicode-xid = "0.2.0"
literal-escaper = { path = "../../library/literal-escaper" }

[dependencies.unicode-properties]
version = "0.1.0"
3 changes: 3 additions & 0 deletions compiler/rustc_lexer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -31,6 +31,9 @@ mod cursor;
#[cfg(test)]
mod tests;

// FIXME: This is needed for rust-analyzer. Remove this dependency once rust-analyzer uses
// `literal-escaper`.
Copy link
Member

Choose a reason for hiding this comment

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

This is a sub-tree so you can just make the changes directly.

Copy link
Member Author

Choose a reason for hiding this comment

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

For now it's tricky because it requires to make literal_escaper a dependency of r-a. I'll check with r-a people directly after this is merged.

Copy link
Member

@Veykril Veykril Mar 16, 2025

Choose a reason for hiding this comment

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

This will break our auto publishing of rustc_lexer and I don't immediately see how to prevent that :/ That means we won't be able to sync our subtree after this change. Or well, I guess we just can't bump this crate until literal_escaper ships on stable. So maybe that's fine as long as no relevant changes happen to rustc_lexer.

Copy link
Member

Choose a reason for hiding this comment

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

No wait, this will break rustc_lexer and rustc_parse_format_args in general if I see this right? Those crates need to compile on stable which they no longer will by depending on this new unstable standard library crate.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, so for the time being, I leave it as is. Let's come up with a solution later on. :)

pub use literal_escaper as unescape;
use unicode_properties::UnicodeEmoji;
pub use unicode_xid::UNICODE_VERSION as UNICODE_XID_VERSION;