about summary refs log tree commit diff
path: root/src/librustc_errors/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-08-21 08:14:17 +0000
committerbors <bors@rust-lang.org>2017-08-21 08:14:17 +0000
commit757b7ac2abd69d97ba196b76f0bbf78c377aaea9 (patch)
tree3c76b7c825867d596c18b62ecb9a54fbe45078b4 /src/librustc_errors/lib.rs
parent06bf94a129931d6e4abadf779af40b95c143b3eb (diff)
parentde4dbe5789d1a4f11c50aa891f9c9cad13860370 (diff)
downloadrust-757b7ac2abd69d97ba196b76f0bbf78c377aaea9.tar.gz
rust-757b7ac2abd69d97ba196b76f0bbf78c377aaea9.zip
Auto merge of #43986 - petrochenkov:pubcrate3, r=pnkfelix
rustc: Remove some dead code

Extracted from https://github.com/rust-lang/rust/pull/43192

r? @eddyb
Diffstat (limited to 'src/librustc_errors/lib.rs')
-rw-r--r--src/librustc_errors/lib.rs21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs
index 26dda2dc42d..12b5ccf4837 100644
--- a/src/librustc_errors/lib.rs
+++ b/src/librustc_errors/lib.rs
@@ -38,8 +38,8 @@ use std::cell::{RefCell, Cell};
 use std::{error, fmt};
 use std::rc::Rc;
 
-pub mod diagnostic;
-pub mod diagnostic_builder;
+mod diagnostic;
+mod diagnostic_builder;
 pub mod emitter;
 mod snippet;
 pub mod registry;
@@ -111,7 +111,7 @@ impl CodeSuggestion {
     }
 
     /// Returns the number of substitutions
-    pub fn substitution_spans<'a>(&'a self) -> impl Iterator<Item = Span> + 'a {
+    fn substitution_spans<'a>(&'a self) -> impl Iterator<Item = Span> + 'a {
         self.substitution_parts.iter().map(|sub| sub.span)
     }
 
@@ -262,7 +262,7 @@ impl error::Error for ExplicitBug {
     }
 }
 
-pub use diagnostic::{Diagnostic, SubDiagnostic, DiagnosticStyledString, StringPart};
+pub use diagnostic::{Diagnostic, SubDiagnostic, DiagnosticStyledString};
 pub use diagnostic_builder::DiagnosticBuilder;
 
 /// A handler deals with errors; certain errors
@@ -491,7 +491,7 @@ impl Handler {
         self.bug(&format!("unimplemented {}", msg));
     }
 
-    pub fn bump_err_count(&self) {
+    fn bump_err_count(&self) {
         self.panic_if_treat_err_as_bug();
         self.err_count.set(self.err_count.get() + 1);
     }
@@ -571,7 +571,7 @@ impl fmt::Display for Level {
 }
 
 impl Level {
-    pub fn color(self) -> term::color::Color {
+    fn color(self) -> term::color::Color {
         match self {
             Bug | Fatal | PhaseFatal | Error => term::color::BRIGHT_RED,
             Warning => {
@@ -598,12 +598,3 @@ impl Level {
         }
     }
 }
-
-pub fn expect<T, M>(diag: &Handler, opt: Option<T>, msg: M) -> T
-    where M: FnOnce() -> String
-{
-    match opt {
-        Some(t) => t,
-        None => diag.bug(&msg()),
-    }
-}