Skip to content

Improve main detection logic in doc-tests #2889

@DelevoXDG

Description

@DelevoXDG

In doc tests, similarly to rustdoc, if the example does not contain fn main, the code block content is wrapped in fn main() { your_code }.

The logic that is used to detect whether the block is flawed though, and may produce false positives.

Continues #2473

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions