@@ -14,6 +14,9 @@ pub struct BuildInfo {
14
14
/// `CARGO_PKG_NAME`
15
15
pub crate_name : & ' static str ,
16
16
17
+ /// Space-separated names of all features enabled for this crate.
18
+ pub features : & ' static str ,
19
+
17
20
/// Crate version, parsed from `CARGO_PKG_VERSION`, ignoring any `+metadata` suffix.
18
21
pub version : super :: CrateVersion ,
19
22
@@ -74,6 +77,7 @@ impl std::fmt::Display for BuildInfo {
74
77
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
75
78
let Self {
76
79
crate_name,
80
+ features,
77
81
version,
78
82
rustc_version,
79
83
llvm_version,
@@ -89,6 +93,10 @@ impl std::fmt::Display for BuildInfo {
89
93
90
94
write ! ( f, "{crate_name} {version}" ) ?;
91
95
96
+ if !features. is_empty ( ) {
97
+ write ! ( f, " ({features})" ) ?;
98
+ }
99
+
92
100
if let Some ( rustc_version) = rustc_version {
93
101
write ! ( f, " [{rustc_version}" ) ?;
94
102
if let Some ( llvm_version) = llvm_version {
@@ -147,6 +155,7 @@ impl CrateVersion {
147
155
fn crate_version_from_build_info_string ( ) {
148
156
let build_info = BuildInfo {
149
157
crate_name : "re_build_info" ,
158
+ features : "default extra" ,
150
159
version : CrateVersion {
151
160
major : 0 ,
152
161
minor : 10 ,
0 commit comments