Skip to content

Commit 0119674

Browse files
authored
Merge pull request #1183 from rust-osdev/bishop-update-ui-test
Fix uefi-macros trybuild test
2 parents 1d1478d + 2056a0a commit 0119674

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

uefi-macros/tests/ui/fail/entry_bad_return_type.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ error[E0308]: mismatched types
44
8 | 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`

xtask/src/cargo.rs

+15
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)