make clean::Item::span return option instead of dummy span
This commit is contained in:
parent
569788e47e
commit
752b0e0672
7 changed files with 40 additions and 30 deletions
|
@ -2677,7 +2677,7 @@ fn render_call_locations(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Ite
|
|||
let contents = match fs::read_to_string(&path) {
|
||||
Ok(contents) => contents,
|
||||
Err(err) => {
|
||||
let span = item.span(tcx).inner();
|
||||
let span = item.span(tcx).map_or(rustc_span::DUMMY_SP, |span| span.inner());
|
||||
tcx.sess
|
||||
.span_err(span, &format!("failed to read file {}: {}", path.display(), err));
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue