Browse Source

derive: update to proc-macro

Josh Stone 8 years ago
parent
commit
97551ade5b

+ 1 - 2
derive/Cargo.toml

@@ -21,7 +21,6 @@ path = ".."
 version = "0.1"
 
 [lib]
-crate-type = ["rustc-macro"]
 name = "num_derive"
-rustc-macro = true
+proc-macro = true
 test = false

+ 5 - 5
derive/src/lib.rs

@@ -8,20 +8,20 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![crate_type = "rustc-macro"]
-#![feature(rustc_macro, rustc_macro_lib)]
+#![crate_type = "proc-macro"]
+#![feature(proc_macro, proc_macro_lib)]
 
 extern crate syn;
 #[macro_use]
 extern crate quote;
-extern crate rustc_macro;
+extern crate proc_macro;
 
-use rustc_macro::TokenStream;
+use proc_macro::TokenStream;
 
 use syn::Body::Enum;
 use syn::VariantData::Unit;
 
-#[rustc_macro_derive(FromPrimitive)]
+#[proc_macro_derive(FromPrimitive)]
 pub fn from_primitive(input: TokenStream) -> TokenStream {
     let source = input.to_string();
 

+ 1 - 1
derive/tests/compile-fail/derive_on_struct.rs

@@ -9,7 +9,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(rustc_macro)]
+#![feature(proc_macro)]
 
 extern crate num;
 #[macro_use]

+ 1 - 1
derive/tests/compile-fail/enum_with_associated_data.rs

@@ -9,7 +9,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(rustc_macro)]
+#![feature(proc_macro)]
 
 extern crate num;
 #[macro_use]

+ 1 - 1
derive/tests/empty_enum.rs

@@ -9,7 +9,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(rustc_macro)]
+#![feature(proc_macro)]
 
 extern crate num;
 #[macro_use]

+ 1 - 1
derive/tests/trivial.rs

@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(rustc_macro)]
+#![feature(proc_macro)]
 
 extern crate num;
 #[macro_use]

+ 1 - 1
derive/tests/with_custom_values.rs

@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(rustc_macro)]
+#![feature(proc_macro)]
 
 extern crate num;
 #[macro_use]