Auto merge of #5307 - alexcrichton:another-fix, r=matklad
authorbors <bors@rust-lang.org>
Fri, 6 Apr 2018 19:45:16 +0000 (19:45 +0000)
committerbors <bors@rust-lang.org>
Fri, 6 Apr 2018 19:45:16 +0000 (19:45 +0000)
Fix another issue of poisoning too eagerly

This commit extends the fix in #5288 by moving the logic added farther up in the
loop over package dependencies. This means that we won't recursively look at
optional/dev path dependencies which aren't members of the workspace. This
should fix the new issue that came up in #5257

Closes #5257


Trivial merge