Skip to content

rustc docs are hard to navigate due to unusual entrypoints. #137756

Open
@lolbinarycat

Description

@lolbinarycat

This is a somewhat abstract issue that makes it harder to develop new "compiler plugins" like rustdoc and clippy if you are not already familiar with the compiler architecture.

Unlike most rust libraries, where objects are simply constructed, used, and dropped (following RAII), rustc's internal api very heavily relies on the "callback" pattern, which can cause issues for navigability.

The most obvious issue is simply unfamiliarity, but another issue that can arguably cause more friction is how this interacts with type-based search.

For most libraries, if you want to find the entrypoint of a types API, you can simply search for functions that return that type. However, if you try this in rustc, you are unlikely to find what you are looking for.

This can also be a problem in libraries that heavily use output parameters.

There are several ways this can be addressed, from simply documenting the main entrypoint of types, to complicated rustdoc search features where items can be given a semantic "signature alias" for type based search similar to how name aliases currently work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions