about summary refs log tree commit diff
path: root/compiler/rustc_session
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2021-07-21 14:53:13 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2021-08-05 23:08:29 +0200
commit5cf300d695c4ac6e4bdab8fe5c48de6b05b2cd96 (patch)
tree8feb20307f70d640afd84d5b54f0200f74cf0a2a /compiler/rustc_session
parent0799528db785e49ad13044aac193b8be2153e202 (diff)
downloadrust-5cf300d695c4ac6e4bdab8fe5c48de6b05b2cd96.tar.gz
rust-5cf300d695c4ac6e4bdab8fe5c48de6b05b2cd96.zip
Remove warnings/errors from compiler when using typeck_body in rustdoc span map builder
Diffstat (limited to 'compiler/rustc_session')
-rw-r--r--compiler/rustc_session/src/session.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs
index 9ab6dbb1ea9..fe87867d299 100644
--- a/compiler/rustc_session/src/session.rs
+++ b/compiler/rustc_session/src/session.rs
@@ -500,6 +500,10 @@ impl Session {
         &self.parse_sess.span_diagnostic
     }
 
+    pub fn with_disabled_diagnostic<T, F: FnOnce() -> T>(&self, f: F) -> T {
+        self.parse_sess.span_diagnostic.with_disabled_diagnostic(f)
+    }
+
     /// Analogous to calling methods on the given `DiagnosticBuilder`, but
     /// deduplicates on lint ID, span (if any), and message for this `Session`
     fn diag_once<'a, 'b>(