@@ -154,12 +154,12 @@ impl<'a, 'cfg> JobQueue<'a, 'cfg> {
154
154
let dependencies = cx. dep_targets ( unit) ;
155
155
let mut queue_deps = dependencies
156
156
. iter ( )
157
+ . cloned ( )
157
158
. filter ( |unit| {
158
159
// Binaries aren't actually needed to *compile* tests, just to run
159
160
// them, so we don't include this dependency edge in the job graph.
160
161
!unit. target . is_test ( ) || !unit. target . is_bin ( )
161
162
} )
162
- . cloned ( )
163
163
. map ( |dep| {
164
164
// Handle the case here where our `unit -> dep` dependency may
165
165
// only require the metadata, not the full compilation to
@@ -172,7 +172,7 @@ impl<'a, 'cfg> JobQueue<'a, 'cfg> {
172
172
} ;
173
173
( dep, artifact)
174
174
} )
175
- . collect :: < Vec < _ > > ( ) ;
175
+ . collect :: < HashMap < _ , _ > > ( ) ;
176
176
177
177
// This is somewhat tricky, but we may need to synthesize some
178
178
// dependencies for this target if it requires full upstream
@@ -196,19 +196,18 @@ impl<'a, 'cfg> JobQueue<'a, 'cfg> {
196
196
// `Metadata` propagate upwards `All` dependencies to anything that
197
197
// transitively contains the `Metadata` edge.
198
198
if unit. requires_upstream_objects ( ) {
199
- for dep in dependencies. iter ( ) {
199
+ for dep in dependencies {
200
200
depend_on_deps_of_deps ( cx, & mut queue_deps, dep) ;
201
201
}
202
202
203
203
fn depend_on_deps_of_deps < ' a > (
204
204
cx : & Context < ' a , ' _ > ,
205
- deps : & mut Vec < ( Unit < ' a > , Artifact ) > ,
206
- unit : & Unit < ' a > ,
205
+ deps : & mut HashMap < Unit < ' a > , Artifact > ,
206
+ unit : Unit < ' a > ,
207
207
) {
208
- for dep in cx. dep_targets ( unit) {
209
- if cx. only_requires_rmeta ( unit, & dep) {
210
- deps. push ( ( dep, Artifact :: All ) ) ;
211
- depend_on_deps_of_deps ( cx, deps, & dep) ;
208
+ for dep in cx. dep_targets ( & unit) {
209
+ if deps. insert ( dep, Artifact :: All ) . is_none ( ) {
210
+ depend_on_deps_of_deps ( cx, deps, dep) ;
212
211
}
213
212
}
214
213
}
0 commit comments