forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#65314 - tmiasko:rustdoc-z, r=ollie27
rustdoc: forward -Z options to rustc Currently rustdoc does not forward `-Z` options to rustc when building test executables. This makes impossible to use rustdoc to run test samples when crate under test is instrumented with one of sanitizers `-Zsanitizer=...`, since the final linking step will not include sanitizer runtime library. Forward `-Z` options to rustc to solve the issue. Helps with rust-lang#43031.
- Loading branch information
Showing
6 changed files
with
39 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// needs-sanitizer-support | ||
// compile-flags: --test -Z sanitizer=address | ||
// | ||
// #43031: Verify that rustdoc passes `-Z` options to rustc. Use an extern | ||
// function that is provided by the sanitizer runtime, if flag is not passed | ||
// correctly, then linking will fail. | ||
|
||
/// ``` | ||
/// extern { | ||
/// fn __sanitizer_print_stack_trace(); | ||
/// } | ||
/// | ||
/// fn main() { | ||
/// unsafe { __sanitizer_print_stack_trace() }; | ||
/// } | ||
/// ``` | ||
pub fn z_flag_is_passed_to_rustc() {} |