about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/src/errors.rs
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-06-14 11:27:09 +0200
committerGitHub <noreply@github.com>2025-06-14 11:27:09 +0200
commit9bdf5d371f01dcfca2122acc6a9d2dfb8a23b089 (patch)
treee5f214ff5c3892150a6f7ada836c7132f261b28b /compiler/rustc_codegen_gcc/src/errors.rs
parentade745e214f95c88940a28944b6e381229aca535 (diff)
parentf1ceb07a7db3f8eb94da1369f1ea20da49213d8e (diff)
downloadrust-9bdf5d371f01dcfca2122acc6a9d2dfb8a23b089.tar.gz
rust-9bdf5d371f01dcfca2122acc6a9d2dfb8a23b089.zip
Rollup merge of #141399 - GuillaumeGomez:extracted-doctest, r=aDotInTheVoid
[rustdoc] Give more information into extracted doctest information

Follow-up of https://github.com/rust-lang/rust/pull/134531.

This update fragment the doctest code into its sub-parts to give more control to the end users on how they want to use it.

The new JSON looks like this:

```json
{
  "format_version":2,
  "doctests":[
    {
      "file":"$DIR/extract-doctests-result.rs",
      "line":8,
      "doctest_attributes":{
        "original":"",
        "should_panic":false,
        "no_run":false,
        "ignore":"None",
        "rust":true,
        "test_harness":false,
        "compile_fail":false,
        "standalone_crate":false,
        "error_codes":[],
        "edition":null,
        "added_css_classes":[],
        "unknown":[]
      },
      "original_code":"let x = 12;\nOk(())",
      "doctest_code":{
        "crate_level":"#![allow(unused)]\n",
        "code":"let x = 12;\nOk(())",
        "wrapper":{
          "before":"fn main() { fn _inner() -> core::result::Result<(), impl core::fmt::Debug> {\n",
          "after":"\n} _inner().unwrap() }",
          "returns_result":true
        }
      },
      "name":"$DIR/extract-doctests-result.rs - (line 8)"
    }
  ]
}
```

for this doctest:

```rust
let x = 12;
Ok(())
```

With this, I think it matches what you need ``@ojeda?`` If so, once merged I'll update the patch I sent to RfL.

r? ``@aDotInTheVoid``
Diffstat (limited to 'compiler/rustc_codegen_gcc/src/errors.rs')
0 files changed, 0 insertions, 0 deletions