rust/src/test
Michael Howell 214ad2f5b5 rustdoc doctest: detect fn main after an unexpected semicolon
The basic problem with this is that rustdoc, when hunting for `fn main`, will stop
parsing after it reaches a fatal error. This unexpected semicolon was a fatal error,
so in `src/test/rustdoc-ui/failed-doctest-extra-semicolon-on-item.rs`, it would wrap
the doctest in an implied main function, turning it into this:

    fn main() {
        struct S {};
        fn main() {
            assert_eq!(0, 1);
        }
    }

This, as it turns out, is totally valid, and it executes no assertions, so *it passes,*
even though the user wanted it to execute the assertion.

The Rust parser already has the ability to recover from these unexpected semicolons,
but to do so, it needs to use the `parse_mod` function, so this commit changes it to do that.
2021-11-18 16:23:18 -07:00
..
assembly Add features gates for experimental asm features 2021-11-07 01:23:53 +00:00
auxiliary
codegen Don't run the codegen test when debug_assert is enabled 2021-11-14 16:24:31 -08:00
codegen-units Collect panic/panic_bounds_check during monomorphization 2021-10-30 18:21:44 +01:00
debuginfo Fix function-names test for GDB 10.1 2021-10-11 17:20:45 +02:00
incremental Rollup merge of #89895 - camsteffen:for-loop-head-span, r=davidtwco 2021-10-22 19:42:45 +09:00
mir-opt Run reveal_all on MIR more often. 2021-11-06 15:56:29 +01:00
pretty Don't destructure args tuple in format_args! 2021-11-06 14:28:08 -05:00
run-make Auto merge of #83846 - torhovland:issue-10971, r=davidtwco 2021-11-11 02:52:32 +00:00
run-make-fulldeps Auto merge of #88368 - jyn514:metadata-error, r=petrochenkov 2021-11-07 23:03:55 +00:00
run-pass-valgrind
rustdoc Add test for removed one character last line in rustdoc 2021-11-06 20:21:29 +01:00
rustdoc-gui Fix missing bottom border for headings in sidebar 2021-11-04 20:07:24 +01:00
rustdoc-js Fix invalid handling of generics 2021-10-29 20:54:15 +02:00
rustdoc-js-std Fix linkcheck issues 2021-09-12 02:30:24 +00:00
rustdoc-json Add regression test for #89852 2021-10-14 02:12:18 +02:00
rustdoc-ui rustdoc doctest: detect fn main after an unexpected semicolon 2021-11-18 16:23:18 -07:00
ui Auto merge of #90382 - alexcrichton:wasm64-libstd, r=joshtriplett 2021-11-18 17:19:27 +00:00
ui-fulldeps Don't abort compilation after giving a lint error 2021-11-08 01:22:28 +00:00
COMPILER_TESTS.md