@@ -128,9 +128,12 @@ fn rustc_bootstrap() {
128
128
)
129
129
. with_status ( 101 )
130
130
. run ( ) ;
131
- // RUSTC_BOOTSTRAP unset on nightly should warn
131
+ // nightly should warn whether or not RUSTC_BOOTSTRAP is set
132
132
p. cargo ( "build" )
133
133
. masquerade_as_nightly_cargo ( )
134
+ // NOTE: uses RUSTC_BOOTSTRAP so it will be propagated to rustc
135
+ // (this matters when tests are being run with a beta or stable cargo)
136
+ . env ( "RUSTC_BOOTSTRAP" , "1" )
134
137
. with_stderr_contains ( "warning: Cannot set `RUSTC_BOOTSTRAP=1` [..]" )
135
138
. run ( ) ;
136
139
// RUSTC_BOOTSTRAP set to the name of the library should warn
@@ -151,21 +154,22 @@ fn rustc_bootstrap() {
151
154
// Tests for binaries instead of libraries
152
155
let p = project ( )
153
156
. file ( "Cargo.toml" , & basic_manifest ( "foo" , "0.0.1" ) )
154
- . file ( "src/main.rs" , "#![feature(rustc_attrs)] fn main()" )
157
+ . file ( "src/main.rs" , "#![feature(rustc_attrs)] fn main() {} " )
155
158
. file ( "build.rs" , build_rs)
156
159
. build ( ) ;
157
- // RUSTC_BOOTSTRAP unconditionally set when there's no library should warn
160
+ // nightly should warn when there's no library whether or not RUSTC_BOOTSTRAP is set
158
161
p. cargo ( "build" )
159
162
. masquerade_as_nightly_cargo ( )
163
+ // NOTE: uses RUSTC_BOOTSTRAP so it will be propagated to rustc
164
+ // (this matters when tests are being run with a beta or stable cargo)
165
+ . env ( "RUSTC_BOOTSTRAP" , "1" )
160
166
. with_stderr_contains ( "warning: Cannot set `RUSTC_BOOTSTRAP=1` [..]" )
161
167
. run ( ) ;
162
168
// RUSTC_BOOTSTRAP conditionally set when there's no library should error (regardless of the value)
163
169
p. cargo ( "build" )
164
170
. env ( "RUSTC_BOOTSTRAP" , "foo" )
165
171
. with_stderr_contains ( "error: Cannot set `RUSTC_BOOTSTRAP=1` [..]" )
166
- . with_stderr_does_not_contain (
167
- "help: [..] set the environment variable `RUSTC_BOOTSTRAP=1` [..]" ,
168
- )
172
+ . with_stderr_contains ( "help: [..] set the environment variable `RUSTC_BOOTSTRAP=1` [..]" )
169
173
. with_status ( 101 )
170
174
. run ( ) ;
171
175
}
0 commit comments