about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorVictor Berger <victor.berger@m4x.org>2014-09-18 00:15:36 +0200
committerVictor Berger <victor.berger@m4x.org>2014-09-22 19:28:07 +0200
commiteb58ac126e638287998959a20aa91ffa730b95c2 (patch)
tree498addaa91b117fe62b203a6d3e4f1cf04b3734a /src/test
parent3907a13f697feb007ab4824ee26f998d56a1311f (diff)
downloadrust-eb58ac126e638287998959a20aa91ffa730b95c2.tar.gz
rust-eb58ac126e638287998959a20aa91ffa730b95c2.zip
Lint stability now checks macro arguments.
Closes #17185.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/auxiliary/lint_stability.rs10
-rw-r--r--src/test/compile-fail/lint-stability.rs8
2 files changed, 15 insertions, 3 deletions
diff --git a/src/test/auxiliary/lint_stability.rs b/src/test/auxiliary/lint_stability.rs
index b0090c63969..bae86f04b23 100644
--- a/src/test/auxiliary/lint_stability.rs
+++ b/src/test/auxiliary/lint_stability.rs
@@ -181,3 +181,13 @@ pub struct LockedTupleStruct(pub int);
 macro_rules! macro_test(
     () => (deprecated());
 )
+
+#[macro_export]
+macro_rules! macro_test_arg(
+    ($func:expr) => ($func);
+)
+
+#[macro_export]
+macro_rules! macro_test_arg_nested(
+    ($func:ident) => (macro_test_arg!($func()));
+)
diff --git a/src/test/compile-fail/lint-stability.rs b/src/test/compile-fail/lint-stability.rs
index f5cee22ac2c..6a36e270740 100644
--- a/src/test/compile-fail/lint-stability.rs
+++ b/src/test/compile-fail/lint-stability.rs
@@ -109,12 +109,14 @@ mod cross_crate {
         let _ = FrozenTupleStruct (1);
         let _ = LockedTupleStruct (1);
 
-        // At the moment, the following just checks that the stability
-        // level of expanded code does not trigger the
-        // lint. Eventually, we will want to lint the contents of the
+        // At the moment, the lint checker only checks stability in
+        // in the arguments of macros.
+        // Eventually, we will want to lint the contents of the
         // macro in the module *defining* it. Also, stability levels
         // on macros themselves are not yet linted.
         macro_test!();
+        macro_test_arg!(deprecated_text()); //~ ERROR use of deprecated item: text
+        macro_test_arg_nested!(deprecated_text);
     }
 
     fn test_method_param<F: Trait>(foo: F) {