]> git.lizzy.rs Git - rust.git/commitdiff
Deprecated proc_macro doesn't trigger warning on build library
authorwangxiangqing <wangxiangqing@bytedance.com>
Mon, 21 Oct 2019 16:08:14 +0000 (00:08 +0800)
committerwangxiangqing <wangxiangqing@bytedance.com>
Tue, 22 Oct 2019 00:47:52 +0000 (08:47 +0800)
Change-Id: Ib3a396e7334d209fe6c6ef425bbfc7b2ae471378

src/libsyntax_ext/proc_macro_harness.rs
src/test/ui/proc-macro/proc-macro-deprecated-attr.rs

index bbf5b1255510f425d20afe7cc1cacd80e2d2075f..c874f1ffb1175d55d3d5824f777b7a357c8295d2 100644 (file)
@@ -337,6 +337,7 @@ fn visit_mac(&mut self, mac: &'a ast::Mac) {
 //          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);
index 32ccc249042833dd53ac2b684aee790f809faa63..25ce53b70a5bd22912a9f8de50eabcd5f684d7d9 100644 (file)
@@ -1,4 +1,6 @@
-// build-pass
+// check-pass
+
+#![deny(deprecated)]
 
 #![crate_type = "proc-macro"]
 
@@ -8,8 +10,5 @@
 #[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()
 }