You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rustdoc: do not panic all the way when lexing a source snippet fails
Currently, the libsyntax lexer panics on invalid source, which
makes rustdoc panic when trying to highlight it.
I assume there are efforts underway to make the lexer panic-free,
but until this is done this should be an acceptable workaround.
Note that the panic is still printed like normal as "thread X panicked,
run with RUST_BACKTRACE=1 ...", so I added the printout below to
make it seem less like a fatal error.
I didn't touch `render_inner_with_highlighting` below, as it is
currently unused. It returns a Result whose Err type would have to
be changed if it was to support lexer errors.
Fixes: rust-lang#30032
0 commit comments