@@ -221,6 +221,65 @@ fn force_rebuild_displays_error() {
221
221
. run ( ) ;
222
222
}
223
223
224
+ // Confirm that force rebuild works correctly with dependencies which are also a target
225
+ #[ test]
226
+ fn check_force_rebuild_with_workspace_dependencies ( ) {
227
+ let p = project ( )
228
+ . file (
229
+ "Cargo.toml" ,
230
+ r#"
231
+ [workspace]
232
+ members = ["a", "b", "c", "d", "e", "f"]
233
+ "# ,
234
+ )
235
+ . file (
236
+ "a/Cargo.toml" ,
237
+ r#"
238
+ [package]
239
+ name = "a"
240
+ version = "0.1.0"
241
+
242
+ [dependencies]
243
+ b = { path = "../b" }
244
+ c = { path = "../c" }
245
+ d = { path = "../d" }
246
+ e = { path = "../e" }
247
+ f = { path = "../f" }
248
+ "# ,
249
+ )
250
+ . file ( "a/src/lib.rs" , "" )
251
+ . file ( "b/Cargo.toml" , & basic_manifest ( "b" , "0.0.1" ) )
252
+ . file ( "b/src/lib.rs" , "" )
253
+ . file ( "c/Cargo.toml" , & basic_manifest ( "c" , "0.0.1" ) )
254
+ . file ( "c/src/lib.rs" , "" )
255
+ . file ( "d/Cargo.toml" , & basic_manifest ( "d" , "0.0.1" ) )
256
+ . file ( "d/src/lib.rs" , "" )
257
+ . file ( "e/Cargo.toml" , & basic_manifest ( "e" , "0.0.1" ) )
258
+ . file ( "e/src/lib.rs" , "" )
259
+ . file ( "f/Cargo.toml" , & basic_manifest ( "f" , "0.0.1" ) )
260
+ . file ( "f/src/lib.rs" , "" )
261
+ . build ( ) ;
262
+
263
+ p. cargo ( "check --all" )
264
+ . with_stderr_contains ( "[CHECKING] a [..]" )
265
+ . with_stderr_contains ( "[CHECKING] b [..]" )
266
+ . with_stderr_contains ( "[CHECKING] c [..]" )
267
+ . with_stderr_contains ( "[CHECKING] d [..]" )
268
+ . with_stderr_contains ( "[CHECKING] e [..]" )
269
+ . with_stderr_contains ( "[CHECKING] f [..]" )
270
+ . run ( ) ;
271
+
272
+ p. cargo ( "check --all -Z unstable-options --force-rebuild" )
273
+ . masquerade_as_nightly_cargo ( )
274
+ . with_stderr_contains ( "[CHECKING] a [..]" )
275
+ . with_stderr_contains ( "[CHECKING] b [..]" )
276
+ . with_stderr_contains ( "[CHECKING] c [..]" )
277
+ . with_stderr_contains ( "[CHECKING] d [..]" )
278
+ . with_stderr_contains ( "[CHECKING] e [..]" )
279
+ . with_stderr_contains ( "[CHECKING] f [..]" )
280
+ . run ( ) ;
281
+ }
282
+
224
283
// Checks that where a project has both a lib and a bin, the lib is only checked
225
284
// not built.
226
285
#[ test]
0 commit comments