File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,18 @@ use std::fs;
3
3
use std:: path:: Path ;
4
4
use std:: process:: { Command , ExitStatus , Stdio } ;
5
5
6
- // This code exercises the surface area that we expect of the std Backtrace
7
- // type. If the current toolchain is able to compile it, we go ahead and use
8
- // backtrace in anyhow.
6
+ // This build script is copied from
7
+ // [anyhow](https://github.com/dtolnay/anyhow/blob/master/build.rs),
8
+ // and is a type of feature detection to determine if the current rust
9
+ // toolchain has backtraces available.
10
+ //
11
+ // It exercises the surface area that we expect of the std Backtrace
12
+ // type. If the current toolchain is able to compile it, we enable a
13
+ // backtrace compiler configuration flag in http-types. We then
14
+ // conditionally require the compiler feature in src/lib.rs with
15
+ // `#![cfg_attr(backtrace, feature(backtrace))]`
16
+ // and gate our backtrace code behind `#[cfg(backtrace)]`
17
+
9
18
const PROBE : & str = r#"
10
19
#![feature(backtrace)]
11
20
#![allow(dead_code)]
You can’t perform that action at this time.
0 commit comments