From ef5d09e14446e9a96d614be4d3973c4b36b35b45 Mon Sep 17 00:00:00 2001 From: Mark Roghelia Date: Sat, 8 Oct 2016 18:29:36 -0400 Subject: [PATCH] Rename rustc_macro to proc_macro Fixes #575 --- README.md | 2 +- examples/serde-syntex-example/src/main.rs | 2 +- serde_derive/Cargo.toml | 2 +- serde_derive/src/lib.rs | 10 +++++----- .../compile-fail/duplicate-attribute/rename-and-ser.rs | 2 +- .../duplicate-attribute/rename-rename-de.rs | 2 +- .../duplicate-attribute/rename-ser-rename-ser.rs | 2 +- .../duplicate-attribute/rename-ser-rename.rs | 2 +- .../compile-fail/duplicate-attribute/rename-ser-ser.rs | 2 +- .../compile-fail/duplicate-attribute/two-rename-ser.rs | 2 +- serde_derive/tests/compile-fail/str_ref_deser.rs | 2 +- .../tests/compile-fail/unknown-attribute/container.rs | 2 +- .../tests/compile-fail/unknown-attribute/field.rs | 2 +- .../tests/compile-fail/unknown-attribute/variant.rs | 2 +- serde_derive/tests/run-pass/identity-op.rs | 2 +- serde_derive/tests/test.rs | 2 +- 16 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 448d9ed2..f0c6ec64 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ You may be looking for: ## Serde in action ```rust -#![feature(rustc_macro)] +#![feature(proc_macro)] #[macro_use] extern crate serde_derive; diff --git a/examples/serde-syntex-example/src/main.rs b/examples/serde-syntex-example/src/main.rs index 46e7d1dc..1d6e2058 100644 --- a/examples/serde-syntex-example/src/main.rs +++ b/examples/serde-syntex-example/src/main.rs @@ -1,4 +1,4 @@ -#![cfg_attr(feature = "serde_derive", feature(rustc_macro))] +#![cfg_attr(feature = "serde_derive", feature(proc_macro))] #[cfg(feature = "serde_derive")] #[macro_use] diff --git a/serde_derive/Cargo.toml b/serde_derive/Cargo.toml index 6ee9949d..a8288a22 100644 --- a/serde_derive/Cargo.toml +++ b/serde_derive/Cargo.toml @@ -12,7 +12,7 @@ include = ["Cargo.toml", "src/**/*.rs"] [lib] name = "serde_derive" -rustc-macro = true +proc-macro = true [dependencies.serde_codegen] version = "=0.8.11" diff --git a/serde_derive/src/lib.rs b/serde_derive/src/lib.rs index 0f435142..8dd4e6ff 100644 --- a/serde_derive/src/lib.rs +++ b/serde_derive/src/lib.rs @@ -1,12 +1,12 @@ -#![feature(rustc_macro, rustc_macro_lib)] +#![feature(proc_macro, proc_macro_lib)] #![cfg(not(test))] -extern crate rustc_macro; +extern crate proc_macro; extern crate serde_codegen; -use rustc_macro::TokenStream; +use proc_macro::TokenStream; -#[rustc_macro_derive(Serialize)] +#[proc_macro_derive(Serialize)] pub fn derive_serialize(input: TokenStream) -> TokenStream { let item = format!("#[derive(Serialize)]\n{}", input); match serde_codegen::expand_single_item(&item) { @@ -15,7 +15,7 @@ pub fn derive_serialize(input: TokenStream) -> TokenStream { } } -#[rustc_macro_derive(Deserialize)] +#[proc_macro_derive(Deserialize)] pub fn derive_deserialize(input: TokenStream) -> TokenStream { let item = format!("#[derive(Deserialize)]\n{}", input); match serde_codegen::expand_single_item(&item) { diff --git a/serde_derive/tests/compile-fail/duplicate-attribute/rename-and-ser.rs b/serde_derive/tests/compile-fail/duplicate-attribute/rename-and-ser.rs index 312583af..2f3950f8 100644 --- a/serde_derive/tests/compile-fail/duplicate-attribute/rename-and-ser.rs +++ b/serde_derive/tests/compile-fail/duplicate-attribute/rename-and-ser.rs @@ -1,4 +1,4 @@ -#![feature(rustc_macro)] +#![feature(proc_macro)] #[macro_use] extern crate serde_derive; diff --git a/serde_derive/tests/compile-fail/duplicate-attribute/rename-rename-de.rs b/serde_derive/tests/compile-fail/duplicate-attribute/rename-rename-de.rs index e6d6876a..04718a0e 100644 --- a/serde_derive/tests/compile-fail/duplicate-attribute/rename-rename-de.rs +++ b/serde_derive/tests/compile-fail/duplicate-attribute/rename-rename-de.rs @@ -1,4 +1,4 @@ -#![feature(rustc_macro)] +#![feature(proc_macro)] #[macro_use] extern crate serde_derive; diff --git a/serde_derive/tests/compile-fail/duplicate-attribute/rename-ser-rename-ser.rs b/serde_derive/tests/compile-fail/duplicate-attribute/rename-ser-rename-ser.rs index d6937559..420182c4 100644 --- a/serde_derive/tests/compile-fail/duplicate-attribute/rename-ser-rename-ser.rs +++ b/serde_derive/tests/compile-fail/duplicate-attribute/rename-ser-rename-ser.rs @@ -1,4 +1,4 @@ -#![feature(rustc_macro)] +#![feature(proc_macro)] #[macro_use] extern crate serde_derive; diff --git a/serde_derive/tests/compile-fail/duplicate-attribute/rename-ser-rename.rs b/serde_derive/tests/compile-fail/duplicate-attribute/rename-ser-rename.rs index dcb0f69e..52715b9d 100644 --- a/serde_derive/tests/compile-fail/duplicate-attribute/rename-ser-rename.rs +++ b/serde_derive/tests/compile-fail/duplicate-attribute/rename-ser-rename.rs @@ -1,4 +1,4 @@ -#![feature(rustc_macro)] +#![feature(proc_macro)] #[macro_use] extern crate serde_derive; diff --git a/serde_derive/tests/compile-fail/duplicate-attribute/rename-ser-ser.rs b/serde_derive/tests/compile-fail/duplicate-attribute/rename-ser-ser.rs index af9116e5..31264c6b 100644 --- a/serde_derive/tests/compile-fail/duplicate-attribute/rename-ser-ser.rs +++ b/serde_derive/tests/compile-fail/duplicate-attribute/rename-ser-ser.rs @@ -1,4 +1,4 @@ -#![feature(rustc_macro)] +#![feature(proc_macro)] #[macro_use] extern crate serde_derive; diff --git a/serde_derive/tests/compile-fail/duplicate-attribute/two-rename-ser.rs b/serde_derive/tests/compile-fail/duplicate-attribute/two-rename-ser.rs index a518839d..d6054529 100644 --- a/serde_derive/tests/compile-fail/duplicate-attribute/two-rename-ser.rs +++ b/serde_derive/tests/compile-fail/duplicate-attribute/two-rename-ser.rs @@ -1,4 +1,4 @@ -#![feature(rustc_macro)] +#![feature(proc_macro)] #[macro_use] extern crate serde_derive; diff --git a/serde_derive/tests/compile-fail/str_ref_deser.rs b/serde_derive/tests/compile-fail/str_ref_deser.rs index 9a99e72b..58ae577c 100644 --- a/serde_derive/tests/compile-fail/str_ref_deser.rs +++ b/serde_derive/tests/compile-fail/str_ref_deser.rs @@ -1,4 +1,4 @@ -#![feature(rustc_macro)] +#![feature(proc_macro)] #[macro_use] extern crate serde_derive; diff --git a/serde_derive/tests/compile-fail/unknown-attribute/container.rs b/serde_derive/tests/compile-fail/unknown-attribute/container.rs index 2b0e1cb2..575cc10c 100644 --- a/serde_derive/tests/compile-fail/unknown-attribute/container.rs +++ b/serde_derive/tests/compile-fail/unknown-attribute/container.rs @@ -1,4 +1,4 @@ -#![feature(rustc_macro)] +#![feature(proc_macro)] #[macro_use] extern crate serde_derive; diff --git a/serde_derive/tests/compile-fail/unknown-attribute/field.rs b/serde_derive/tests/compile-fail/unknown-attribute/field.rs index 1b2d8e6c..457ce520 100644 --- a/serde_derive/tests/compile-fail/unknown-attribute/field.rs +++ b/serde_derive/tests/compile-fail/unknown-attribute/field.rs @@ -1,4 +1,4 @@ -#![feature(rustc_macro)] +#![feature(proc_macro)] #[macro_use] extern crate serde_derive; diff --git a/serde_derive/tests/compile-fail/unknown-attribute/variant.rs b/serde_derive/tests/compile-fail/unknown-attribute/variant.rs index 239fcc89..af5c323a 100644 --- a/serde_derive/tests/compile-fail/unknown-attribute/variant.rs +++ b/serde_derive/tests/compile-fail/unknown-attribute/variant.rs @@ -1,4 +1,4 @@ -#![feature(rustc_macro)] +#![feature(proc_macro)] #[macro_use] extern crate serde_derive; diff --git a/serde_derive/tests/run-pass/identity-op.rs b/serde_derive/tests/run-pass/identity-op.rs index 47e2c750..0def143e 100644 --- a/serde_derive/tests/run-pass/identity-op.rs +++ b/serde_derive/tests/run-pass/identity-op.rs @@ -1,4 +1,4 @@ -#![feature(rustc_macro)] +#![feature(proc_macro)] #![deny(identity_op)] #[macro_use] diff --git a/serde_derive/tests/test.rs b/serde_derive/tests/test.rs index 80239edf..696a4bc4 100644 --- a/serde_derive/tests/test.rs +++ b/serde_derive/tests/test.rs @@ -1,4 +1,4 @@ -#![feature(test, rustc_macro, rustc_attrs)] +#![feature(test, proc_macro, rustc_attrs)] #[macro_use] extern crate serde_derive;