Skip to content

Certain items are ignored when computing documentation coverage #145087

@newinnovations

Description

@newinnovations

Code

I discussed this on rust-lang/docs.rs#2884 . @GuillaumeGomez suggested it might be bug, so I am reporting it here.

It seems that certain items are ignored when computing documentation coverage.

The file src/c_api/pdfium.rs contains more than 400 functions with documentation, but these functions are not counted.

The reason might be either that the impl is in a different file than the struct definition (done here to keep stuff manageable) or because they don't follow the rust naming conventions as they map directly to C functions.

In either case I would expect them to be counted. Now we are ignoring a major part of the crate.

Reproduction Steps

git clone https://github.com/newinnovations/PDFium-rs.git
cd PDFium-rs/
git checkout 92baa03
cargo rustdoc -- --show-coverage -Z unstable-options

Expected Outcome

That src/c_api/pdfium.rs was counted and part of the report.

Actual Output

 Documenting pdfium v0.9.3 (/tmp/PDFium-rs)
+-------------------------------------+------------+------------+------------+------------+
| File                                | Documented | Percentage |   Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| src/action.rs                       |          1 |     100.0% |          0 |       0.0% |
| src/annotation.rs                   |          1 |     100.0% |          0 |       0.0% |
| src/attachment.rs                   |          1 |     100.0% |          0 |       0.0% |
| src/availability.rs                 |          1 |     100.0% |          0 |       0.0% |
| src/bitmap/mod.rs                   |          8 |     100.0% |          0 |       0.0% |
| src/bookmark.rs                     |          1 |     100.0% |          0 |       0.0% |
| src/c_api/guard.rs                  |          4 |     100.0% |          0 |       0.0% |
| src/c_api/pdfium_bindings.rs        |          1 |     100.0% |          0 |       0.0% |
| src/c_api/pdfium_constants.rs       |        199 |     100.0% |          0 |       0.0% |
| src/c_api/pdfium_handle.rs          |          1 |     100.0% |          0 |       0.0% |
| src/c_api/pdfium_types.rs           |        312 |     100.0% |          0 |       0.0% |
| src/clip_path.rs                    |          1 |     100.0% |          0 |       0.0% |
| src/color.rs                        |          1 |     100.0% |          0 |       0.0% |
| src/destination.rs                  |          1 |     100.0% |          0 |       0.0% |
| src/document/mod.rs                 |          1 |     100.0% |          0 |       0.0% |
| src/document/reader.rs              |          1 |     100.0% |          0 |       0.0% |
| src/error.rs                        |         18 |     100.0% |          0 |       0.0% |
| src/font.rs                         |          1 |     100.0% |          0 |       0.0% |
| src/form.rs                         |          1 |     100.0% |          0 |       0.0% |
| src/glyph_path.rs                   |          1 |     100.0% |          0 |       0.0% |
| src/javascript_action.rs            |          1 |     100.0% |          0 |       0.0% |
| src/lib.rs                          |          1 |     100.0% |          1 |     100.0% |
| src/link.rs                         |          1 |     100.0% |          0 |       0.0% |
| src/matrix.rs                       |          1 |     100.0% |          0 |       0.0% |
| src/page/boundaries.rs              |          1 |     100.0% |          0 |       0.0% |
| src/page/link.rs                    |          1 |     100.0% |          0 |       0.0% |
| src/page/mod.rs                     |          1 |     100.0% |          0 |       0.0% |
| src/page/object/mark.rs             |          1 |     100.0% |          0 |       0.0% |
| src/page/object/mod.rs              |          1 |     100.0% |          0 |       0.0% |
| src/page/range.rs                   |          1 |     100.0% |          0 |       0.0% |
| src/page/render.rs                  |          2 |     100.0% |          1 |     100.0% |
| src/page/text/mod.rs                |          1 |     100.0% |          0 |       0.0% |
| src/page/text/search.rs             |          2 |     100.0% |          1 |     100.0% |
| src/path_segment.rs                 |          1 |     100.0% |          0 |       0.0% |
| src/rect.rs                         |          5 |     100.0% |          0 |       0.0% |
| src/signature.rs                    |          1 |     100.0% |          0 |       0.0% |
| src/struct_element.rs               |          1 |     100.0% |          0 |       0.0% |
| src/struct_element_attr.rs          |          1 |     100.0% |          0 |       0.0% |
| src/struct_element_attr_value.rs    |          1 |     100.0% |          0 |       0.0% |
| src/struct_tree.rs                  |          1 |     100.0% |          0 |       0.0% |
| src/xobject.rs                      |          1 |     100.0% |          0 |       0.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total                               |        583 |     100.0% |          3 |     100.0% |
+-------------------------------------+------------+------------+------------+------------+
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.19s

Version

rustdoc 1.91.0-nightly (7d82b83ed 2025-08-06)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions