This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed
compiler/rustc_hir_typeck/src
tests/ui/track-diagnostics Expand file tree Collapse file tree 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<'_>) {
436436 tcx. sess. cfg_version,
437437 config:: host_triple( ) ,
438438 ) ) ;
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+ }
439445}
440446
441447fn has_expected_num_generic_args ( tcx : TyCtxt < ' _ > , trait_did : DefId , expected : usize ) -> bool {
Original file line number Diff line number Diff line change 66// normalize-stderr-test ".rs:\d+:\d+" -> ".rs:LL:CC"
77// normalize-stderr-test "note: rustc .+ running on .+" -> "note: rustc $$VERSION running on $$TARGET"
88
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+
914fn main ( ) {
1015 break rust
1116}
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
2020
2121note: rustc $VERSION running on $TARGET
2222
23+ note: compiler flags: ... -Z ui-testing ... -Z track-diagnostics
24+
2325error: aborting due to 3 previous errors
2426
2527Some errors have detailed explanations: E0268, E0425.
You can’t perform that action at this time.
0 commit comments