File tree 3 files changed +13
-0
lines changed
compiler/rustc_hir_typeck/src
tests/ui/track-diagnostics
3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -436,6 +436,12 @@ fn fatally_break_rust(tcx: TyCtxt<'_>) {
436
436
tcx. sess. cfg_version,
437
437
config:: host_triple( ) ,
438
438
) ) ;
439
+ if let Some ( ( flags, excluded_cargo_defaults) ) = rustc_session:: utils:: extra_compiler_flags ( ) {
440
+ handler. note_without_error ( format ! ( "compiler flags: {}" , flags. join( " " ) ) ) ;
441
+ if excluded_cargo_defaults {
442
+ handler. note_without_error ( "some of the compiler flags provided by cargo are hidden" ) ;
443
+ }
444
+ }
439
445
}
440
446
441
447
fn has_expected_num_generic_args ( tcx : TyCtxt < ' _ > , trait_did : DefId , expected : usize ) -> bool {
Original file line number Diff line number Diff line change 6
6
// normalize-stderr-test ".rs:\d+:\d+" -> ".rs:LL:CC"
7
7
// normalize-stderr-test "note: rustc .+ running on .+" -> "note: rustc $$VERSION running on $$TARGET"
8
8
9
+ // The test becomes too flaky if we care about exact args. If `-Z ui-testing`
10
+ // from compiletest and `-Z track-diagnostics` from `// compile-flags` at the
11
+ // top of this file are present, then assume all args are present.
12
+ // normalize-stderr-test "note: compiler flags: .*-Z ui-testing.*-Z track-diagnostics" -> "note: compiler flags: ... -Z ui-testing ... -Z track-diagnostics"
13
+
9
14
fn main ( ) {
10
15
break rust
11
16
}
Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ note: we would appreciate a joke overview: https://github.com/rust-lang/rust/iss
20
20
21
21
note: rustc $VERSION running on $TARGET
22
22
23
+ note: compiler flags: ... -Z ui-testing ... -Z track-diagnostics
24
+
23
25
error: aborting due to 3 previous errors
24
26
25
27
Some errors have detailed explanations: E0268, E0425.
You can’t perform that action at this time.
0 commit comments