@@ -36,7 +36,6 @@ use rustc_metadata::creader::CrateLoader;
36
36
use rustc_metadata:: cstore:: CStore ;
37
37
38
38
use syntax:: { struct_span_err, unwrap_or} ;
39
- use syntax:: expand:: SpecialDerives ;
40
39
use syntax:: ast:: { self , Name , NodeId , Ident , FloatTy , IntTy , UintTy } ;
41
40
use syntax:: ast:: { CRATE_NODE_ID , Crate } ;
42
41
use syntax:: ast:: { ItemKind , Path } ;
@@ -934,10 +933,10 @@ pub struct Resolver<'a> {
934
933
multi_segment_macro_resolutions : Vec < ( Vec < Segment > , Span , MacroKind , ParentScope < ' a > ,
935
934
Option < Res > ) > ,
936
935
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.
938
937
/// Derive macros cannot modify the item themselves and have to store the markers in the global
939
938
/// 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 > ,
941
940
/// Parent scopes in which the macros were invoked.
942
941
/// FIXME: `derives` are missing in these parent scopes and need to be taken from elsewhere.
943
942
invocation_parent_scopes : FxHashMap < ExpnId , ParentScope < ' a > > ,
@@ -1076,12 +1075,6 @@ impl<'a> hir::lowering::Resolver for Resolver<'a> {
1076
1075
& mut self . definitions
1077
1076
}
1078
1077
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
-
1085
1078
fn lint_buffer ( & mut self ) -> & mut lint:: LintBuffer {
1086
1079
& mut self . lint_buffer
1087
1080
}
@@ -1226,7 +1219,7 @@ impl<'a> Resolver<'a> {
1226
1219
single_segment_macro_resolutions : Default :: default ( ) ,
1227
1220
multi_segment_macro_resolutions : Default :: default ( ) ,
1228
1221
builtin_attrs : Default :: default ( ) ,
1229
- special_derives : Default :: default ( ) ,
1222
+ copy_derives : Default :: default ( ) ,
1230
1223
active_features :
1231
1224
features. declared_lib_features . iter ( ) . map ( |( feat, ..) | * feat)
1232
1225
. chain ( features. declared_lang_features . iter ( ) . map ( |( feat, ..) | * feat) )
@@ -1312,10 +1305,6 @@ impl<'a> Resolver<'a> {
1312
1305
}
1313
1306
}
1314
1307
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
-
1319
1308
/// Entry point to crate resolution.
1320
1309
pub fn resolve_crate ( & mut self , krate : & Crate ) {
1321
1310
let _prof_timer =
0 commit comments