Skip to content

Commit 7c49a09

Browse files
committed
Add support for being a dep of libstd
This commit adds the requisite support for this crate to be compiled as a dependency of the standard library, adding various annotations and features as necessary to ensure that builds are sequenced correctly, namely we're built after libcore/compiler-builtins.
1 parent 70f57ed commit 7c49a09

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

Cargo.toml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ cfg-if = "0.1.6"
1919
rustc-demangle = "0.1.4"
2020
backtrace-sys = { path = "backtrace-sys", version = "0.1.17", optional = true }
2121
libc = { version = "0.2.45", default-features = false }
22+
core = { version = "1.0.0", optional = true, package = 'rustc-std-workspace-core' }
23+
compiler_builtins = { version = '0.1.2', optional = true }
2224

2325
# Optionally enable the ability to serialize a `Backtrace`
2426
serde = { version = "1.0", optional = true }
@@ -95,7 +97,15 @@ dladdr = []
9597
coresymbolication = []
9698
gimli-symbolize = ["addr2line", "findshlibs", "memmap" ]
9799

98-
# Internal feature to this crate, only used when testing this crate
100+
#=======================================
101+
# Methods of serialization
102+
#
103+
# Various features used for enabling rustc-serialize or syntex codegen.
104+
serialize-rustc = ["rustc-serialize"]
105+
serialize-serde = ["serde", "serde_derive"]
106+
107+
#=======================================
108+
# Internal features for testing and such.
99109
verify-winapi = [
100110
'winapi/dbghelp',
101111
'winapi/handleapi',
@@ -105,13 +115,14 @@ verify-winapi = [
105115
'winapi/winbase',
106116
'winapi/winnt',
107117
]
108-
109-
#=======================================
110-
# Methods of serialization
111-
#
112-
# Various features used for enabling rustc-serialize or syntex codegen.
113-
serialize-rustc = ["rustc-serialize"]
114-
serialize-serde = ["serde", "serde_derive"]
118+
rustc-dep-of-std = [
119+
'backtrace-sys/rustc-dep-of-std',
120+
'cfg-if/rustc-dep-of-std',
121+
'core',
122+
'compiler_builtins',
123+
'libc/rustc-dep-of-std',
124+
'rustc-demangle/rustc-dep-of-std',
125+
]
115126

116127
[[example]]
117128
name = "backtrace"

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
#![deny(missing_docs)]
6767
#![no_std]
6868
#![cfg_attr(target_env = "sgx", feature(sgx_platform))]
69+
#![allow(bare_trait_objects)] // TODO: remove when updating to 2018 edition
70+
#![allow(rust_2018_idioms)] // TODO: remove when updating to 2018 edition
6971

7072
#[cfg(feature = "std")]
7173
#[macro_use]

0 commit comments

Comments
 (0)