@@ -8,13 +8,11 @@ fn gated_by_unstable_opts() {
88 . build ( ) ;
99
1010 p. cargo ( "check --compile-time-deps" )
11- . with_status ( 1 )
11+ . with_status ( 101 )
1212 . with_stderr_data ( str![ [ r#"
13- [ERROR] unexpected argument '--compile-time-deps' found
14-
15- Usage: cargo check [OPTIONS]
16-
17- For more information, try '--help'.
13+ [ERROR] the `--compile-time-deps` flag is unstable, and only available on the nightly channel of Cargo, but this is the `stable` channel
14+ See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more information about Rust release channels.
15+ See https://github.com/rust-lang/cargo/issues/14434 for more information about the `--compile-time-deps` flag.
1816
1917"# ] ] )
2018 . run ( ) ;
@@ -55,11 +53,10 @@ fn non_comp_time_dep() {
5553 . file ( "bar/src/lib.rs" , r#"pub fn bar() {}"# )
5654 . build ( ) ;
5755
58- p. cargo ( "check" )
56+ p. cargo ( "-Zunstable-options check --compile-time-deps" )
57+ . masquerade_as_nightly_cargo ( & [ "compile-time-deps" ] )
5958 . with_stderr_data ( str![ [ r#"
6059[LOCKING] 1 package to latest compatible version
61- [CHECKING] bar v0.0.1 ([ROOT]/foo/bar)
62- [CHECKING] foo v0.0.1 ([ROOT]/foo)
6360[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
6461
6562"# ] ] )
@@ -151,33 +148,33 @@ fn proc_macro_dep() {
151148 . file ( "baz/src/lib.rs" , r#"pub fn baz() {}"# )
152149 . build ( ) ;
153150
154- p. cargo ( "check --package foo" )
151+ p. cargo ( "-Zunstable-options check --package foo --compile-time-deps" )
152+ . masquerade_as_nightly_cargo ( & [ "compile-time-deps" ] )
155153 . with_stderr_data ( str![ [ r#"
156154[COMPILING] baz v0.0.1 ([ROOT]/foo/baz)
157155[COMPILING] bar v0.0.1 ([ROOT]/foo/bar)
158- [CHECKING] foo v0.0.1 ([ROOT]/foo/foo)
159156[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
160157
161158"# ] ] )
162159 . run ( ) ;
163160
164161 p. cargo ( "clean" ) . run ( ) ;
165162
166- p. cargo ( "check --package bar" )
163+ p. cargo ( "-Zunstable-options check --package bar --compile-time-deps" )
164+ . masquerade_as_nightly_cargo ( & [ "compile-time-deps" ] )
167165 . with_stderr_data ( str![ [ r#"
168- [CHECKING] baz v0.0.1 ([ROOT]/foo/baz)
169- [CHECKING] bar v0.0.1 ([ROOT]/foo/bar)
170166[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
171167
172168"# ] ] )
173169 . run ( ) ;
174170
175171 p. cargo ( "clean" ) . run ( ) ;
176172
177- p. cargo ( "check --package bar --all-targets" )
173+ p. cargo ( "-Zunstable-options check --package bar --all-targets --compile-time-deps" )
174+ . masquerade_as_nightly_cargo ( & [ "compile-time-deps" ] )
178175 . with_stderr_data ( str![ [ r#"
179- [CHECKING ] baz v0.0.1 ([ROOT]/foo/baz)
180- [CHECKING ] bar v0.0.1 ([ROOT]/foo/bar)
176+ [COMPILING ] baz v0.0.1 ([ROOT]/foo/baz)
177+ [COMPILING ] bar v0.0.1 ([ROOT]/foo/bar)
181178[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
182179
183180"# ] ] )
@@ -241,7 +238,8 @@ fn build_dep() {
241238 . file ( "bar/baz/src/lib.rs" , r#"pub fn baz() {}"# )
242239 . build ( ) ;
243240
244- p. cargo ( "check" )
241+ p. cargo ( "-Zunstable-options check --compile-time-deps" )
242+ . masquerade_as_nightly_cargo ( & [ "compile-time-deps" ] )
245243 . with_stderr_data ( str![ [ r#"
246244[LOCKING] 2 packages to latest compatible versions
247245[COMPILING] baz v0.0.1 ([ROOT]/foo/bar/baz)
@@ -314,12 +312,12 @@ fn indirect_comp_time_dep() {
314312 . file ( "bar/baz/src/lib.rs" , r#"pub fn baz() {}"# )
315313 . build ( ) ;
316314
317- p. cargo ( "check" )
315+ p. cargo ( "-Zunstable-options check --compile-time-deps" )
316+ . masquerade_as_nightly_cargo ( & [ "compile-time-deps" ] )
318317 . with_stderr_data ( str![ [ r#"
319318[LOCKING] 2 packages to latest compatible versions
320319[COMPILING] baz v0.0.1 ([ROOT]/foo/bar/baz)
321320[COMPILING] bar v0.0.1 ([ROOT]/foo/bar)
322- [CHECKING] foo v0.0.1 ([ROOT]/foo)
323321[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
324322
325323"# ] ] )
@@ -379,21 +377,21 @@ fn tests_target() {
379377 )
380378 . build ( ) ;
381379
382- p. cargo ( "check --tests" )
380+ p. cargo ( "-Zunstable-options check --tests --compile-time-deps " )
383381 . with_stderr_data ( str![ [ r#"
384382[LOCKING] 1 package to latest compatible version
385383[COMPILING] bar v0.0.1 ([ROOT]/foo/bar)
386- [CHECKING] foo v0.0.1 ([ROOT]/foo)
387384[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
388385
389386"# ] ] )
387+ . masquerade_as_nightly_cargo ( & [ "compile-time-deps" ] )
390388 . run ( ) ;
391389
392390 p. cargo ( "clean" ) . run ( ) ;
393391
394- p. cargo ( "check" )
392+ p. cargo ( "-Zunstable-options check --compile-time-deps" )
393+ . masquerade_as_nightly_cargo ( & [ "compile-time-deps" ] )
395394 . with_stderr_data ( str![ [ r#"
396- [CHECKING] foo v0.0.1 ([ROOT]/foo)
397395[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
398396
399397"# ] ] )
0 commit comments