This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 484525f
committed
Auto merge of rust-lang#16158 - saiintbrisson:fix/mbe/desugar-comment-to-raw-string, r=Veykril
fix(mbe): desugar doc correctly for mbe
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/59096cdad0e527ce4d254b55aca58539f726d3d6/compiler/rustc_ast/src/tokenstream.rs#L662-L671File tree
2 files changed
+22
-7
lines changed- crates
- hir-def/src/macro_expansion_tests
- mbe/src
2 files changed
+22
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1218 | 1218 | | |
1219 | 1219 | | |
1220 | 1220 | | |
1221 | | - | |
1222 | | - | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
1223 | 1225 | | |
1224 | 1226 | | |
1225 | 1227 | | |
| |||
1260 | 1262 | | |
1261 | 1263 | | |
1262 | 1264 | | |
1263 | | - | |
1264 | | - | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
1265 | 1269 | | |
1266 | 1270 | | |
1267 | 1271 | | |
| |||
1281 | 1285 | | |
1282 | 1286 | | |
1283 | 1287 | | |
1284 | | - | |
| 1288 | + | |
1285 | 1289 | | |
1286 | 1290 | | |
1287 | 1291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
409 | | - | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
410 | 421 | | |
411 | | - | |
| 422 | + | |
412 | 423 | | |
413 | 424 | | |
414 | 425 | | |
| |||
0 commit comments