Skip to content

Remove unused code from librustc_errors #43019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions src/librustc_errors/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,7 @@ impl 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) {
Expand All @@ -1382,16 +1382,8 @@ impl Destination {
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))?;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_errors/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ use std::rc::Rc;
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};
Expand Down
4 changes: 0 additions & 4 deletions src/librustc_errors/snippet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,14 @@ pub struct StyledString {
#[derive(Copy, Clone, Debug, PartialEq, RustcEncodable, RustcDecodable)]
pub enum Style {
HeaderMsg,
FileNameStyle,
LineAndColumn,
LineNumber,
Quotation,
UnderlinePrimary,
UnderlineSecondary,
LabelPrimary,
LabelSecondary,
OldSchoolNoteText,
OldSchoolNote,
NoStyle,
ErrorCode,
Level(Level),
Highlight,
}
6 changes: 0 additions & 6 deletions src/librustc_errors/styled_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
self.ensure_lines(line);
let string_len = string.len();
Expand Down
1 change: 0 additions & 1 deletion src/libsyntax/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ use std::rc::Rc;

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};
Expand Down