about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorMathijs van de Nes <git@mathijs.vd-nes.nl>2015-04-16 19:53:19 +0200
committerSteve Klabnik <steve@steveklabnik.com>2015-04-16 22:23:36 -0400
commit0afdab11ec42ccf5dbe12cd37f71f30cca581f14 (patch)
tree466164deecc4dc83bb67b695e6658d820ffa739f /src/libsyntax/parse
parent1014ac44f6271a55249b0488a2ce1cc49deed338 (diff)
downloadrust-0afdab11ec42ccf5dbe12cd37f71f30cca581f14.tar.gz
rust-0afdab11ec42ccf5dbe12cd37f71f30cca581f14.zip
Omit 'obsolete' note for warning if -Awarning
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/obsolete.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs
index 3b21b5059da..00d9b7f4ea6 100644
--- a/src/libsyntax/parse/obsolete.rs
+++ b/src/libsyntax/parse/obsolete.rs
@@ -80,7 +80,8 @@ impl<'a> ParserObsoleteMethods for parser::Parser<'a> {
             self.span_warn(sp, &format!("obsolete syntax: {}", kind_str));
         }
 
-        if !self.obsolete_set.contains(&kind) {
+        if !self.obsolete_set.contains(&kind) &&
+            (error || self.sess.span_diagnostic.handler().can_emit_warnings) {
             self.sess
                 .span_diagnostic
                 .handler()