Skip to content

Commit 7436682

Browse files
committed
test: make other_thread example no-op on no-std
1 parent 0cd54c5 commit 7436682

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

examples/other_thread.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
#[cfg(all(windows, not(target_vendor = "uwp")))]
1+
#[cfg(all(windows, not(target_vendor = "uwp"), feature = "std"))]
22
use backtrace::{Backtrace, BacktraceFrame};
3-
#[cfg(all(windows, not(target_vendor = "uwp")))]
3+
#[cfg(all(windows, not(target_vendor = "uwp"), feature = "std"))]
44
use std::os::windows::prelude::AsRawHandle;
55

6-
#[cfg(all(windows, not(target_vendor = "uwp")))]
6+
#[cfg(all(windows, not(target_vendor = "uwp"), feature = "std"))]
77
fn worker() {
88
foo();
99
}
1010

11-
#[cfg(all(windows, not(target_vendor = "uwp")))]
11+
#[cfg(all(windows, not(target_vendor = "uwp"), feature = "std"))]
1212
fn foo() {
1313
bar()
1414
}
1515

16-
#[cfg(all(windows, not(target_vendor = "uwp")))]
16+
#[cfg(all(windows, not(target_vendor = "uwp"), feature = "std"))]
1717
fn bar() {
1818
baz()
1919
}
2020

21-
#[cfg(all(windows, not(target_vendor = "uwp")))]
21+
#[cfg(all(windows, not(target_vendor = "uwp"), feature = "std"))]
2222
fn baz() {
2323
println!("Hello from thread!");
2424
// Sleep for simple sync. Can't read thread that has finished running
@@ -28,7 +28,7 @@ fn baz() {
2828
}
2929
}
3030

31-
#[cfg(all(windows, not(target_vendor = "uwp")))]
31+
#[cfg(all(windows, not(target_vendor = "uwp"), feature = "std"))]
3232
fn main() {
3333
let thread = std::thread::spawn(|| {
3434
worker();
@@ -53,5 +53,5 @@ fn main() {
5353

5454
#[cfg(not(all(windows, not(target_vendor = "uwp"))))]
5555
fn main() {
56-
println!("This example is skipped on non Windows platforms");
56+
println!("This example is skipped on non-Windows or no-std platforms");
5757
}

0 commit comments

Comments
 (0)