From 5cf300d695c4ac6e4bdab8fe5c48de6b05b2cd96 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 21 Jul 2021 14:53:13 +0200 Subject: Remove warnings/errors from compiler when using typeck_body in rustdoc span map builder --- compiler/rustc_session/src/session.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/rustc_session/src') 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>(&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>( -- cgit 1.4.1-3-g733a5