@@ -7,7 +7,6 @@ use crate::io;
7
7
use crate :: borrow:: Cow ;
8
8
use crate :: io:: prelude:: * ;
9
9
use crate :: path:: { self , Path , PathBuf } ;
10
- use crate :: sync:: atomic:: { self , Ordering } ;
11
10
use crate :: sys:: mutex:: Mutex ;
12
11
13
12
use backtrace:: { BacktraceFmt , BytesOrWideString , PrintFmt } ;
@@ -34,6 +33,7 @@ pub fn lock() -> impl Drop {
34
33
}
35
34
36
35
/// Prints the current backtrace.
36
+ #[ cfg( feature = "backtrace_support" ) ]
37
37
pub fn print ( w : & mut dyn Write , format : PrintFmt ) -> io:: Result < ( ) > {
38
38
// There are issues currently linking libbacktrace into tests, and in
39
39
// general during libstd's own unit tests we're not testing this path. In
@@ -129,7 +129,10 @@ where
129
129
130
130
// For now logging is turned off by default, and this function checks to see
131
131
// whether the magical environment variable is present to see if it's turned on.
132
+ #[ cfg( feature = "backtrace_support" ) ]
132
133
pub fn log_enabled ( ) -> Option < PrintFmt > {
134
+ use crate :: sync:: atomic:: { self , Ordering } ;
135
+
133
136
// Setting environment variables for Fuchsia components isn't a standard
134
137
// or easily supported workflow. For now, always display backtraces.
135
138
if cfg ! ( target_os = "fuchsia" ) {
0 commit comments