about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorEric Huss <eric@huss.org>2019-09-24 16:53:33 -0700
committerEric Huss <eric@huss.org>2019-09-24 16:53:33 -0700
commit6d07874e883ae4334b42ef3ab04cc3f52ee711ee (patch)
treedd360aaa4aa02671cb8462bec638f1854a4c556f /src/libsyntax
parent6ef275e6c3cb1384ec78128eceeb4963ff788dca (diff)
downloadrust-6d07874e883ae4334b42ef3ab04cc3f52ee711ee.tar.gz
rust-6d07874e883ae4334b42ef3ab04cc3f52ee711ee.zip
Don't emit explain with json short messages.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/json.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libsyntax/json.rs b/src/libsyntax/json.rs
index 5cdea3aabbe..2423e1070fc 100644
--- a/src/libsyntax/json.rs
+++ b/src/libsyntax/json.rs
@@ -112,6 +112,13 @@ impl Emitter for JsonEmitter {
             panic!("failed to print notification: {:?}", e);
         }
     }
+
+    fn should_show_explain(&self) -> bool {
+        match self.json_rendered {
+            HumanReadableErrorType::Short(_) => false,
+            _ => true,
+        }
+    }
 }
 
 // The following data types are provided just for serialisation.