File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -46,13 +46,15 @@ const PROBE: &str = r#"
4646"# ;
4747
4848fn main ( ) {
49+ let mut error_generic_member_access = false ;
4950 if cfg ! ( feature = "std" ) {
5051 println ! ( "cargo:rerun-if-env-changed=RUSTC_BOOTSTRAP" ) ;
5152
5253 match compile_probe ( ) {
5354 Some ( status) if status. success ( ) => {
5455 println ! ( "cargo:rustc-cfg=std_backtrace" ) ;
5556 println ! ( "cargo:rustc-cfg=error_generic_member_access" ) ;
57+ error_generic_member_access = true ;
5658 }
5759 _ => { }
5860 }
@@ -78,6 +80,12 @@ fn main() {
7880 // https://github.com/rust-lang/rust/issues/71668
7981 println ! ( "cargo:rustc-cfg=anyhow_no_unsafe_op_in_unsafe_fn_lint" ) ;
8082 }
83+
84+ if !error_generic_member_access && cfg ! ( feature = "std" ) && rustc >= 65 {
85+ // std::backtrace::Backtrace
86+ // https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html#stabilized-apis
87+ println ! ( "cargo:rustc-cfg=std_backtrace" ) ;
88+ }
8189}
8290
8391fn compile_probe ( ) -> Option < ExitStatus > {
You can’t perform that action at this time.
0 commit comments