Remove struct_diagnostic and G::make_diagnostic_builder.

`EmissionGuarantee` no longer determines the error level, the `create_*`
functions do.
This commit is contained in:
Nicholas Nethercote 2023-12-18 16:22:45 +11:00
parent e7724a2e31
commit 3a5f28f7e8
2 changed files with 0 additions and 65 deletions

View file

@ -722,21 +722,6 @@ impl DiagCtxt {
self.inner.borrow_mut().emit_stashed_diagnostics()
}
/// Construct a builder with the `msg` at the level appropriate for the
/// specific `EmissionGuarantee`.
///
/// Note: this is necessary for `derive(Diagnostic)`, but shouldn't be used
/// outside of that. Instead use `struct_err`, `struct_warn`, etc., which
/// make the diagnostic kind clearer.
#[rustc_lint_diagnostics]
#[track_caller]
pub fn struct_diagnostic<G: EmissionGuarantee>(
&self,
msg: impl Into<DiagnosticMessage>,
) -> DiagnosticBuilder<'_, G> {
G::make_diagnostic_builder(self, msg)
}
/// Construct a builder at the `Warning` level at the given `span` and with the `msg`.
///
/// Attempting to `.emit()` the builder will only emit if either: