about summary refs log tree commit diff
path: root/src/librustc_errors
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2019-09-07 10:20:56 -0400
committerMark Rousskov <mark.simulacrum@gmail.com>2019-09-17 09:30:44 -0400
commit2a3930d43ced5204f53a6e1eebd741a81c4c1e9a (patch)
treeda19271a9c9d09248d140005079c02c8fde5718f /src/librustc_errors
parent0b586b436d6ea2dddc213c18bf17f2314441c32f (diff)
downloadrust-2a3930d43ced5204f53a6e1eebd741a81c4c1e9a.tar.gz
rust-2a3930d43ced5204f53a6e1eebd741a81c4c1e9a.zip
Privatize DiagnosticBuilder constructors
Diffstat (limited to 'src/librustc_errors')
-rw-r--r--src/librustc_errors/diagnostic_builder.rs5
-rw-r--r--src/librustc_errors/lib.rs5
2 files changed, 5 insertions, 5 deletions
diff --git a/src/librustc_errors/diagnostic_builder.rs b/src/librustc_errors/diagnostic_builder.rs
index 25ffb146da7..e85388bfea2 100644
--- a/src/librustc_errors/diagnostic_builder.rs
+++ b/src/librustc_errors/diagnostic_builder.rs
@@ -346,7 +346,7 @@ impl<'a> DiagnosticBuilder<'a> {
 
     /// Convenience function for internal use, clients should use one of the
     /// struct_* methods on Handler.
-    pub fn new(handler: &'a Handler, level: Level, message: &str) -> DiagnosticBuilder<'a> {
+    crate fn new(handler: &'a Handler, level: Level, message: &str) -> DiagnosticBuilder<'a> {
         DiagnosticBuilder::new_with_code(handler, level, None, message)
     }
 
@@ -363,7 +363,8 @@ impl<'a> DiagnosticBuilder<'a> {
 
     /// Creates a new `DiagnosticBuilder` with an already constructed
     /// diagnostic.
-    pub fn new_diagnostic(handler: &'a Handler, diagnostic: Diagnostic) -> DiagnosticBuilder<'a> {
+    crate fn new_diagnostic(handler: &'a Handler, diagnostic: Diagnostic)
+                         -> DiagnosticBuilder<'a> {
         DiagnosticBuilder(Box::new(DiagnosticBuilderInner {
             handler,
             diagnostic,
diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs
index 11e2265cf36..51309f37e17 100644
--- a/src/librustc_errors/lib.rs
+++ b/src/librustc_errors/lib.rs
@@ -742,12 +742,11 @@ impl Handler {
         self.taught_diagnostics.borrow_mut().insert(code.clone())
     }
 
-    pub fn force_print_db(&self, mut db: DiagnosticBuilder<'_>) {
+    pub fn force_print_diagnostic(&self, db: Diagnostic) {
         self.emitter.borrow_mut().emit_diagnostic(&db);
-        db.cancel();
     }
 
-    fn emit_diagnostic(&self, diagnostic: &Diagnostic) {
+    pub fn emit_diagnostic(&self, diagnostic: &Diagnostic) {
         if diagnostic.cancelled() {
             return;
         }