about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-05-24 15:17:32 -0700
committerEsteban Küber <esteban@kuber.com.ar>2019-05-24 15:17:32 -0700
commitee7593e0ac83a1b18e7489b852952cd21e2a6947 (patch)
tree1cf1b4ebb2b880a99009c9d2428ac4e341136c52 /src/libsyntax
parentda57ac38a669573ab693546775eb3ee5dc5b3fc4 (diff)
downloadrust-ee7593e0ac83a1b18e7489b852952cd21e2a6947.tar.gz
rust-ee7593e0ac83a1b18e7489b852952cd21e2a6947.zip
Revert changes that belong to separate PR
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/config.rs13
-rw-r--r--src/libsyntax/ext/derive.rs7
-rw-r--r--src/libsyntax/parse/diagnostics.rs2
3 files changed, 4 insertions, 18 deletions
diff --git a/src/libsyntax/config.rs b/src/libsyntax/config.rs
index 5ccec05dda2..c82936afa3d 100644
--- a/src/libsyntax/config.rs
+++ b/src/libsyntax/config.rs
@@ -94,17 +94,6 @@ impl<'a> StripUnconfigured<'a> {
         if !attr.check_name(sym::cfg_attr) {
             return vec![attr];
         }
-        if attr.tokens.len() == 0 {
-            self.sess.span_diagnostic.struct_span_err(attr.span, "bad `cfg_attr` attribute")
-                .span_label(attr.span, "missing condition and attribute")
-                .note("`cfg_attr` must be of the form: \
-                       `#[cfg_attr(condition, attribute, other_attribute, ...)]`")
-                .note("for more information, visit \
-                       <https://doc.rust-lang.org/reference/conditional-compilation.html\
-                       #the-cfg_attr-attribute>")
-                .emit();
-            return vec![];
-        }
 
         let (cfg_predicate, expanded_attrs) = match attr.parse(self.sess, |parser| {
             parser.expect(&token::OpenDelim(token::Paren))?;
@@ -128,7 +117,7 @@ impl<'a> StripUnconfigured<'a> {
             Ok(result) => result,
             Err(mut e) => {
                 e.emit();
-                return vec![];
+                return Vec::new();
             }
         };
 
diff --git a/src/libsyntax/ext/derive.rs b/src/libsyntax/ext/derive.rs
index bbdda4932f1..6e789c4c708 100644
--- a/src/libsyntax/ext/derive.rs
+++ b/src/libsyntax/ext/derive.rs
@@ -17,11 +17,8 @@ pub fn collect_derives(cx: &mut ExtCtxt<'_>, attrs: &mut Vec<ast::Attribute>) ->
             return true;
         }
         if !attr.is_meta_item_list() {
-            cx.struct_span_err(attr.span, "bad `derive` attribute")
-                .span_label(attr.span, "missing traits to be derived")
-                .note("`derive` must be of the form: \
-                       `#[derive(Trait1, Trait2, ...)]`")
-                .emit();
+            cx.span_err(attr.span,
+                        "attribute must be of the form `#[derive(Trait1, Trait2, ...)]`");
             return false;
         }
 
diff --git a/src/libsyntax/parse/diagnostics.rs b/src/libsyntax/parse/diagnostics.rs
index e93c0bdb833..810acc9cc92 100644
--- a/src/libsyntax/parse/diagnostics.rs
+++ b/src/libsyntax/parse/diagnostics.rs
@@ -618,7 +618,7 @@ impl<'a> Parser<'a> {
         let (span, msg) = match (&self.token, self.subparser_name) {
             (&token::Token::Eof, Some(origin)) => {
                 let sp = self.sess.source_map().next_point(self.span);
-                (sp, format!( "expected expression, found end of {}", origin))
+                (sp, format!("expected expression, found end of {}", origin))
             }
             _ => (self.span, format!(
                 "expected expression, found {}",