提交 b695889f 编写于 作者: B bors

Auto merge of #43019 - kevinmehall:cleanup-errors, r=nikomatsakis

Remove unused code from librustc_errors

While extracting librustc_errors into a [reusable library](https://github.com/kevinmehall/codemap-diagnostic), I noticed some obsolete code that the `dead_code` warning missed because it was marked `pub` but not used elsewhere.
......@@ -1373,7 +1373,7 @@ fn from_stderr() -> Destination {
fn apply_style(&mut self, lvl: Level, style: Style) -> io::Result<()> {
match style {
Style::FileNameStyle | Style::LineAndColumn => {}
Style::LineAndColumn => {}
Style::LineNumber => {
self.start_attr(term::Attr::Bold)?;
if cfg!(windows) {
......@@ -1382,16 +1382,8 @@ fn apply_style(&mut self, lvl: Level, style: Style) -> io::Result<()> {
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::OldSchoolNote => {
self.start_attr(term::Attr::Bold)?;
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_GREEN))?;
}
Style::OldSchoolNoteText | Style::HeaderMsg => {
Style::HeaderMsg => {
self.start_attr(term::Attr::Bold)?;
if cfg!(windows) {
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_WHITE))?;
......
......@@ -41,9 +41,9 @@
pub mod diagnostic;
pub mod diagnostic_builder;
pub mod emitter;
pub mod snippet;
mod snippet;
pub mod registry;
pub mod styled_buffer;
mod styled_buffer;
mod lock;
use syntax_pos::{BytePos, Loc, FileLinesResult, FileMap, FileName, MultiSpan, Span, NO_EXPANSION};
......
......@@ -206,7 +206,6 @@ pub struct StyledString {
#[derive(Copy, Clone, Debug, PartialEq, RustcEncodable, RustcDecodable)]
pub enum Style {
HeaderMsg,
FileNameStyle,
LineAndColumn,
LineNumber,
Quotation,
......@@ -214,10 +213,7 @@ pub enum Style {
UnderlineSecondary,
LabelPrimary,
LabelSecondary,
OldSchoolNoteText,
OldSchoolNote,
NoStyle,
ErrorCode,
Level(Level),
Highlight,
}
......@@ -111,12 +111,6 @@ pub fn puts(&mut self, line: usize, col: usize, string: &str, style: Style) {
}
}
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) {
self.ensure_lines(line);
let string_len = string.len();
......
......@@ -25,7 +25,6 @@
use codemap::{self, CodeMap, ExpnInfo, NameAndSpan, MacroAttribute, dummy_spanned};
use errors;
use errors::snippet::{SnippetData};
use config;
use entry::{self, EntryPointType};
use ext::base::{ExtCtxt, Resolver};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册