derive: update to proc-macro
This commit is contained in:
parent
b6db1eace9
commit
97551ade5b
|
@ -21,7 +21,6 @@ path = ".."
|
||||||
version = "0.1"
|
version = "0.1"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
crate-type = ["rustc-macro"]
|
|
||||||
name = "num_derive"
|
name = "num_derive"
|
||||||
rustc-macro = true
|
proc-macro = true
|
||||||
test = false
|
test = false
|
||||||
|
|
|
@ -8,20 +8,20 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![crate_type = "rustc-macro"]
|
#![crate_type = "proc-macro"]
|
||||||
#![feature(rustc_macro, rustc_macro_lib)]
|
#![feature(proc_macro, proc_macro_lib)]
|
||||||
|
|
||||||
extern crate syn;
|
extern crate syn;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate quote;
|
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::Body::Enum;
|
||||||
use syn::VariantData::Unit;
|
use syn::VariantData::Unit;
|
||||||
|
|
||||||
#[rustc_macro_derive(FromPrimitive)]
|
#[proc_macro_derive(FromPrimitive)]
|
||||||
pub fn from_primitive(input: TokenStream) -> TokenStream {
|
pub fn from_primitive(input: TokenStream) -> TokenStream {
|
||||||
let source = input.to_string();
|
let source = input.to_string();
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(rustc_macro)]
|
#![feature(proc_macro)]
|
||||||
|
|
||||||
extern crate num;
|
extern crate num;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(rustc_macro)]
|
#![feature(proc_macro)]
|
||||||
|
|
||||||
extern crate num;
|
extern crate num;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(rustc_macro)]
|
#![feature(proc_macro)]
|
||||||
|
|
||||||
extern crate num;
|
extern crate num;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(rustc_macro)]
|
#![feature(proc_macro)]
|
||||||
|
|
||||||
extern crate num;
|
extern crate num;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(rustc_macro)]
|
#![feature(proc_macro)]
|
||||||
|
|
||||||
extern crate num;
|
extern crate num;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
Loading…
Reference in New Issue