about summary refs log tree commit diff
diff options
context:
space:
mode:
authorflip1995 <hello@philkrones.com>2020-04-24 18:22:18 +0200
committerflip1995 <hello@philkrones.com>2020-04-24 19:15:06 +0200
commite42337b6089dcabcbb9313ff0f7a959c949391d5 (patch)
treefb769a3739d101ab8d2b0586b59b197cae3e2ed1
parent0b958790b336738540d027d645718713849638d7 (diff)
downloadrust-e42337b6089dcabcbb9313ff0f7a959c949391d5.tar.gz
rust-e42337b6089dcabcbb9313ff0f7a959c949391d5.zip
Quick and dirty fix of the unused_braces lint
Adresses #70814
-rw-r--r--src/librustc_lint/unused.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/librustc_lint/unused.rs b/src/librustc_lint/unused.rs
index a3748a3a9fe..ddd252cb290 100644
--- a/src/librustc_lint/unused.rs
+++ b/src/librustc_lint/unused.rs
@@ -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;
 
@@ -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);