1
Fork 0

Remove unused code from librustc_errors

This commit is contained in:
Kevin Mehall 2017-07-02 13:46:38 -07:00
parent d2ebb12a1d
commit 17bd76a516
5 changed files with 4 additions and 23 deletions

View file

@ -1373,7 +1373,7 @@ impl Destination {
fn apply_style(&mut self, lvl: Level, style: Style) -> io::Result<()> { fn apply_style(&mut self, lvl: Level, style: Style) -> io::Result<()> {
match style { match style {
Style::FileNameStyle | Style::LineAndColumn => {} Style::LineAndColumn => {}
Style::LineNumber => { Style::LineNumber => {
self.start_attr(term::Attr::Bold)?; self.start_attr(term::Attr::Bold)?;
if cfg!(windows) { if cfg!(windows) {
@ -1382,16 +1382,8 @@ impl Destination {
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_BLUE))?; self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_BLUE))?;
} }
} }
Style::ErrorCode => {
self.start_attr(term::Attr::Bold)?;
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_MAGENTA))?;
}
Style::Quotation => {} Style::Quotation => {}
Style::OldSchoolNote => { Style::HeaderMsg => {
self.start_attr(term::Attr::Bold)?;
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_GREEN))?;
}
Style::OldSchoolNoteText | Style::HeaderMsg => {
self.start_attr(term::Attr::Bold)?; self.start_attr(term::Attr::Bold)?;
if cfg!(windows) { if cfg!(windows) {
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_WHITE))?; self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_WHITE))?;

View file

@ -41,9 +41,9 @@ use std::rc::Rc;
pub mod diagnostic; pub mod diagnostic;
pub mod diagnostic_builder; pub mod diagnostic_builder;
pub mod emitter; pub mod emitter;
pub mod snippet; mod snippet;
pub mod registry; pub mod registry;
pub mod styled_buffer; mod styled_buffer;
mod lock; mod lock;
use syntax_pos::{BytePos, Loc, FileLinesResult, FileMap, FileName, MultiSpan, Span, NO_EXPANSION}; use syntax_pos::{BytePos, Loc, FileLinesResult, FileMap, FileName, MultiSpan, Span, NO_EXPANSION};

View file

@ -206,7 +206,6 @@ pub struct StyledString {
#[derive(Copy, Clone, Debug, PartialEq, RustcEncodable, RustcDecodable)] #[derive(Copy, Clone, Debug, PartialEq, RustcEncodable, RustcDecodable)]
pub enum Style { pub enum Style {
HeaderMsg, HeaderMsg,
FileNameStyle,
LineAndColumn, LineAndColumn,
LineNumber, LineNumber,
Quotation, Quotation,
@ -214,10 +213,7 @@ pub enum Style {
UnderlineSecondary, UnderlineSecondary,
LabelPrimary, LabelPrimary,
LabelSecondary, LabelSecondary,
OldSchoolNoteText,
OldSchoolNote,
NoStyle, NoStyle,
ErrorCode,
Level(Level), Level(Level),
Highlight, Highlight,
} }

View file

@ -111,12 +111,6 @@ impl StyledBuffer {
} }
} }
pub fn set_style(&mut self, line: usize, col: usize, style: Style) {
if self.styles.len() > line && self.styles[line].len() > col {
self.styles[line][col] = style;
}
}
pub fn prepend(&mut self, line: usize, string: &str, style: Style) { pub fn prepend(&mut self, line: usize, string: &str, style: Style) {
self.ensure_lines(line); self.ensure_lines(line);
let string_len = string.len(); let string_len = string.len();

View file

@ -25,7 +25,6 @@ use std::rc::Rc;
use codemap::{self, CodeMap, ExpnInfo, NameAndSpan, MacroAttribute, dummy_spanned}; use codemap::{self, CodeMap, ExpnInfo, NameAndSpan, MacroAttribute, dummy_spanned};
use errors; use errors;
use errors::snippet::{SnippetData};
use config; use config;
use entry::{self, EntryPointType}; use entry::{self, EntryPointType};
use ext::base::{ExtCtxt, Resolver}; use ext::base::{ExtCtxt, Resolver};