about summary refs log tree commit diff
path: root/src/test/compile-fail
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-08-08 08:37:56 +0000
committerbors <bors@rust-lang.org>2018-08-08 08:37:56 +0000
commitffb09dfb3a9b252e26cd4f6570e9ff1b8a742edc (patch)
tree493e66a5c73fd6e5d81f7afcee1186c0ed106655 /src/test/compile-fail
parent52c785bfc24e43c668c9022cc1e79edcd6dcfd7c (diff)
parent50886115d7a7eba43b025e608aa156ef0e8dd7a8 (diff)
downloadrust-ffb09dfb3a9b252e26cd4f6570e9ff1b8a742edc.tar.gz
rust-ffb09dfb3a9b252e26cd4f6570e9ff1b8a742edc.zip
Auto merge of #53053 - petrochenkov:custattr, r=alexcrichton
resolve:  Support custom attributes when macro modularization is enabled

Basically, if resolution of a single-segment attribute is a determined error, then we interpret it as a custom attribute.

Since custom attributes are integrated into general macro resolution, `feature(custom_attribute)` now requires and implicitly enables macro modularization (`feature(use_extern_macros)`).
Actually, a few other "advanced" macro features now implicitly enable macro modularization too (and one bug was found and fixed in process of enabling it).

The first two commits are preliminary cleanups/refactorings.
Diffstat (limited to 'src/test/compile-fail')
-rw-r--r--src/test/compile-fail/macro-with-seps-err-msg.rs4
-rw-r--r--src/test/compile-fail/macros-in-extern.rs6
-rw-r--r--src/test/compile-fail/stmt_expr_attrs_no_feature.rs2
-rw-r--r--src/test/compile-fail/unknown-tool-name.rs2
4 files changed, 5 insertions, 9 deletions
diff --git a/src/test/compile-fail/macro-with-seps-err-msg.rs b/src/test/compile-fail/macro-with-seps-err-msg.rs
index 6567a100d8c..1281adce5c5 100644
--- a/src/test/compile-fail/macro-with-seps-err-msg.rs
+++ b/src/test/compile-fail/macro-with-seps-err-msg.rs
@@ -10,10 +10,6 @@
 
 // gate-test-use_extern_macros
 
-#![feature(proc_macro_path_invoc)]
-
 fn main() {
     globnar::brotz!(); //~ ERROR non-ident macro paths are experimental
-    #[derive(foo::Bar)] struct T; //~ ERROR non-ident macro paths are experimental
-    ::foo!(); //~ ERROR non-ident macro paths are experimental
 }
diff --git a/src/test/compile-fail/macros-in-extern.rs b/src/test/compile-fail/macros-in-extern.rs
index b6e273881cc..40053853b15 100644
--- a/src/test/compile-fail/macros-in-extern.rs
+++ b/src/test/compile-fail/macros-in-extern.rs
@@ -34,9 +34,9 @@ fn main() {
 #[link(name = "rust_test_helpers", kind = "static")]
 extern {
     returns_isize!(rust_get_test_int);
-    //~^ ERROR macro invocations in `extern {}` blocks are experimental.
+    //~^ ERROR macro invocations in `extern {}` blocks are experimental
     takes_u32_returns_u32!(rust_dbg_extern_identity_u32);
-    //~^ ERROR macro invocations in `extern {}` blocks are experimental.
+    //~^ ERROR macro invocations in `extern {}` blocks are experimental
     emits_nothing!();
-    //~^ ERROR macro invocations in `extern {}` blocks are experimental.
+    //~^ ERROR macro invocations in `extern {}` blocks are experimental
 }
diff --git a/src/test/compile-fail/stmt_expr_attrs_no_feature.rs b/src/test/compile-fail/stmt_expr_attrs_no_feature.rs
index d8626dfd39e..896817bb858 100644
--- a/src/test/compile-fail/stmt_expr_attrs_no_feature.rs
+++ b/src/test/compile-fail/stmt_expr_attrs_no_feature.rs
@@ -20,7 +20,7 @@ fn main() {
     #[attr]
     fn a() {}
 
-    #[attr]
+    #[attr] //~ ERROR attributes on expressions are experimental
     {
 
     }
diff --git a/src/test/compile-fail/unknown-tool-name.rs b/src/test/compile-fail/unknown-tool-name.rs
index c4d22e6d392..99c336c28cd 100644
--- a/src/test/compile-fail/unknown-tool-name.rs
+++ b/src/test/compile-fail/unknown-tool-name.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(use_extern_macros, proc_macro_path_invoc)]
+#![feature(proc_macro_path_invoc)]
 
 #[foo::bar] //~ ERROR failed to resolve. Use of undeclared type or module `foo`
 fn main() {}