rustdoc: provide more context for parse errors in code blocks · Issue #67857 · rust-lang/rust (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@euclio

Description

@euclio

Split from #67563.

Currently, the bad_codeblock_syntax_pass in rustdoc provides error messages like the following:

warning: could not parse code block as Rust code
  --> $DIR/invalid-syntax.rs:3:5
   |
LL |   /// ```
   |  _____^
LL | | /// \__________pkt->size___________/          \_result->size_/ \__pkt->size__/
LL | | /// ```
   | |_______^
   |
   = note: error from rustc: unknown start of token: \
   = note: error from rustc: unknown start of token: \
   = note: error from rustc: unknown start of token: \

Ideally, we could display the error spans inline (but downgrade them to warnings).