@@ -159,16 +159,16 @@ fn diagnosticcolor(lvl: level) -> u8 {
159
159
160
160
fn print_diagnostic ( topic : str , lvl : level , msg : str ) {
161
161
if str:: is_not_empty ( topic) {
162
- io:: stderr ( ) . write_str ( #fmt[ "%s " , topic] ) ;
162
+ io:: stdout ( ) . write_str ( #fmt[ "%s " , topic] ) ;
163
163
}
164
164
if term:: color_supported ( ) {
165
- term:: fg ( io:: stderr ( ) , diagnosticcolor ( lvl) ) ;
165
+ term:: fg ( io:: stdout ( ) , diagnosticcolor ( lvl) ) ;
166
166
}
167
- io:: stderr ( ) . write_str ( #fmt[ "%s:" , diagnosticstr ( lvl) ] ) ;
167
+ io:: stdout ( ) . write_str ( #fmt[ "%s:" , diagnosticstr ( lvl) ] ) ;
168
168
if term:: color_supported ( ) {
169
- term:: reset ( io:: stderr ( ) ) ;
169
+ term:: reset ( io:: stdout ( ) ) ;
170
170
}
171
- io:: stderr ( ) . write_str ( #fmt[ " %s\n " , msg] ) ;
171
+ io:: stdout ( ) . write_str ( #fmt[ " %s\n " , msg] ) ;
172
172
}
173
173
174
174
fn emit ( cmsp : option < ( codemap:: codemap , span ) > ,
@@ -202,10 +202,10 @@ fn highlight_lines(cm: codemap::codemap, sp: span,
202
202
}
203
203
// Print the offending lines
204
204
for line: uint in display_lines {
205
- io:: stderr ( ) . write_str ( #fmt[ "%s:%u " , fm. name , line + 1 u] ) ;
205
+ io:: stdout ( ) . write_str ( #fmt[ "%s:%u " , fm. name , line + 1 u] ) ;
206
206
let s = codemap:: get_line ( fm, line as int ) ;
207
207
if !str:: ends_with ( s, "\n " ) { s += "\n " ; }
208
- io:: stderr ( ) . write_str ( s) ;
208
+ io:: stdout ( ) . write_str ( s) ;
209
209
}
210
210
if elided {
211
211
let last_line = display_lines[ vec:: len ( display_lines) - 1 u] ;
@@ -214,7 +214,7 @@ fn highlight_lines(cm: codemap::codemap, sp: span,
214
214
let out = "" ;
215
215
while indent > 0 u { out += " " ; indent -= 1 u; }
216
216
out += "...\n " ;
217
- io:: stderr ( ) . write_str ( out) ;
217
+ io:: stdout ( ) . write_str ( out) ;
218
218
}
219
219
220
220
@@ -239,7 +239,7 @@ fn highlight_lines(cm: codemap::codemap, sp: span,
239
239
let width = hi. col - lo. col - 1 u;
240
240
while width > 0 u { str:: push_char ( s, '~' ) ; width -= 1 u; }
241
241
}
242
- io:: stderr ( ) . write_str ( s + "\n " ) ;
242
+ io:: stdout ( ) . write_str ( s + "\n " ) ;
243
243
}
244
244
}
245
245
0 commit comments