File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,12 @@ impl<'cfg> PackageRegistry<'cfg> {
195
195
self . yanked_whitelist . extend ( pkgs) ;
196
196
}
197
197
198
+ /// remove all residual state from previous lock files.
199
+ pub fn clear_lock ( & mut self ) {
200
+ trace ! ( "clear_lock" ) ;
201
+ self . locked = HashMap :: new ( ) ;
202
+ }
203
+
198
204
pub fn register_lock ( & mut self , id : PackageId , deps : Vec < PackageId > ) {
199
205
trace ! ( "register_lock: {}" , id) ;
200
206
for dep in deps. iter ( ) {
Original file line number Diff line number Diff line change @@ -584,6 +584,7 @@ fn register_previous_locks(
584
584
// the registry as a locked dependency.
585
585
let keep = |id : & PackageId | keep ( id) && !avoid_locking. contains ( id) ;
586
586
587
+ registry. clear_lock ( ) ;
587
588
for node in resolve. iter ( ) . filter ( keep) {
588
589
let deps = resolve
589
590
. deps_not_replaced ( node)
Original file line number Diff line number Diff line change @@ -4934,6 +4934,7 @@ use cargo_test_support::registry::Dependency;
4934
4934
4935
4935
#[ cargo_test]
4936
4936
fn reduced_reproduction_8249 ( ) {
4937
+ // https://github.com/rust-lang/cargo/issues/8249
4937
4938
Package :: new ( "a-src" , "0.1.0" ) . links ( "a" ) . publish ( ) ;
4938
4939
Package :: new ( "a-src" , "0.2.0" ) . links ( "a" ) . publish ( ) ;
4939
4940
@@ -4966,10 +4967,6 @@ fn reduced_reproduction_8249() {
4966
4967
4967
4968
p. cargo ( "generate-lockfile" ) . run ( ) ;
4968
4969
cargo:: util:: paths:: append ( & p. root ( ) . join ( "Cargo.toml" ) , b"c = \" *\" " ) . unwrap ( ) ;
4969
- p. cargo ( "check" )
4970
- . with_status ( 101 )
4971
- . with_stderr_contains ( "[..]links to the native library `a`[..]" )
4972
- . run ( ) ;
4973
- // This passes, what!?
4970
+ p. cargo ( "check" ) . run ( ) ;
4974
4971
p. cargo ( "check" ) . run ( ) ;
4975
4972
}
You can’t perform that action at this time.
0 commit comments