Skip to content

Commit 17bd76a

Browse files
committed
Remove unused code from librustc_errors
1 parent d2ebb12 commit 17bd76a

File tree

5 files changed

+4
-23
lines changed

5 files changed

+4
-23
lines changed

src/librustc_errors/emitter.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@ impl Destination {
13731373

13741374
fn apply_style(&mut self, lvl: Level, style: Style) -> io::Result<()> {
13751375
match style {
1376-
Style::FileNameStyle | Style::LineAndColumn => {}
1376+
Style::LineAndColumn => {}
13771377
Style::LineNumber => {
13781378
self.start_attr(term::Attr::Bold)?;
13791379
if cfg!(windows) {
@@ -1382,16 +1382,8 @@ impl Destination {
13821382
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_BLUE))?;
13831383
}
13841384
}
1385-
Style::ErrorCode => {
1386-
self.start_attr(term::Attr::Bold)?;
1387-
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_MAGENTA))?;
1388-
}
13891385
Style::Quotation => {}
1390-
Style::OldSchoolNote => {
1391-
self.start_attr(term::Attr::Bold)?;
1392-
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_GREEN))?;
1393-
}
1394-
Style::OldSchoolNoteText | Style::HeaderMsg => {
1386+
Style::HeaderMsg => {
13951387
self.start_attr(term::Attr::Bold)?;
13961388
if cfg!(windows) {
13971389
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_WHITE))?;

src/librustc_errors/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ use std::rc::Rc;
4141
pub mod diagnostic;
4242
pub mod diagnostic_builder;
4343
pub mod emitter;
44-
pub mod snippet;
44+
mod snippet;
4545
pub mod registry;
46-
pub mod styled_buffer;
46+
mod styled_buffer;
4747
mod lock;
4848

4949
use syntax_pos::{BytePos, Loc, FileLinesResult, FileMap, FileName, MultiSpan, Span, NO_EXPANSION};

src/librustc_errors/snippet.rs

-4
Original file line numberDiff line numberDiff line change
@@ -206,18 +206,14 @@ pub struct StyledString {
206206
#[derive(Copy, Clone, Debug, PartialEq, RustcEncodable, RustcDecodable)]
207207
pub enum Style {
208208
HeaderMsg,
209-
FileNameStyle,
210209
LineAndColumn,
211210
LineNumber,
212211
Quotation,
213212
UnderlinePrimary,
214213
UnderlineSecondary,
215214
LabelPrimary,
216215
LabelSecondary,
217-
OldSchoolNoteText,
218-
OldSchoolNote,
219216
NoStyle,
220-
ErrorCode,
221217
Level(Level),
222218
Highlight,
223219
}

src/librustc_errors/styled_buffer.rs

-6
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,6 @@ impl StyledBuffer {
111111
}
112112
}
113113

114-
pub fn set_style(&mut self, line: usize, col: usize, style: Style) {
115-
if self.styles.len() > line && self.styles[line].len() > col {
116-
self.styles[line][col] = style;
117-
}
118-
}
119-
120114
pub fn prepend(&mut self, line: usize, string: &str, style: Style) {
121115
self.ensure_lines(line);
122116
let string_len = string.len();

src/libsyntax/test.rs

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use std::rc::Rc;
2525

2626
use codemap::{self, CodeMap, ExpnInfo, NameAndSpan, MacroAttribute, dummy_spanned};
2727
use errors;
28-
use errors::snippet::{SnippetData};
2928
use config;
3029
use entry::{self, EntryPointType};
3130
use ext::base::{ExtCtxt, Resolver};

0 commit comments

Comments
 (0)