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
@@ -478,6 +480,7 @@ impl Options {
478
480
let generate_redirect_pages = matches. opt_present ( "generate-redirect-pages" ) ;
479
481
let test_builder = matches. opt_str ( "test-builder" ) . map ( PathBuf :: from) ;
480
482
let codegen_options_strs = matches. opt_strs ( "C" ) ;
483
+ let debugging_options_strs = matches. opt_strs ( "Z" ) ;
481
484
let lib_strs = matches. opt_strs ( "L" ) ;
482
485
let extern_strs = matches. opt_strs ( "extern" ) ;
483
486
let runtool = matches. opt_str ( "runtool" ) ;
@@ -499,6 +502,7 @@ impl Options {
499
502
codegen_options,
500
503
codegen_options_strs,
501
504
debugging_options,
505
+ debugging_options_strs,
502
506
target,
503
507
edition,
504
508
maybe_sysroot,
Original file line number Diff line number Diff line change @@ -280,6 +280,9 @@ fn run_test(
280
280
for codegen_options_str in & options. codegen_options_strs {
281
281
compiler. arg ( "-C" ) . arg ( & codegen_options_str) ;
282
282
}
283
+ for debugging_option_str in & options. debugging_options_strs {
284
+ compiler. arg ( "-Z" ) . arg ( & debugging_option_str) ;
285
+ }
283
286
if no_run {
284
287
compiler. arg ( "--emit=metadata" ) ;
285
288
}
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