about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorwangxiangqing <wangxiangqing@bytedance.com>2019-10-22 00:08:14 +0800
committerwangxiangqing <wangxiangqing@bytedance.com>2019-10-22 08:47:52 +0800
commitc027be0dd09a440927071dea69378d01322373cd (patch)
treeca6a5aa9ac5c305874d96d5cacee42e80d7baeee /src
parent33910f9d86cf8c283c51800085c3e863261ec5ae (diff)
downloadrust-c027be0dd09a440927071dea69378d01322373cd.tar.gz
rust-c027be0dd09a440927071dea69378d01322373cd.zip
Deprecated proc_macro doesn't trigger warning on build library
Change-Id: Ib3a396e7334d209fe6c6ef425bbfc7b2ae471378
Diffstat (limited to 'src')
-rw-r--r--src/libsyntax_ext/proc_macro_harness.rs1
-rw-r--r--src/test/ui/proc-macro/proc-macro-deprecated-attr.rs9
2 files changed, 5 insertions, 5 deletions
diff --git a/src/libsyntax_ext/proc_macro_harness.rs b/src/libsyntax_ext/proc_macro_harness.rs
index bbf5b125551..c874f1ffb11 100644
--- a/src/libsyntax_ext/proc_macro_harness.rs
+++ b/src/libsyntax_ext/proc_macro_harness.rs
@@ -337,6 +337,7 @@ impl<'a> Visitor<'a> for CollectProcMacros<'a> {
 //          use proc_macro::bridge::client::ProcMacro;
 //
 //          #[rustc_proc_macro_decls]
+//          #[allow(deprecated)]
 //          static DECLS: &[ProcMacro] = &[
 //              ProcMacro::custom_derive($name_trait1, &[], ::$name1);
 //              ProcMacro::custom_derive($name_trait2, &["attribute_name"], ::$name2);
diff --git a/src/test/ui/proc-macro/proc-macro-deprecated-attr.rs b/src/test/ui/proc-macro/proc-macro-deprecated-attr.rs
index 32ccc249042..25ce53b70a5 100644
--- a/src/test/ui/proc-macro/proc-macro-deprecated-attr.rs
+++ b/src/test/ui/proc-macro/proc-macro-deprecated-attr.rs
@@ -1,4 +1,6 @@
-// build-pass
+// check-pass
+
+#![deny(deprecated)]
 
 #![crate_type = "proc-macro"]
 
@@ -8,8 +10,5 @@ use proc_macro::*;
 #[proc_macro]
 #[deprecated(since = "1.0.0", note = "test")]
 pub fn test_compile_without_warning_with_deprecated(_: TokenStream) -> TokenStream {
-    "
-    extern crate proc_macro;
-    fn foo() { }
-    ".parse().unwrap()
+    TokenStream::new()
 }