derive: update to proc-macro

This commit is contained in:
Josh Stone 2016-10-13 10:31:49 -07:00
parent b6db1eace9
commit 97551ade5b
7 changed files with 11 additions and 12 deletions

View File

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

View File

@ -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();

View File

@ -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]

View File

@ -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]

View File

@ -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]

View File

@ -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]

View File

@ -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]