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

fix(mbe): desugar doc correctly for mbe #16158

Merged

Conversation

saiintbrisson
Copy link
Contributor

@saiintbrisson saiintbrisson commented Dec 19, 2023

Fixes #16110.

The way rust desugars doc comments when expanding macros is rendering it as raw strings delimited with hashes. Rust-analyzer wasn't aware of this, so the desugared doc comments wouldn't match correctly when on the LHS of macro declarations.

This PR fixes this by porting the code used by rustc:
https://github.com/rust-lang/rust/blob/59096cdad0e527ce4d254b55aca58539f726d3d6/compiler/rustc_ast/src/tokenstream.rs#L662-L671

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 19, 2023
Fixes rust-lang#16110.

The way rust desugars doc comments when expanding macros
is rendering it as raw strings delimited with hashes.
Rust-analyzer wasn't aware of this, so the desugared doc
comments wouldn't match correctly when on the LHS of macro
declarations.

This PR fixes this by porting the code used by rustc: https://github.com/rust-lang/rust/blob/4cfdbd328b7171b2328d11b950b1af0978d6b1ef/compiler/rustc_ast/src/tokenstream.rs#L6837
@saiintbrisson saiintbrisson force-pushed the fix/mbe/desugar-comment-to-raw-string branch from cfd74e9 to 117a28a Compare December 19, 2023 03:56
@Veykril
Copy link
Member

Veykril commented Dec 19, 2023

Thanks!
@bors r+

@bors
Copy link
Collaborator

bors commented Dec 19, 2023

📌 Commit 6f58e98 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Dec 19, 2023

⌛ Testing commit 6f58e98 with merge 484525f...

@bors
Copy link
Collaborator

bors commented Dec 19, 2023

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 484525f to master...

@bors bors merged commit 484525f into rust-lang:master Dec 19, 2023
10 checks passed
@Veykril
Copy link
Member

Veykril commented Jan 4, 2024

This either introduced a bug, or uncovered a bug somewhere else as our xflags invocation errors now 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
4 participants