Skip to content

Commit b6337bb

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

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
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+
any(unix, all(windows, target_env = "gnu")),
9+
not(target_vendor = "uwp"),
10+
not(target_os = "emscripten"),
11+
any(not(backtrace_in_libstd), feature = "backtrace"),
12+
),
13+
feature(optimize_attribute)
14+
)]
615
#![no_std]
716

817
extern crate alloc;

0 commit comments

Comments
 (0)