@@ -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,12 +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
- /// FIXME: Find a way for `PartialEq` and `Eq` to emulate `#[structural_match]`
941
- /// by marking the produced impls rather than the original items.
942
- special_derives : FxHashMap < ExpnId , SpecialDerives > ,
939
+ containers_deriving_copy : FxHashSet < ExpnId > ,
943
940
/// Parent scopes in which the macros were invoked.
944
941
/// FIXME: `derives` are missing in these parent scopes and need to be taken from elsewhere.
945
942
invocation_parent_scopes : FxHashMap < ExpnId , ParentScope < ' a > > ,
@@ -1078,12 +1075,6 @@ impl<'a> hir::lowering::Resolver for Resolver<'a> {
1078
1075
& mut self . definitions
1079
1076
}
1080
1077
1081
- fn has_derives ( & self , node_id : NodeId , derives : SpecialDerives ) -> bool {
1082
- let def_id = self . definitions . local_def_id ( node_id) ;
1083
- let expn_id = self . definitions . expansion_that_defined ( def_id. index ) ;
1084
- self . has_derives ( expn_id, derives)
1085
- }
1086
-
1087
1078
fn lint_buffer ( & mut self ) -> & mut lint:: LintBuffer {
1088
1079
& mut self . lint_buffer
1089
1080
}
@@ -1228,7 +1219,7 @@ impl<'a> Resolver<'a> {
1228
1219
single_segment_macro_resolutions : Default :: default ( ) ,
1229
1220
multi_segment_macro_resolutions : Default :: default ( ) ,
1230
1221
builtin_attrs : Default :: default ( ) ,
1231
- special_derives : Default :: default ( ) ,
1222
+ containers_deriving_copy : Default :: default ( ) ,
1232
1223
active_features :
1233
1224
features. declared_lib_features . iter ( ) . map ( |( feat, ..) | * feat)
1234
1225
. chain ( features. declared_lang_features . iter ( ) . map ( |( feat, ..) | * feat) )
@@ -1314,10 +1305,6 @@ impl<'a> Resolver<'a> {
1314
1305
}
1315
1306
}
1316
1307
1317
- fn has_derives ( & self , expn_id : ExpnId , markers : SpecialDerives ) -> bool {
1318
- self . special_derives . get ( & expn_id) . map_or ( false , |m| m. contains ( markers) )
1319
- }
1320
-
1321
1308
/// Entry point to crate resolution.
1322
1309
pub fn resolve_crate ( & mut self , krate : & Crate ) {
1323
1310
let _prof_timer =
0 commit comments