Skip to content

Commit 6140872

Browse files
committed
Rollup merge of rust-lang#23782 - mvdnes:obsolete_note, r=alexcrichton
When emmitting a note, previously it was not known if the note was for an error or a warning. If it was for a warning, then with `-Awarnings` it should not have been print. The `emit_for` function allows someone to specify which level should determine its visibility. An example: ```rust extern crate "std" as std2; fn main() {} ``` When compiling with `-Awarnings`, this would previously emit `note: use an identifier not in quotes instead` (and nothing else). With this patch, it will be completely silent as expected.
2 parents e9080ec + 6de33c2 commit 6140872

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libsyntax/parse/obsolete.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ impl<'a> ParserObsoleteMethods for parser::Parser<'a> {
8080
self.span_warn(sp, &format!("obsolete syntax: {}", kind_str));
8181
}
8282

83-
if !self.obsolete_set.contains(&kind) {
83+
if !self.obsolete_set.contains(&kind) &&
84+
(error || self.sess.span_diagnostic.handler().can_emit_warnings) {
8485
self.sess
8586
.span_diagnostic
8687
.handler()

0 commit comments

Comments
 (0)