Fix [patch] causing updates with a virtual manifest
authorAlex Crichton <alex@alexcrichton.com>
Thu, 5 Oct 2017 22:11:25 +0000 (15:11 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 6 Oct 2017 00:01:34 +0000 (17:01 -0700)
commitf0a52633b06011ff811c41cc99b35456d67e023d
tree39a05c758d9eb32f7186688e4adbe1557283dedb
parent5068cb606aadb5e70238a3a52e52749f21b11055
Fix [patch] causing updates with a virtual manifest

This commit fixes the [patch] implementation to avoid causing spurious updates
of the registry when specified inside of a virtual manifest via a path
dependency that was otherwise outside of the workspace.

Cargo previously attempted to learn about path dependencies through the
configuration of the workspace by looking at members, their path dependencies,
and their replace sections. The replace/patch sections, however, only matter at
the root of the workspace and those weren't looked at! This commit fixes this
problem by explicitly looking at the workspace's replace/patch sections and
avoiding looking at other manifest replace/patch which shouldn't matter.

Closes #4552
src/cargo/core/resolver/encode.rs
tests/patch.rs