File tree 4 files changed +46
-6
lines changed
4 files changed +46
-6
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ fn check_with_invalid_target_triple() {
149
149
[ERROR] failed to run `rustc` to learn about target-specific information
150
150
151
151
Caused by:
152
- process didn't exit successfully: `rustc - --crate-name ___ --print=file-names --target unknown-target-triple [..]` ([EXIT_STATUS]: 1)
152
+ process didn't exit successfully: `rustc - --crate-name ___ -Zunstable-options - -print=file-names --target unknown-target-triple [..]` ([EXIT_STATUS]: 1)
153
153
--- stderr
154
154
[ERROR] Error loading target specification: Could not find specification for target "unknown-target-triple". Run `rustc --print target-list` for a list of built-in targets
155
155
Original file line number Diff line number Diff line change @@ -425,7 +425,7 @@ fn bad_crate_type() {
425
425
[ERROR] failed to run `rustc` to learn about crate-type bad_type information
426
426
427
427
Caused by:
428
- process didn't exit successfully: `rustc - --crate-name ___ --print=file-names --crate-type bad_type` ([EXIT_STATUS]: 1)
428
+ process didn't exit successfully: `rustc - --crate-name ___ -Zunstable-options - -print=file-names --crate-type bad_type` ([EXIT_STATUS]: 1)
429
429
--- stderr
430
430
[ERROR] unknown crate type: `bad_type`
431
431
Original file line number Diff line number Diff line change @@ -5199,7 +5199,7 @@ fn rustc_wrapper_queries() {
5199
5199
. env ( "RUSTC_WRAPPER" , & wrapper)
5200
5200
. with_stderr_contains ( "[..]running [..]rustc-echo-wrapper[EXE] rustc -vV[..]" )
5201
5201
. with_stderr_contains (
5202
- "[..]running [..]rustc-echo-wrapper[EXE] rustc - --crate-name ___ --print[..]" ,
5202
+ "[..]running [..]rustc-echo-wrapper[EXE] rustc - --crate-name ___ -Zunstable-options - -print[..]" ,
5203
5203
)
5204
5204
. run ( ) ;
5205
5205
p. build_dir ( ) . rm_rf ( ) ;
@@ -5208,7 +5208,7 @@ fn rustc_wrapper_queries() {
5208
5208
. env ( "RUSTC_WORKSPACE_WRAPPER" , & wrapper)
5209
5209
. with_stderr_contains ( "[..]running [..]rustc-echo-wrapper[EXE] rustc -vV[..]" )
5210
5210
. with_stderr_contains (
5211
- "[..]running [..]rustc-echo-wrapper[EXE] rustc - --crate-name ___ --print[..]" ,
5211
+ "[..]running [..]rustc-echo-wrapper[EXE] rustc - --crate-name ___ -Zunstable-options - -print[..]" ,
5212
5212
)
5213
5213
. run ( ) ;
5214
5214
}
Original file line number Diff line number Diff line change @@ -387,6 +387,17 @@ fn bad_cfg_discovery() {
387
387
}
388
388
};
389
389
390
+ if mode == "no-target-spec-json" {
391
+ return;
392
+ }
393
+ loop {
394
+ let line = lines.next().unwrap();
395
+ println!("{line}");
396
+ if line == "}" {
397
+ break;
398
+ }
399
+ }
400
+
390
401
if mode != "bad-cfg" {
391
402
panic!("unexpected");
392
403
}
@@ -471,10 +482,34 @@ command was: `[..]compiler[..]--crate-type [..]`
471
482
472
483
p. cargo ( "check" )
473
484
. env ( "RUSTC" , & funky_rustc)
474
- . env ( "FUNKY_MODE" , "bad-cfg " )
485
+ . env ( "FUNKY_MODE" , "no-target-spec-json " )
475
486
. with_status ( 101 )
476
487
. with_stderr (
477
488
"\
489
+ [ERROR] output of --print=target-spec-json missing when learning about target-specific information from rustc
490
+ command was: `[..]compiler[..]--crate-type [..]`
491
+
492
+ --- stdout
493
+ [..]___[..]
494
+ [..]___[..]
495
+ [..]___[..]
496
+ [..]___[..]
497
+ [..]___[..]
498
+ [..]___[..]
499
+ [..]
500
+ [..]
501
+ ___
502
+
503
+ " ,
504
+ )
505
+ . run ( ) ;
506
+
507
+ p. cargo ( "check" )
508
+ . env ( "RUSTC" , & funky_rustc)
509
+ . env ( "FUNKY_MODE" , "bad-cfg" )
510
+ . with_status ( 101 )
511
+ . with_stderr_contains (
512
+ "\
478
513
[ERROR] failed to parse the cfg from `rustc --print=cfg`, got:
479
514
[..]___[..]
480
515
[..]___[..]
@@ -483,8 +518,13 @@ command was: `[..]compiler[..]--crate-type [..]`
483
518
[..]___[..]
484
519
[..]___[..]
485
520
[..]
486
- [..],[..]
521
+ [..]
487
522
___
523
+ {
524
+ " ,
525
+ )
526
+ . with_stderr_contains (
527
+ "\
488
528
123
489
529
490
530
You can’t perform that action at this time.
0 commit comments