Skip to content

Commit 13c28ad

Browse files
flip1995Mark-Simulacrum
authored andcommitted
Quick and dirty fix of the unused_braces lint
Adresses rust-lang#70814
1 parent e0674ef commit 13c28ad

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/librustc_lint/unused.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rustc_middle::ty::{self, Ty};
1616
use rustc_session::lint::builtin::UNUSED_ATTRIBUTES;
1717
use rustc_span::symbol::Symbol;
1818
use rustc_span::symbol::{kw, sym};
19-
use rustc_span::{BytePos, Span};
19+
use rustc_span::{BytePos, Span, DUMMY_SP};
2020

2121
use log::debug;
2222

@@ -415,6 +415,12 @@ trait UnusedDelimLint {
415415
msg: &str,
416416
keep_space: (bool, bool),
417417
) {
418+
// FIXME(flip1995): Quick and dirty fix for #70814. This should be fixed in rustdoc
419+
// properly.
420+
if span == DUMMY_SP {
421+
return;
422+
}
423+
418424
cx.struct_span_lint(self.lint(), span, |lint| {
419425
let span_msg = format!("unnecessary {} around {}", Self::DELIM_STR, msg);
420426
let mut err = lint.build(&span_msg);

0 commit comments

Comments
 (0)