Skip to content

Add internal documentation for all queries #104008

Open
@jyn514

Description

@jyn514

Currently, queries are inconsistently documented. Some have a doc-comment:

/// Return the span for a definition.
/// Contrary to `def_span` below, this query returns the full absolute span of the definition.
/// This span is meant for dep-tracking rather than diagnostics. It should not be used outside
/// of rustc_middle::hir::source_map.
query source_span(key: LocalDefId) -> Span {
desc { "getting the source span" }
}

while others only have the desc we mandate in the proc-macro:
query resolutions(_: ()) -> &'tcx ty::ResolverGlobalCtxt {
eval_always
no_hash
desc { "getting the resolver outputs" }
}

We should add documentation for all of these, then add #[warn(missing_docs)] so it doesn't regress in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustA-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-query-systemArea: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html)E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions