Merge pull request #2106 from clippered/fix-panic-on-windows-stderr

fix output panics on unable to write to stderr
This commit is contained in:
Nick Cameron 2017-11-02 15:04:59 +13:00 committed by GitHub
commit be959667c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -575,7 +575,9 @@ pub fn run(input: Input, config: &Config) -> Summary {
if report.has_warnings() {
match term::stderr() {
Some(ref t) if isatty() && t.supports_color() => {
Some(ref t)
if isatty() && t.supports_color() && t.supports_attr(term::Attr::Bold) =>
{
match report.print_warnings_fancy(term::stderr().unwrap()) {
Ok(..) => (),
Err(..) => panic!("Unable to write to stderr: {}", report),