Auto merge of #236 - cuviper:proc-macro, r=hauleth
derive: update to proc-macro
This commit is contained in:
commit
f2aecb591c
|
@ -21,7 +21,6 @@ path = ".."
|
|||
version = "0.1"
|
||||
|
||||
[lib]
|
||||
crate-type = ["rustc-macro"]
|
||||
name = "num_derive"
|
||||
rustc-macro = true
|
||||
proc-macro = true
|
||||
test = false
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue