diff options
| author | Joshua Nelson <jyn514@gmail.com> | 2021-03-15 15:11:40 -0400 |
|---|---|---|
| committer | Joshua Nelson <jyn514@gmail.com> | 2021-03-27 22:16:33 -0400 |
| commit | 785aeac521e54da8c6826396d05446227e19ee40 (patch) | |
| tree | b18860bd1fe140e1fcbe5de4d7f650a1d1582bc2 /compiler/rustc_errors/src | |
| parent | 8cd7d86ce27f22260a89ff0d47638cc1de827c9d (diff) | |
| download | rust-785aeac521e54da8c6826396d05446227e19ee40.tar.gz rust-785aeac521e54da8c6826396d05446227e19ee40.zip | |
Remove unused `DiagnosticBuilder::sub` function
`Diagnostic::sub` is only ever used directly; it doesn't need to be included in the builder.
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic_builder.rs | 13 |
2 files changed, 2 insertions, 13 deletions
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs index ce5b130dd97..b2dee6ab78c 100644 --- a/compiler/rustc_errors/src/diagnostic.rs +++ b/compiler/rustc_errors/src/diagnostic.rs @@ -582,6 +582,8 @@ impl Diagnostic { /// Convenience function for internal use, clients should use one of the /// public methods above. + /// + /// Used by `proc_macro_server` for implementing `server::Diagnostic`. pub fn sub( &mut self, level: Level, diff --git a/compiler/rustc_errors/src/diagnostic_builder.rs b/compiler/rustc_errors/src/diagnostic_builder.rs index 79507e61522..26c7f094f6a 100644 --- a/compiler/rustc_errors/src/diagnostic_builder.rs +++ b/compiler/rustc_errors/src/diagnostic_builder.rs @@ -157,19 +157,6 @@ impl<'a> DiagnosticBuilder<'a> { buffered_diagnostics.extend(self.into_diagnostic().map(|(diag, _)| diag)); } - /// Convenience function for internal use, clients should use one of the - /// span_* methods instead. - pub fn sub<S: Into<MultiSpan>>( - &mut self, - level: Level, - message: &str, - span: Option<S>, - ) -> &mut Self { - let span = span.map(|s| s.into()).unwrap_or_else(MultiSpan::new); - self.0.diagnostic.sub(level, message, span, None); - self - } - /// Delay emission of this diagnostic as a bug. /// /// This can be useful in contexts where an error indicates a bug but |
