Skip to content

Commit f6496cd

Browse files
committed
Nit: address various style nits
1 parent d5529f0 commit f6496cd

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/libsyntax/errors/emitter.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ pub struct EmitterWriter {
131131
dst: Destination,
132132
registry: Option<diagnostics::registry::Registry>,
133133
cm: Rc<codemap::CodeMap>,
134+
135+
/// Is this the first error emitted thus far? If not, we emit a
136+
/// `\n` before the top-level errors.
134137
first: bool,
135138
}
136139

@@ -172,7 +175,9 @@ impl EmitterWriter {
172175
EmitterWriter { dst: dst, registry: registry, cm: code_map, first: true }
173176
} else {
174177
EmitterWriter { dst: Raw(Box::new(io::stderr())),
175-
registry: registry, cm: code_map, first: true }
178+
registry: registry,
179+
cm: code_map,
180+
first: true }
176181
}
177182
}
178183

src/libsyntax/errors/snippet/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use std::rc::Rc;
1616
use std::mem;
1717
use std::ops::Range;
1818

19-
#[cfg(test)]
2019
mod test;
2120

2221
pub struct SnippetData {
@@ -210,8 +209,7 @@ impl<S> From<(S, Style, RenderedLineKind)> for RenderedLine
210209
impl<S1,S2> From<(S1, Style, S2, Style, RenderedLineKind)> for RenderedLine
211210
where S1: StringSource, S2: StringSource
212211
{
213-
fn from(tuple: (S1, Style, S2, Style, RenderedLineKind))
214-
-> Self {
212+
fn from(tuple: (S1, Style, S2, Style, RenderedLineKind)) -> Self {
215213
let (text1, style1, text2, style2, kind) = tuple;
216214
RenderedLine {
217215
text: vec![

src/libsyntax/errors/snippet/test.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -10,6 +10,8 @@
1010

1111
// Code for testing annotated snippets.
1212

13+
#![cfg(test)]
14+
1315
use codemap::{BytePos, CodeMap, FileMap, NO_EXPANSION, Span};
1416
use std::rc::Rc;
1517
use super::{RenderedLine, SnippetData};

0 commit comments

Comments
 (0)