File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
uefi-macros/tests/ui/fail Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -4,5 +4,5 @@ error[E0308]: mismatched types
448 | fn main(_handle: Handle, _st: SystemTable<Boot>) -> bool {
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Status`, found `bool`
66 |
7- = note: expected fn pointer `extern "efiapi" fn(uefi::Handle, uefi::table::SystemTable<_ >) -> Status`
8- found fn pointer `extern "efiapi" fn(uefi::Handle, uefi::table::SystemTable<_ >) -> bool`
7+ = note: expected fn pointer `extern "efiapi" fn(uefi::Handle, uefi::table::SystemTable<uefi::table::Boot >) -> Status`
8+ found fn pointer `extern "efiapi" fn(uefi::Handle, uefi::table::SystemTable<uefi::table::Boot >) -> bool`
Original file line number Diff line number Diff line change @@ -271,6 +271,21 @@ impl Cargo {
271271 }
272272 CargoAction :: Test => {
273273 action = "test" ;
274+
275+ // Ensure that uefi-macros trybuild tests work regardless of
276+ // whether RUSTFLAGS is set.
277+ //
278+ // The trybuild tests run `rustc` with `--verbose`, which
279+ // affects error output. This flag is set via
280+ // `--config=build.rustflags` [1], but that will be ignored if
281+ // the RUSTFLAGS env var is set. Compensate by appending
282+ // `--verbose` to the var in that case.
283+ //
284+ // [1]: https://github.com/dtolnay/trybuild/blob/b1b7064b7ad11e0ab563e9eb843651d86e4545b7/src/cargo.rs#L44
285+ if let Ok ( mut rustflags) = env:: var ( "RUSTFLAGS" ) {
286+ rustflags. push_str ( " --verbose" ) ;
287+ cmd. env ( "RUSTFLAGS" , rustflags) ;
288+ }
274289 }
275290 } ;
276291 cmd. arg ( action) ;
You can’t perform that action at this time.
0 commit comments