File tree Expand file tree Collapse file tree 4 files changed +9
-20
lines changed Expand file tree Collapse file tree 4 files changed +9
-20
lines changed Original file line number Diff line number Diff line change @@ -141,15 +141,8 @@ pub mod util {
141141 pub mod bug;
142142}
143143
144- // A private module so that macro-expanded idents like
145- // `::rustc::lint::Lint` will also work in `rustc` itself.
146- //
147- // `libstd` uses the same trick.
148- #[ doc( hidden) ]
149- mod rustc {
150- pub use crate :: lint;
151- pub use crate :: ich;
152- }
144+ // Allows macros to refer to this crate as `::rustc`
145+ extern crate self as rustc;
153146
154147// FIXME(#27438): right now the unit tests of librustc don't refer to any actual
155148// functions generated in librustc_data_structures (all
Original file line number Diff line number Diff line change 22name = " rustc_macros"
33version = " 0.1.0"
44authors = [" The Rust Project Developers" ]
5+ edition = " 2018"
56
67[lib ]
78proc-macro = true
@@ -10,4 +11,4 @@ proc-macro = true
1011synstructure = " 0.10.1"
1112syn = { version = " 0.15.22" , features = [" full" ] }
1213proc-macro2 = " 0.4.24"
13- quote = " 0.6.10"
14+ quote = " 0.6.10"
Original file line number Diff line number Diff line change 11use synstructure;
2- use syn:: { self , Meta , NestedMeta } ;
2+ use syn:: { self , Meta , NestedMeta , parse_quote } ;
33use proc_macro2:: { self , Ident } ;
4+ use quote:: quote;
45
56struct Attributes {
67 ignore : bool ,
@@ -46,7 +47,7 @@ fn parse_attributes(field: &syn::Field) -> Attributes {
4647 attrs
4748}
4849
49- pub fn hash_stable_derive ( mut s : synstructure:: Structure ) -> proc_macro2:: TokenStream {
50+ pub fn hash_stable_derive ( mut s : synstructure:: Structure < ' _ > ) -> proc_macro2:: TokenStream {
5051 let generic: syn:: GenericParam = parse_quote ! ( ' __ctx) ;
5152 s. add_bounds ( synstructure:: AddBounds :: Generics ) ;
5253 s. add_impl_generic ( generic) ;
Original file line number Diff line number Diff line change 11#![ feature( proc_macro_hygiene) ]
2+ #![ deny( rust_2018_idioms) ]
23
3- #[ macro_use]
4- extern crate syn;
5- #[ macro_use]
6- extern crate synstructure;
7- #[ macro_use]
8- extern crate quote;
9- extern crate proc_macro;
10- extern crate proc_macro2;
4+ use synstructure:: decl_derive;
115
126mod hash_stable;
137
You can’t perform that action at this time.
0 commit comments