File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
src/cargo/core/compiler/build_context Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,10 @@ impl TargetInfo {
206
206
process. arg ( "--print=crate-name" ) ; // `___` as a delimiter.
207
207
process. arg ( "--print=cfg" ) ;
208
208
209
+ // parse_crate_type() relies on "unsupported/unknown crate type" error message,
210
+ // so make warnings always emitted as warnings.
211
+ process. arg ( "-Wwarnings" ) ;
212
+
209
213
let ( output, error) = rustc
210
214
. cached_output ( & process, extra_fingerprint)
211
215
. with_context ( || {
Original file line number Diff line number Diff line change @@ -1287,11 +1287,11 @@ fn always_emit_warnings_as_warnings_when_learning_target_info() {
1287
1287
p. cargo ( "build -v --target" )
1288
1288
. env ( "RUSTFLAGS" , "-Awarnings" )
1289
1289
. arg ( target)
1290
- . with_status ( 101 )
1291
1290
. with_stderr_data ( str![ [ r#"
1292
- [ERROR] output of --print=file-names missing when learning about target-specific information from rustc
1293
- command was: `rustc - --crate-name ___ --print=file-names -Awarnings --target wasm32-unknown-unknown --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg`
1294
- ...
1291
+ [COMPILING] foo v0.0.0 ([ROOT]/foo)
1292
+ [RUNNING] `rustc --crate-name foo [..]-Awarnings[..]`
1293
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
1294
+
1295
1295
"# ] ] )
1296
1296
. run ( ) ;
1297
1297
}
You can’t perform that action at this time.
0 commit comments