Skip to content

Commit 7a3a942

Browse files
committed
fix libstd tests
1 parent 5a53dbc commit 7a3a942

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

compiler/rustc_target/src/spec/json.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ impl Target {
152152
forward!(is_like_wasm);
153153
forward!(is_like_android);
154154
forward!(is_like_vexos);
155+
forward!(is_like_solana);
155156
forward!(binary_format);
156157
forward!(default_dwarf_version);
157158
forward!(allows_weak_linkage);
@@ -350,6 +351,7 @@ impl ToJson for Target {
350351
target_option_val!(is_like_wasm);
351352
target_option_val!(is_like_android);
352353
target_option_val!(is_like_vexos);
354+
target_option_val!(is_like_solana);
353355
target_option_val!(binary_format);
354356
target_option_val!(default_dwarf_version);
355357
target_option_val!(allows_weak_linkage);
@@ -572,6 +574,7 @@ struct TargetSpecJson {
572574
is_like_wasm: Option<bool>,
573575
is_like_android: Option<bool>,
574576
is_like_vexos: Option<bool>,
577+
is_like_solana: Option<bool>,
575578
binary_format: Option<BinaryFormat>,
576579
default_dwarf_version: Option<u32>,
577580
allows_weak_linkage: Option<bool>,

library/std/src/panicking.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ use core::panic::Location;
1313
#[cfg(not(target_family = "solana"))]
1414
use core::panic::PanicPayload;
1515

16-
#[cfg(not(target_family = "solana"))]
1716
// make sure to use the stderr output configured
1817
// by libtest in the real copy of std
19-
#[cfg(all(test, not(target_family = "solana")))]
20-
use realstd::io::set_output_capture;
18+
#[cfg(not(target_family = "solana"))]
19+
#[cfg(test)]
20+
use realstd::io::try_set_output_capture;
2121

2222
use crate::any::Any;
23-
#[cfg(all(not(test), not(target_arch = "bpf"), not(target_arch = "sbf")))]
23+
#[cfg(not(target_family = "solana"))]
24+
#[cfg(not(test))]
2425
use crate::io::try_set_output_capture;
2526
#[cfg(not(target_family = "solana"))]
2627
use crate::mem::{self, ManuallyDrop};

0 commit comments

Comments
 (0)