about summary refs log tree commit diff
path: root/src/test/ui/rust-2018
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-11-28 22:52:58 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-11-28 22:57:25 +0300
commitd77edb6458f6eafa61ff7a5c2bef3b613add80a1 (patch)
tree8c22ac770cd0dcd7460247639dd0ede60eff0fce /src/test/ui/rust-2018
parentb68fc18c45350e1cdcd83cecf0f12e294e55af56 (diff)
resolve: Fix false-positives from lint `absolute_paths_not_starting_with_crate`
Diffstat (limited to 'src/test/ui/rust-2018')
-rw-r--r--src/test/ui/rust-2018/auxiliary/edition-lint-paths.rs11
-rw-r--r--src/test/ui/rust-2018/edition-lint-paths-2018.rs10
2 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/rust-2018/auxiliary/edition-lint-paths.rs b/src/test/ui/rust-2018/auxiliary/edition-lint-paths.rs
index cc17a9bd661..dc4ab2131a8 100644
--- a/src/test/ui/rust-2018/auxiliary/edition-lint-paths.rs
+++ b/src/test/ui/rust-2018/auxiliary/edition-lint-paths.rs
@@ -9,3 +9,14 @@
 // except according to those terms.
 
 pub fn foo() {}
+
+#[macro_export]
+macro_rules! macro_2015 {
+    () => {
+        use edition_lint_paths as other_name;
+        use edition_lint_paths::foo as other_foo;
+        fn check_macro_2015() {
+            ::edition_lint_paths::foo();
+        }
+    }
+}
diff --git a/src/test/ui/rust-2018/edition-lint-paths-2018.rs b/src/test/ui/rust-2018/edition-lint-paths-2018.rs
new file mode 100644
index 00000000000..09b31beb775
--- /dev/null
+++ b/src/test/ui/rust-2018/edition-lint-paths-2018.rs
@@ -0,0 +1,10 @@
+// compile-pass
+// edition:2018
+// compile-flags:--extern edition_lint_paths
+// aux-build:edition-lint-paths.rs
+
+#![deny(absolute_paths_not_starting_with_crate)]
+
+edition_lint_paths::macro_2015!(); // OK
+
+fn main() {}