File tree Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change @@ -332,6 +332,61 @@ fn dependency_rust_version_older_and_newer_than_package() {
332
332
. run ( ) ;
333
333
}
334
334
335
+ #[ cargo_test]
336
+ fn dependency_rust_version_backtracking ( ) {
337
+ Package :: new ( "has-rust-version" , "1.6.0" )
338
+ . rust_version ( "1.65.0" )
339
+ . file ( "src/lib.rs" , "fn other_stuff() {}" )
340
+ . publish ( ) ;
341
+ Package :: new ( "no-rust-version" , "2.1.0" )
342
+ . file ( "src/lib.rs" , "fn other_stuff() {}" )
343
+ . publish ( ) ;
344
+ Package :: new ( "no-rust-version" , "2.2.0" )
345
+ . file ( "src/lib.rs" , "fn other_stuff() {}" )
346
+ . dep ( "has-rust-version" , "1.6.0" )
347
+ . publish ( ) ;
348
+
349
+ let p = project ( )
350
+ . file (
351
+ "Cargo.toml" ,
352
+ r#"
353
+ [package]
354
+ name = "foo"
355
+ version = "0.0.1"
356
+ authors = []
357
+ rust-version = "1.60.0"
358
+ [dependencies]
359
+ no-rust-version = "2"
360
+ "# ,
361
+ )
362
+ . file ( "src/main.rs" , "fn main(){}" )
363
+ . build ( ) ;
364
+
365
+ p. cargo ( "check --ignore-rust-version" )
366
+ . arg ( "-Zmsrv-policy" )
367
+ . masquerade_as_nightly_cargo ( & [ "msrv-policy" ] )
368
+ . with_stderr (
369
+ "\
370
+ [UPDATING] `dummy-registry` index
371
+ [DOWNLOADING] crates ...
372
+ [DOWNLOADED] no-rust-version v2.1.0 (registry `dummy-registry`)
373
+ [CHECKING] no-rust-version v2.1.0
374
+ [CHECKING] [..]
375
+ [FINISHED] [..]
376
+ " ,
377
+ )
378
+ . run ( ) ;
379
+ p. cargo ( "check" )
380
+ . arg ( "-Zmsrv-policy" )
381
+ . masquerade_as_nightly_cargo ( & [ "msrv-policy" ] )
382
+ . with_stderr (
383
+ "\
384
+ [FINISHED] [..]
385
+ " ,
386
+ )
387
+ . run ( ) ;
388
+ }
389
+
335
390
#[ cargo_test]
336
391
fn workspace_with_mixed_rust_version ( ) {
337
392
Package :: new ( "bar" , "1.4.0" )
You can’t perform that action at this time.
0 commit comments