@@ -23,19 +23,22 @@ cfg-if = "0.1.10"
23
23
rustc-demangle = " 0.1.4"
24
24
backtrace-sys = { path = " crates/backtrace-sys" , version = " 0.1.35" , optional = true , default_features = false }
25
25
libc = { version = " 0.2.45" , default-features = false }
26
- core = { version = " 1.0.0" , optional = true , package = ' rustc-std-workspace-core' }
27
- compiler_builtins = { version = ' 0.1.2' , optional = true }
28
26
29
- # Optionally enable the ability to serialize a `Backtrace`
27
+ # Optionally enable the ability to serialize a `Backtrace`, controlled through
28
+ # the `serialize-*` features below.
30
29
serde = { version = " 1.0" , optional = true , features = [' derive' ] }
31
30
rustc-serialize = { version = " 0.3" , optional = true }
32
31
33
32
# Optionally demangle C++ frames' symbols in backtraces.
34
33
cpp_demangle = { default-features = false , version = " 0.2.3" , optional = true }
35
34
36
- # Optional dependencies enabled through the `gimli-symbolize` feature
37
- addr2line = { version = " 0.12.0" , optional = true , default-features = false }
35
+ # Internal dependencies when built as a dependency of libstd, do not use.
36
+ core = { version = " 1.0.0" , optional = true , package = ' rustc-std-workspace-core' }
37
+ compiler_builtins = { version = ' 0.1.2' , optional = true }
38
38
39
+ # Optional dependencies enabled through the `gimli-symbolize` feature, do not
40
+ # use these features directly.
41
+ addr2line = { version = " 0.12.0" , optional = true , default-features = false }
39
42
[dependencies .object ]
40
43
version = " 0.19"
41
44
optional = true
@@ -45,34 +48,24 @@ features = ['read_core', 'elf', 'macho', 'pe']
45
48
[target .'cfg(windows)' .dependencies ]
46
49
winapi = { version = " 0.3.3" , optional = true }
47
50
48
- # Each feature controls the two phases of finding a backtrace: getting a
49
- # backtrace and then resolving instruction pointers to symbols. The default
50
- # feature enables all the necessary features for each platform this library
51
- # supports, but it can be disabled to have finer grained control over the
52
- # dependencies.
53
- #
54
- # Note that not all features are available on all platforms, so even though a
55
- # feature is enabled some other feature may be used instead.
56
51
[features ]
52
+ # By default libstd support and libbacktrace is used to symbolize addresses.
57
53
default = [" std" , " libbacktrace" ]
58
54
59
- # Include std support.
55
+ # Include std support. This enables types like `Backtrace`.
60
56
std = []
61
57
62
58
# =======================================
63
59
# Methods of resolving symbols
64
60
#
65
61
# - libbacktrace: this feature activates the `backtrace-sys` dependency,
66
- # building the libbacktrace library found in gcc repos. This library
67
- # parses the DWARF info of ELF executables to find symbol names, and it
68
- # can also provide filename/line number information if debuginfo is
69
- # compiled in. This library currently only primarily works on unixes that
70
- # are not OSX, however.
62
+ # building the libbacktrace library found in gcc repos. This is the historical
63
+ # default for the `backtrace` crate.
71
64
# - gimli-symbolize: use the `gimli-rs/addr2line` crate to symbolicate
72
- # addresses into file, line, and name using DWARF debug information. At
73
- # the moment, this is only possible when targetting Linux, since macOS
74
- # splits DWARF out into a separate object file. Enabling this feature
75
- # means one less C dependency .
65
+ # addresses into file, line, and name using DWARF debug information.
66
+ #
67
+ # Note that MSVC unconditionally uses the dbghelp library to symbolize and won't
68
+ # be affected by feature selection here .
76
69
libbacktrace = [" backtrace-sys/backtrace-sys" ]
77
70
gimli-symbolize = [" addr2line" , " object" , " std" ]
78
71
@@ -84,18 +77,16 @@ serialize-rustc = ["rustc-serialize"]
84
77
serialize-serde = [" serde" ]
85
78
86
79
# =======================================
87
- # Deprecated features
80
+ # Deprecated/internal features
88
81
#
89
- # Only here for backwards compatibility purposes, they do nothing now.
82
+ # Only here for backwards compatibility purposes or for internal testing
83
+ # purposes. New code should use none of these features.
90
84
coresymbolication = []
91
85
dladdr = []
92
86
kernel32 = []
93
87
unix-backtrace = []
94
88
libunwind = []
95
89
dbghelp = []
96
-
97
- # =======================================
98
- # Internal features for testing and such.
99
90
verify-winapi = [
100
91
' winapi/dbghelp' ,
101
92
' winapi/handleapi' ,
0 commit comments