@@ -36,7 +36,6 @@ use rustc_metadata::creader::CrateLoader;
3636use rustc_metadata:: cstore:: CStore ;
3737
3838use syntax:: { struct_span_err, unwrap_or} ;
39- use syntax:: expand:: SpecialDerives ;
4039use syntax:: ast:: { self , Name , NodeId , Ident , FloatTy , IntTy , UintTy } ;
4140use syntax:: ast:: { CRATE_NODE_ID , Crate } ;
4241use syntax:: ast:: { ItemKind , Path } ;
@@ -934,10 +933,10 @@ pub struct Resolver<'a> {
934933 multi_segment_macro_resolutions : Vec < ( Vec < Segment > , Span , MacroKind , ParentScope < ' a > ,
935934 Option < Res > ) > ,
936935 builtin_attrs : Vec < ( Ident , ParentScope < ' a > ) > ,
937- /// Some built-in derives mark items they are applied to so they are treated specially later.
936+ /// `derive(Copy)` marks items they are applied to so they are treated specially later.
938937 /// Derive macros cannot modify the item themselves and have to store the markers in the global
939938 /// context, so they attach the markers to derive container IDs using this resolver table.
940- special_derives : FxHashMap < ExpnId , SpecialDerives > ,
939+ copy_derives : FxHashSet < ExpnId > ,
941940 /// Parent scopes in which the macros were invoked.
942941 /// FIXME: `derives` are missing in these parent scopes and need to be taken from elsewhere.
943942 invocation_parent_scopes : FxHashMap < ExpnId , ParentScope < ' a > > ,
@@ -1076,12 +1075,6 @@ impl<'a> hir::lowering::Resolver for Resolver<'a> {
10761075 & mut self . definitions
10771076 }
10781077
1079- fn has_derives ( & self , node_id : NodeId , derives : SpecialDerives ) -> bool {
1080- let def_id = self . definitions . local_def_id ( node_id) ;
1081- let expn_id = self . definitions . expansion_that_defined ( def_id. index ) ;
1082- self . has_derives ( expn_id, derives)
1083- }
1084-
10851078 fn lint_buffer ( & mut self ) -> & mut lint:: LintBuffer {
10861079 & mut self . lint_buffer
10871080 }
@@ -1226,7 +1219,7 @@ impl<'a> Resolver<'a> {
12261219 single_segment_macro_resolutions : Default :: default ( ) ,
12271220 multi_segment_macro_resolutions : Default :: default ( ) ,
12281221 builtin_attrs : Default :: default ( ) ,
1229- special_derives : Default :: default ( ) ,
1222+ copy_derives : Default :: default ( ) ,
12301223 active_features :
12311224 features. declared_lib_features . iter ( ) . map ( |( feat, ..) | * feat)
12321225 . chain ( features. declared_lang_features . iter ( ) . map ( |( feat, ..) | * feat) )
@@ -1312,10 +1305,6 @@ impl<'a> Resolver<'a> {
13121305 }
13131306 }
13141307
1315- fn has_derives ( & self , expn_id : ExpnId , markers : SpecialDerives ) -> bool {
1316- self . special_derives . get ( & expn_id) . map_or ( false , |m| m. contains ( markers) )
1317- }
1318-
13191308 /// Entry point to crate resolution.
13201309 pub fn resolve_crate ( & mut self , krate : & Crate ) {
13211310 let _prof_timer =
0 commit comments