1
Fork 0

Rollup merge of #63930 - estebank:rustdoc-ice, r=GuillaumeGomez

Account for doc comments coming from proc macros without spans

Fix https://github.com/rust-lang/rust/issues/63821.
This commit is contained in:
Mazdak Farrokhzad 2019-09-05 12:11:07 +02:00 committed by GitHub
commit d855bde457
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 46 additions and 13 deletions

View file

@ -81,7 +81,7 @@ impl<'a, 'tcx> SyntaxChecker<'a, 'tcx> {
// We couldn't calculate the span of the markdown block that had the error, so our
// diagnostics are going to be a bit lacking.
let mut diag = self.cx.sess().struct_span_warn(
super::span_of_attrs(&item.attrs),
super::span_of_attrs(&item.attrs).unwrap_or(item.source.span()),
"doc comment contains an invalid Rust code block",
);