Skip to content

Commit

Permalink
Remove some no-longer-needed pub(crate) markers.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Feb 21, 2024
1 parent 8f20a54 commit 1407057
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions compiler/rustc_errors/src/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,11 +490,9 @@ pub struct DiagnosticBuilder<'a, G: EmissionGuarantee = ErrorGuaranteed> {
/// often used as a return value, especially within the frequently-used
/// `PResult` type. In theory, return value optimization (RVO) should avoid
/// unnecessary copying. In practice, it does not (at the time of writing).
// FIXME(nnethercote) Make private once this moves to diagnostic.rs.
pub(crate) diag: Option<Box<Diagnostic>>,
diag: Option<Box<Diagnostic>>,

// FIXME(nnethercote) Make private once this moves to diagnostic.rs.
pub(crate) _marker: PhantomData<G>,
_marker: PhantomData<G>,
}

// Cloning a `DiagnosticBuilder` is a recipe for a diagnostic being emitted
Expand Down Expand Up @@ -1246,21 +1244,18 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
/// Takes the diagnostic. For use by methods that consume the
/// DiagnosticBuilder: `emit`, `cancel`, etc. Afterwards, `drop` is the
/// only code that will be run on `self`.
// FIXME(nnethercote) Make private once this moves to diagnostic.rs.
pub(crate) fn take_diag(&mut self) -> Diagnostic {
fn take_diag(&mut self) -> Diagnostic {
Box::into_inner(self.diag.take().unwrap())
}

/// Most `emit_producing_guarantee` functions use this as a starting point.
// FIXME(nnethercote) Make private once this moves to diagnostic.rs.
pub(crate) fn emit_producing_nothing(mut self) {
fn emit_producing_nothing(mut self) {
let diag = self.take_diag();
self.dcx.emit_diagnostic(diag);
}

/// `ErrorGuaranteed::emit_producing_guarantee` uses this.
// FIXME(nnethercote) Make private once this moves to diagnostic.rs.
pub(crate) fn emit_producing_error_guaranteed(mut self) -> ErrorGuaranteed {
fn emit_producing_error_guaranteed(mut self) -> ErrorGuaranteed {
let diag = self.take_diag();

// The only error levels that produce `ErrorGuaranteed` are
Expand Down

0 comments on commit 1407057

Please sign in to comment.