File tree Expand file tree Collapse file tree 6 files changed +39
-15
lines changed Expand file tree Collapse file tree 6 files changed +39
-15
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ pub struct Options {
5353 pub codegen_options_strs : Vec < String > ,
5454 /// Debugging (`-Z`) options to pass to the compiler.
5555 pub debugging_options : DebuggingOptions ,
56+ /// Debugging (`-Z`) options strings to pass to the compiler.
57+ pub debugging_options_strs : Vec < String > ,
5658 /// The target used to compile the crate against.
5759 pub target : TargetTriple ,
5860 /// Edition used when reading the crate. Defaults to "2015". Also used by default when
@@ -478,6 +480,7 @@ impl Options {
478480 let generate_redirect_pages = matches. opt_present ( "generate-redirect-pages" ) ;
479481 let test_builder = matches. opt_str ( "test-builder" ) . map ( PathBuf :: from) ;
480482 let codegen_options_strs = matches. opt_strs ( "C" ) ;
483+ let debugging_options_strs = matches. opt_strs ( "Z" ) ;
481484 let lib_strs = matches. opt_strs ( "L" ) ;
482485 let extern_strs = matches. opt_strs ( "extern" ) ;
483486 let runtool = matches. opt_str ( "runtool" ) ;
@@ -499,6 +502,7 @@ impl Options {
499502 codegen_options,
500503 codegen_options_strs,
501504 debugging_options,
505+ debugging_options_strs,
502506 target,
503507 edition,
504508 maybe_sysroot,
Original file line number Diff line number Diff line change @@ -280,6 +280,9 @@ fn run_test(
280280 for codegen_options_str in & options. codegen_options_strs {
281281 compiler. arg ( "-C" ) . arg ( & codegen_options_str) ;
282282 }
283+ for debugging_option_str in & options. debugging_options_strs {
284+ compiler. arg ( "-Z" ) . arg ( & debugging_option_str) ;
285+ }
283286 if no_run {
284287 compiler. arg ( "--emit=metadata" ) ;
285288 }
Original file line number Diff line number Diff line change @@ -6,13 +6,13 @@ failures:
66
77---- $DIR/failed-doctest-missing-codes.rs - Foo (line 8) stdout ----
88error[E0308]: mismatched types
9- --> $DIR/failed-doctest-missing-codes.rs:9:13
10- |
11- 3 | let x: () = 5i32;
12- | ^^^^ expected (), found i32
13- |
14- = note: expected type `()`
15- found type `i32`
9+ --> $DIR/failed-doctest-missing-codes.rs:9:13
10+ |
11+ LL | let x: () = 5i32;
12+ | ^^^^ expected (), found i32
13+ |
14+ = note: expected type `()`
15+ found type `i32`
1616
1717error: aborting due to previous error
1818
Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ failures:
77
88---- $DIR/failed-doctest-output.rs - OtherStruct (line 21) stdout ----
99error[E0425]: cannot find value `no` in this scope
10- --> $DIR/failed-doctest-output.rs:22:1
11- |
12- 3 | no
13- | ^^ not found in this scope
10+ --> $DIR/failed-doctest-output.rs:22:1
11+ |
12+ LL | no
13+ | ^^ not found in this scope
1414
1515error: aborting due to previous error
1616
Original file line number Diff line number Diff line change @@ -6,10 +6,10 @@ failures:
66
77---- $DIR/unparseable-doc-test.rs - foo (line 6) stdout ----
88error: unterminated double quote string
9- --> $DIR/unparseable-doc-test.rs:8:1
10- |
11- 2 | "unterminated
12- | ^^^^^^^^^^^^^
9+ --> $DIR/unparseable-doc-test.rs:8:1
10+ |
11+ LL | "unterminated
12+ | ^^^^^^^^^^^^^
1313
1414error: aborting due to previous error
1515
Original file line number Diff line number Diff line change 1+ // needs-sanitizer-support
2+ // compile-flags: --test -Z sanitizer=address
3+ //
4+ // #43031: Verify that rustdoc passes `-Z` options to rustc. Use an extern
5+ // function that is provided by the sanitizer runtime, if flag is not passed
6+ // correctly, then linking will fail.
7+
8+ /// ```
9+ /// extern {
10+ /// fn __sanitizer_print_stack_trace();
11+ /// }
12+ ///
13+ /// fn main() {
14+ /// unsafe { __sanitizer_print_stack_trace() };
15+ /// }
16+ /// ```
17+ pub fn z_flag_is_passed_to_rustc ( ) { }
You can’t perform that action at this time.
0 commit comments