@@ -22,7 +22,6 @@ use syntax::ast;
22
22
use rustc:: hir;
23
23
use rustc:: hir:: itemlikevisit:: ItemLikeVisitor ;
24
24
25
- use rustc_data_structures:: transitive_relation:: TransitiveRelation ;
26
25
use rustc_data_structures:: stable_hasher:: StableHashingContextProvider ;
27
26
28
27
use super :: terms:: * ;
@@ -38,11 +37,6 @@ pub struct ConstraintContext<'a, 'tcx: 'a> {
38
37
bivariant : VarianceTermPtr < ' a > ,
39
38
40
39
pub constraints : Vec < Constraint < ' a > > ,
41
-
42
- /// This relation tracks the dependencies between the variance of
43
- /// various items. In particular, if `a < b`, then the variance of
44
- /// `a` depends on the sources of `b`.
45
- pub dependencies : TransitiveRelation < DefId > ,
46
40
}
47
41
48
42
/// Declares that the variable `decl_id` appears in a location with
@@ -63,7 +57,6 @@ pub struct Constraint<'a> {
63
57
/// then while we are visiting `Bar<T>`, the `CurrentItem` would have
64
58
/// the def-id and the start of `Foo`'s inferreds.
65
59
pub struct CurrentItem {
66
- def_id : DefId ,
67
60
inferred_start : InferredIndex ,
68
61
}
69
62
@@ -81,7 +74,6 @@ pub fn add_constraints_from_crate<'a, 'tcx>(terms_cx: TermsContext<'a, 'tcx>)
81
74
invariant,
82
75
bivariant,
83
76
constraints : Vec :: new ( ) ,
84
- dependencies : TransitiveRelation :: new ( ) ,
85
77
} ;
86
78
87
79
tcx. hir . krate ( ) . visit_all_item_likes ( & mut constraint_cx) ;
@@ -201,7 +193,7 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
201
193
202
194
let id = tcx. hir . as_local_node_id ( def_id) . unwrap ( ) ;
203
195
let inferred_start = self . terms_cx . inferred_starts [ & id] ;
204
- let current_item = & CurrentItem { def_id , inferred_start } ;
196
+ let current_item = & CurrentItem { inferred_start } ;
205
197
match tcx. type_of ( def_id) . sty {
206
198
ty:: TyAdt ( def, _) => {
207
199
// Not entirely obvious: constraints on structs/enums do not
@@ -410,12 +402,6 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
410
402
return ;
411
403
}
412
404
413
- // Add a corresponding relation into the dependencies to
414
- // indicate that the variance for `current` relies on `def_id`.
415
- if self . tcx ( ) . dep_graph . is_fully_enabled ( ) {
416
- self . dependencies . add ( current. def_id , def_id) ;
417
- }
418
-
419
405
let ( local, remote) = if let Some ( id) = self . tcx ( ) . hir . as_local_node_id ( def_id) {
420
406
( Some ( self . terms_cx . inferred_starts [ & id] ) , None )
421
407
} else {
0 commit comments