summary refs log tree commit diff
path: root/src/test/ui/lint/auxiliary
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-07-17 10:23:03 -0700
committerAlex Crichton <alex@alexcrichton.com>2018-07-17 12:20:38 -0700
commit8adf08c4373f5bdd5bbef9aa4dfd0ca5c4a2eefc (patch)
tree8dbf258f67a4c79bd1af2c86d6f907079c676659 /src/test/ui/lint/auxiliary
parentdd0808dd24bbb351d19b805a9318eb9e105010b2 (diff)
downloadrust-8adf08c4373f5bdd5bbef9aa4dfd0ca5c4a2eefc.tar.gz
rust-8adf08c4373f5bdd5bbef9aa4dfd0ca5c4a2eefc.zip
rustc: Polish off `in_external_macro`
This commit polishes off this new function to compile on newer rustc as well as
update and add a suite of test cases to work with this new check for lints.
Diffstat (limited to 'src/test/ui/lint/auxiliary')
-rw-r--r--src/test/ui/lint/auxiliary/lints-in-foreign-macros.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/ui/lint/auxiliary/lints-in-foreign-macros.rs b/src/test/ui/lint/auxiliary/lints-in-foreign-macros.rs
new file mode 100644
index 00000000000..cf8e9c18de3
--- /dev/null
+++ b/src/test/ui/lint/auxiliary/lints-in-foreign-macros.rs
@@ -0,0 +1,24 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[macro_export]
+macro_rules! bar {
+    () => {use std::string::ToString;}
+}
+
+#[macro_export]
+macro_rules! baz {
+    ($i:item) => ($i)
+}
+
+#[macro_export]
+macro_rules! baz2 {
+    ($($i:tt)*) => ($($i)*)
+}