Skip to content

Commit 785aeac

Browse files
committed
Remove unused DiagnosticBuilder::sub function
`Diagnostic::sub` is only ever used directly; it doesn't need to be included in the builder.
1 parent 8cd7d86 commit 785aeac

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

compiler/rustc_errors/src/diagnostic.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,8 @@ impl Diagnostic {
582582

583583
/// Convenience function for internal use, clients should use one of the
584584
/// public methods above.
585+
///
586+
/// Used by `proc_macro_server` for implementing `server::Diagnostic`.
585587
pub fn sub(
586588
&mut self,
587589
level: Level,

compiler/rustc_errors/src/diagnostic_builder.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -157,19 +157,6 @@ impl<'a> DiagnosticBuilder<'a> {
157157
buffered_diagnostics.extend(self.into_diagnostic().map(|(diag, _)| diag));
158158
}
159159

160-
/// Convenience function for internal use, clients should use one of the
161-
/// span_* methods instead.
162-
pub fn sub<S: Into<MultiSpan>>(
163-
&mut self,
164-
level: Level,
165-
message: &str,
166-
span: Option<S>,
167-
) -> &mut Self {
168-
let span = span.map(|s| s.into()).unwrap_or_else(MultiSpan::new);
169-
self.0.diagnostic.sub(level, message, span, None);
170-
self
171-
}
172-
173160
/// Delay emission of this diagnostic as a bug.
174161
///
175162
/// This can be useful in contexts where an error indicates a bug but

0 commit comments

Comments
 (0)