Skip to content

Commit

Permalink
Deprecated proc_macro doesn't trigger warning on build library
Browse files Browse the repository at this point in the history
Change-Id: Ib3a396e7334d209fe6c6ef425bbfc7b2ae471378
  • Loading branch information
XiangQingW committed Oct 22, 2019
1 parent 33910f9 commit c027be0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/libsyntax_ext/proc_macro_harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 4 additions & 5 deletions src/test/ui/proc-macro/proc-macro-deprecated-attr.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// build-pass
// check-pass

#![deny(deprecated)]

#![crate_type = "proc-macro"]

Expand All @@ -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()
}

0 comments on commit c027be0

Please sign in to comment.