Skip to content

Commit 7cc5b3f

Browse files
committed
Make optimize_attribute conditional on libstd
1 parent 28ec93b commit 7cc5b3f

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

crates/as-if-std/src/lib.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@
22
// submodule into the standard library. We try to set this crate up similarly
33
// to the standard library itself to minimize the likelihood of issues when
44
// updating the `backtrace` crate.
5-
#![feature(optimize_attribute)]
5+
#![cfg_attr(
6+
// Only used by the gimli backend, see src/symbolize/mod.rs
7+
all(
8+
backtrace_in_libstd,
9+
feature = "backtrace",
10+
any(unix, all(windows, target_env = "gnu")),
11+
not(target_vendor = "uwp"),
12+
not(target_os = "emscripten"),
13+
),
14+
feature(optimize_attribute)
15+
)]
616
#![no_std]
717

818
extern crate alloc;

0 commit comments

Comments
 (0)