| Age | Commit message (Collapse) | Author | Lines | |
|---|---|---|---|---|
| 2025-05-22 | Collect and use `#[doc(test(attr(..)))]` at every level | Urgau | -0/+262 | |
| 2025-05-22 | Allow `#![doc(test(attr(..)))]` doctests to be again merged together | Urgau | -3/+8 | |
| 2025-05-22 | Collect and use `#![doc(test(attr(..)))]` at module level too | Urgau | -0/+115 | |
| 2025-05-22 | Auto merge of #140527 - GuillaumeGomez:doctest-main-fn, r=notriddle | bors | -0/+73 | |
| Emit a warning if the doctest `main` function will not be run Fixes #140310. I think we could try to go much further like adding a "link" (ie UI annotations) on the `main` function in the doctest. However that will require some more computation, not sure if it's worth it or not. Can still be done in a follow-up if we want it. For now, this PR does two things: 1. Pass the `DiagCtxt` to the doctest parser to emit the warning. 2. Correctly generate the `Span` to where the doctest is starting (I hope the way I did it isn't too bad either...). cc `@fmease` r? `@notriddle` | ||||
| 2025-05-09 | Rollup merge of #139863 - fmease:simp-doctest-build-arg-passing, ↵ | Matthias Krüger | -6/+5 | |
| r=GuillaumeGomez rustdoc: Replace unstable flag `--doctest-compilation-args` with a simpler one: `--doctest-build-arg` Tracking issue: https://github.com/rust-lang/rust/issues/134172. Context: https://github.com/rust-lang/rust/pull/137096#issuecomment-2776318800 Yeets the ad hoc shell-like lexer for 'nested' program arguments. No FCP necessary since the flag is unstable. I've chosen to replace `compilation` with `build` because it's shorter (you now need to pass it multiple times in order to pass many arguments to the doctest compiler, so it matters a bit) and since I prefer it esthetically. **Issue**: Even though we don't process the argument passed to `--doctest-build-arg`, we end up passing it via an argument file (`rustc `@argfile`)` which delimits arguments by line break (LF or CRLF, [via](https://doc.rust-lang.org/rustc/command-line-arguments.html#path-load-command-line-flags-from-a-path)) meaning ultimately the arguments still get split which is unfortunate. Still, I think this change is an improvement over the status quo. I'll update the tracking issue if/once this PR merges. I'll also add the (CR)LF issue to 'unresolved question'. r? GuillaumeGomez r? notriddle | ||||
| 2025-05-02 | Add regression test for #140310 | Guillaume Gomez | -0/+43 | |
| 2025-05-02 | Emit a warning if the doctest `main` function will not be run | Guillaume Gomez | -0/+30 | |
| 2025-05-01 | rustdoc: Fix doctest heuristic for main fn wrapping | León Orell Valerian Liehr | -51/+154 | |
| 2025-04-28 | Rollup merge of #140220 - GuillaumeGomez:doctest-main-wrapping, r=fmease | Guillaume Gomez | -27/+55 | |
| Fix detection of main function if there are expressions around it Fixes #140162. Fixes #139651. Once this is merged, we can backport and I'll send a follow-up to emit a warning in case a `main` function is about to be "wrapped" (and therefore not run). r? `@fmease` try-job: x86_64-mingw-1 | ||||
| 2025-04-27 | Fix bad handling of macros if there is already a `main` function | Guillaume Gomez | -0/+23 | |
| 2025-04-25 | If there is a `;` alone, we consider that the doctest needs to be put inside ↵ | Guillaume Gomez | -27/+4 | |
| a function | ||||
| 2025-04-25 | Add rustdoc-ui regression test for #140289 | Guillaume Gomez | -0/+72 | |
| 2025-04-25 | Correctly display stdout and stderr in case a doctest is failing | Guillaume Gomez | -0/+4 | |
| 2025-04-23 | Add regression ui test for #140162 and for #139651 | Guillaume Gomez | -0/+28 | |
| 2025-04-15 | Replace flag `--doctest-compilation-args` with a simpler one: ↵ | León Orell Valerian Liehr | -6/+5 | |
| `--doctest-build-arg` More notably, the value of the new flag does *not* get lexed shell-like and ad hoc. | ||||
| 2025-04-14 | Report span of test when should_panic test failed | xizheyin | -1/+1 | |
| Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn> | ||||
| 2025-04-10 | replace `//@ compile-flags: --edition` with `//@ edition` | Pietro Albini | -4/+5 | |
| 2025-04-04 | Rollup merge of #139328 - GuillaumeGomez:fix-panic-output-137970, r=fmease | Matthias Krüger | -0/+34 | |
| Fix 2024 edition doctest panic output Fixes #137970. The problem was that the output was actually displayed by rustc itself because we're exiting with `Result<(), String>`, and the display is really not great. So instead, we get the output, we print it and then we return an `ExitCode`. r? ````@aDotInTheVoid```` | ||||
| 2025-04-03 | Use `eprint!` instead of `eprintln!` | Guillaume Gomez | -0/+34 | |
| 2025-04-03 | compiletest: Require `//~` annotations even if `error-pattern` is specified | Vadim Petrochenkov | -1/+2 | |
| 2025-03-28 | Rollup merge of #138104 - GuillaumeGomez:simplify-doctest-parsing, r=fmease | Matthias Krüger | -3/+32 | |
| Greatly simplify doctest parsing and information extraction The original process was pretty terrible, as it tried to extract information such as attributes by performing matches over tokens like `#!`, which doesn't work very well considering you can have `# ! [`, which is valid. Also, it now does it in one pass: if the parser is happy, then we try to extract information, otherwise we return early. r? `@fmease` | ||||
| 2025-03-27 | Correctly handle line comments in attributes and generate extern crates | Guillaume Gomez | -3/+32 | |
| outside of wrapping function | ||||
| 2025-03-25 | ignore doctests only in specified targets | Takayuki Maeda | -0/+20 | |
| add necessary lines fix ui test error | ||||
| 2025-03-14 | Do not suggest using `-Zmacro-backtrace` for builtin macros | Esteban Küber | -2/+0 | |
| For macros that are implemented on the compiler, we do *not* mention the `-Zmacro-backtrace` flag. This includes `derive`s and standard macros. | ||||
| 2025-03-10 | doctests: build test bundle and harness separately | Michael Howell | -1/+71 | |
| This prevents the included test case from getting at nightly-only features when run on stable. The harness builds with RUSTC_BOOTSTRAP, but the bundle doesn't. | ||||
| 2025-02-16 | Enable relative-path-include-bytes on Windows | Chris Denton | -3/+3 | |
| 2025-02-03 | Enable more tests on Windows | Ben Kimock | -1/+1 | |
| 2025-01-20 | Rollup merge of #135736 - fmease:rustdoc-fix-flaky-test, r=GuillaumeGomez | 许杰友 Jieyou Xu (Joe) | -1/+2 | |
| rustdoc: Fix flaky doctest test Fixes #135660. | ||||
| 2025-01-19 | rustdoc: Fix flaky doctest test | León Orell Valerian Liehr | -1/+2 | |
| 2025-01-01 | Try to write the panic message with a single `write_all` call | John Kåre Alsaker | -0/+2 | |
| 2024-12-31 | chore: fix some typos | peicuiping | -1/+1 | |
| Signed-off-by: peicuiping <ezc5@sina.cn> | ||||
| 2024-12-27 | Remove the `-test` suffix from normalize directives | Zalathar | -84/+84 | |
| 2024-12-20 | Add test to ensure passing `--doctest_compilation_args` multiple times work | Guillaume Gomez | -0/+23 | |
| 2024-12-20 | Add regression test for `--doctest-compilation-args` | Guillaume Gomez | -0/+18 | |
| 2024-12-16 | Remove unneeded handling of backlines in doctest attributes | Guillaume Gomez | -0/+46 | |
| 2024-12-16 | Also handle cases where attributes are unclosed | Guillaume Gomez | -2/+20 | |
| 2024-12-16 | Add ui regression test for #134221 | Guillaume Gomez | -0/+59 | |
| 2024-11-28 | Update more 2024 tests to remove -Zunstable-options | Eric Huss | -3/+3 | |
| 2024-11-22 | Stabilize the 2024 edition | Eric Huss | -41/+45 | |
| 2024-10-30 | Rollup merge of #132210 - notriddle:notriddle/doctest-span-hack, ↵ | Jubilee | -12/+86 | |
| r=GuillaumeGomez rustdoc: make doctest span tweak a 2024 edition change Fixes #132203 This is a compatibility hack, because I think the new behavior is better. When an A `include_str!` B, and B `include_str!` C, the path to C should be resolved relative to B, not A. That's how `include!` itself works, so that's how `include_str!` with should work. | ||||
| 2024-10-30 | Ignore Windows due to its differing path syntax | Michael Howell | -4/+5 | |
| 2024-10-30 | Rollup merge of #131096 - GuillaumeGomez:rm-no_unused, r=notriddle | 许杰友 Jieyou Xu (Joe) | -0/+88 | |
| rustdoc: Remove usage of `allow(unused)` attribute on `no_run` merged doctests Fixes [#130681](https://github.com/rust-lang/rust/issues/130681). It fixes the behaviour difference with the current doctests. r? ``@notriddle`` | ||||
| 2024-10-26 | rustdoc: make doctest span tweak a 2024 edition change | Michael Howell | -12/+85 | |
| Fixes #132203 This is a compatibility hack, because I think the new behavior is better. When an A `include_str!` B, and B `include_str!` C, the path to C should be resolved relative to B, not A. That's how `include!` itself works, so that's how `include_str!` with should work. | ||||
| 2024-10-24 | Add regression test for #131893 | Guillaume Gomez | -0/+31 | |
| 2024-10-11 | Remove deprecation note in the `non_local_definitions` warning | Urgau | -2/+0 | |
| 2024-10-01 | Add regression tests for #130681 | Guillaume Gomez | -0/+88 | |
| 2024-09-29 | Rename doctest attribute `standalone-crate` into `standalone_crate` for ↵ | Guillaume Gomez | -7/+7 | |
| coherency | ||||
| 2024-09-28 | Improve mistyped docblock attribute warning messages | Guillaume Gomez | -28/+28 | |
| 2024-09-28 | Add regression tests for mistyped `standalone-crate` attribute | Guillaume Gomez | -0/+64 | |
| 2024-09-23 | Update rustdoc doctest non_local_defs impl test | Urgau | -11/+13 | |
