File tree 6 files changed +39
-15
lines changed
6 files changed +39
-15
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ pub struct Options {
53
53
pub codegen_options_strs : Vec < String > ,
54
54
/// Debugging (`-Z`) options to pass to the compiler.
55
55
pub debugging_options : DebuggingOptions ,
56
+ /// Debugging (`-Z`) options strings to pass to the compiler.
57
+ pub debugging_options_strs : Vec < String > ,
56
58
/// The target used to compile the crate against.
57
59
pub target : TargetTriple ,
58
60
/// Edition used when reading the crate. Defaults to "2015". Also used by default when
@@ -481,6 +483,7 @@ impl Options {
481
483
let generate_redirect_pages = matches. opt_present ( "generate-redirect-pages" ) ;
482
484
let test_builder = matches. opt_str ( "test-builder" ) . map ( PathBuf :: from) ;
483
485
let codegen_options_strs = matches. opt_strs ( "C" ) ;
486
+ let debugging_options_strs = matches. opt_strs ( "Z" ) ;
484
487
let lib_strs = matches. opt_strs ( "L" ) ;
485
488
let extern_strs = matches. opt_strs ( "extern" ) ;
486
489
let runtool = matches. opt_str ( "runtool" ) ;
@@ -502,6 +505,7 @@ impl Options {
502
505
codegen_options,
503
506
codegen_options_strs,
504
507
debugging_options,
508
+ debugging_options_strs,
505
509
target,
506
510
edition,
507
511
maybe_sysroot,
Original file line number Diff line number Diff line change @@ -279,6 +279,9 @@ fn run_test(
279
279
for codegen_options_str in & options. codegen_options_strs {
280
280
compiler. arg ( "-C" ) . arg ( & codegen_options_str) ;
281
281
}
282
+ for debugging_option_str in & options. debugging_options_strs {
283
+ compiler. arg ( "-Z" ) . arg ( & debugging_option_str) ;
284
+ }
282
285
if no_run {
283
286
compiler. arg ( "--emit=metadata" ) ;
284
287
}
Original file line number Diff line number Diff line change @@ -6,13 +6,13 @@ failures:
6
6
7
7
---- $DIR/failed-doctest-missing-codes.rs - Foo (line 8) stdout ----
8
8
error[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`
16
16
17
17
error: aborting due to previous error
18
18
Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ failures:
7
7
8
8
---- $DIR/failed-doctest-output.rs - OtherStruct (line 21) stdout ----
9
9
error[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
14
14
15
15
error: aborting due to previous error
16
16
Original file line number Diff line number Diff line change @@ -6,10 +6,10 @@ failures:
6
6
7
7
---- $DIR/unparseable-doc-test.rs - foo (line 6) stdout ----
8
8
error: 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
+ | ^^^^^^^^^^^^^
13
13
14
14
error: aborting due to previous error
15
15
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