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