Skip to content

Commit

Permalink
Quick and dirty fix of the unused_braces lint
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 authored and Mark-Simulacrum committed May 9, 2020
1 parent e0674ef commit 13c28ad
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/librustc_lint/unused.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use rustc_middle::ty::{self, Ty};
use rustc_session::lint::builtin::UNUSED_ATTRIBUTES;
use rustc_span::symbol::Symbol;
use rustc_span::symbol::{kw, sym};
use rustc_span::{BytePos, Span};
use rustc_span::{BytePos, Span, DUMMY_SP};

use log::debug;

Expand Down Expand Up @@ -415,6 +415,12 @@ trait UnusedDelimLint {
msg: &str,
keep_space: (bool, bool),
) {
// FIXME(flip1995): Quick and dirty fix for #70814. This should be fixed in rustdoc
// properly.
if span == DUMMY_SP {
return;
}

cx.struct_span_lint(self.lint(), span, |lint| {
let span_msg = format!("unnecessary {} around {}", Self::DELIM_STR, msg);
let mut err = lint.build(&span_msg);
Expand Down

0 comments on commit 13c28ad

Please sign in to comment.