Yacin Tmimi
Yacin Tmimi
@Mark-Simulacrum The diff is helpful, but can you also provide a complete code snippet that we can use to reproduce the issue. A few more questions. What version of rustfmt...
@Nilstrieb do you know how `builtin # type_ascribe` is represented in the AST? for example, `builtin # offset_of` is represented by [rustc_ast::ast::ExprKind::OffsetOf](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/ast/enum.ExprKind.html#variant.OffsetOf)
@Nilstrieb @Mark-Simulacrum Okay, I think the issue here is that `builtin # type_ascribe` gets parsed as [rustc_ast::ast::ExprKind::Type](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/ast/enum.ExprKind.html#variant.Type). [From what I can tell Here's where this get's parsed in rustc](https://github.com/rust-lang/rust/blob/80451a485b006bd32732c003a54ee7de457d8266/compiler/rustc_parse/src/parser/expr.rs#L2043-L2050). In...
@Nilstrieb Do you have thoughts on how rustfmt can tell the difference between `builtin # type_ascribe` and `expr: ty` if they both get parsed as `ExprKind::Type`?
If `ExprKind::Type` exclusively represents `builtin # type_ascrib` then I agree we don't need to make any ast changes. Do you know when the switch from `expr: ty` -> `builtin #...
Thanks for the link!
> `rustc_ast_pretty` does print `builtin # offset_of` and `builtin # type_acribe` correctly (well, it prints `builtin # type_ascribe` as `type_ascribe!` but I'm gonna fix that, too), only `rustfmt` doesn't. `rustfmt`...
After the [latest subtree sync](https://github.com/rust-lang/rust/pull/126842), and starting with `nightly-2024-06-24`, this issue should be resolved. **Using nightly-2024-06-23 still has the issue** **Using nightly-2024-06-24 fixes the issue**
@tgross35 thanks for reaching out. I can't seem to find the original comment, but I believe you or someone else has already pitched using `comrak` before. Was this really the...
@tgross35 I appreciate you looking into this. I took a look at `comrak` when you initially suggested it. One major issue that I ran into was how it handled links....