diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2021-07-21 14:53:13 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2021-08-05 23:08:29 +0200 |
| commit | 5cf300d695c4ac6e4bdab8fe5c48de6b05b2cd96 (patch) | |
| tree | 8feb20307f70d640afd84d5b54f0200f74cf0a2a /compiler/rustc_session | |
| parent | 0799528db785e49ad13044aac193b8be2153e202 (diff) | |
| download | rust-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.rs | 4 |
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>( |
