about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2018-10-18 09:55:21 +1300
committerNick Cameron <ncameron@mozilla.com>2018-10-18 15:38:57 +1300
commit613dfcc521e07088dbd72a8dcf484f002139f453 (patch)
treea133ae3217f0540f3db7050cfd576344b086208d /src
parent3d07646858698a1d904c63d3ccc4d9c041928ed8 (diff)
Remove various feature flags
Diffstat (limited to 'src')
-rw-r--r--src/config/config_type.rs2
-rw-r--r--src/imports.rs22
-rw-r--r--src/lib.rs4
-rw-r--r--src/macros.rs27
-rw-r--r--src/overflow.rs4
5 files changed, 31 insertions, 28 deletions
diff --git a/src/config/config_type.rs b/src/config/config_type.rs
index 291a59e1055..419cd06436f 100644
--- a/src/config/config_type.rs
+++ b/src/config/config_type.rs
@@ -243,7 +243,7 @@ macro_rules! create_config {
                         if !err.is_empty() {
                             eprint!("{}", err);
                         }
-                        Ok(Config::default().fill_from_parsed_config(parsed_config, dir: &Path))
+                        Ok(Config::default().fill_from_parsed_config(parsed_config, dir))
                     }
                     Err(e) => {
                         err.push_str("Error: Decoding config file failed:\n");
diff --git a/src/imports.rs b/src/imports.rs
index f4751eb117b..e7817c175b4 100644
--- a/src/imports.rs
+++ b/src/imports.rs
@@ -925,19 +925,23 @@ mod test {
         parser.parse_in_list()
     }
 
-    macro parse_use_trees($($s:expr),* $(,)*) {
-        vec![
-            $(parse_use_tree($s),)*
-        ]
+    macro_rules! parse_use_trees {
+        ($($s:expr),* $(,)*) => {
+            vec![
+                $(parse_use_tree($s),)*
+            ]
+        }
     }
 
     #[test]
     fn test_use_tree_merge() {
-        macro test_merge([$($input:expr),* $(,)*], [$($output:expr),* $(,)*]) {
-            assert_eq!(
-                merge_use_trees(parse_use_trees!($($input,)*)),
-                parse_use_trees!($($output,)*),
-            );
+        macro_rules! test_merge {
+            ([$($input:expr),* $(,)*], [$($output:expr),* $(,)*]) => {
+                assert_eq!(
+                    merge_use_trees(parse_use_trees!($($input,)*)),
+                    parse_use_trees!($($output,)*),
+                );
+            }
         }
 
         test_merge!(["a::b::{c, d}", "a::b::{e, f}"], ["a::b::{c, d, e, f}"]);
diff --git a/src/lib.rs b/src/lib.rs
index 9540b9fd20e..a8958abab39 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -8,10 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(decl_macro)]
-#![allow(unused_attributes)]
-#![feature(type_ascription)]
-#![feature(unicode_internals)]
 #![feature(nll)]
 
 #[macro_use]
diff --git a/src/macros.rs b/src/macros.rs
index baf1ed45253..a7a6a7fc6b7 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -867,7 +867,8 @@ impl MacroArgParser {
 
     /// Returns a collection of parsed macro def's arguments.
     pub fn parse(mut self, tokens: ThinTokenStream) -> Option<Vec<ParsedMacroArg>> {
-        let mut iter = (tokens.into(): TokenStream).trees();
+        let stream: TokenStream = tokens.into();
+        let mut iter = stream.trees();
 
         while let Some(ref tok) = iter.next() {
             match tok {
@@ -1398,21 +1399,23 @@ fn format_lazy_static(context: &RewriteContext, shape: Shape, ts: &TokenStream)
     result.push_str("lazy_static! {");
     result.push_str(&nested_shape.indent.to_string_with_newline(context.config));
 
-    macro parse_or($method:ident $(,)* $($arg:expr),* $(,)*) {
-        match parser.$method($($arg,)*) {
-            Ok(val) => {
-                if parser.sess.span_diagnostic.has_errors() {
+    macro_rules! parse_or {
+        ($method:ident $(,)* $($arg:expr),* $(,)*) => {
+            match parser.$method($($arg,)*) {
+                Ok(val) => {
+                    if parser.sess.span_diagnostic.has_errors() {
+                        parser.sess.span_diagnostic.reset_err_count();
+                        return None;
+                    } else {
+                        val
+                    }
+                }
+                Err(mut err) => {
+                    err.cancel();
                     parser.sess.span_diagnostic.reset_err_count();
                     return None;
-                } else {
-                    val
                 }
             }
-            Err(mut err) => {
-                err.cancel();
-                parser.sess.span_diagnostic.reset_err_count();
-                return None;
-            }
         }
     }
 
diff --git a/src/overflow.rs b/src/overflow.rs
index 053ce1b9212..5336b86eb4b 100644
--- a/src/overflow.rs
+++ b/src/overflow.rs
@@ -200,7 +200,7 @@ impl<'a, T: 'a + IntoOverflowableItem<'a>> IntoOverflowableItem<'a> for ptr::P<T
     }
 }
 
-macro impl_into_overflowable_item_for_ast_node {
+macro_rules! impl_into_overflowable_item_for_ast_node {
     ($($ast_node:ident),*) => {
         $(
             impl<'a> IntoOverflowableItem<'a> for ast::$ast_node {
@@ -212,7 +212,7 @@ macro impl_into_overflowable_item_for_ast_node {
     }
 }
 
-macro impl_into_overflowable_item_for_rustfmt_types {
+macro_rules! impl_into_overflowable_item_for_rustfmt_types {
     ([$($ty:ident),*], [$($ty_with_lifetime:ident),*]) => {
         $(
             impl<'a> IntoOverflowableItem<'a> for $ty {