Skip to content

link to the rustc-dev-guide on cycle errors #113184

Closed
@jyn514

Description

@jyn514

right now, new contributors to the compiler can be easily confused by the cycle error - queries are not common in other production compilers (that i know of) and i think it would make it a lot easier to understand if we linked to the docs: https://rustc-dev-guide.rust-lang.org/overview.html#queries / https://rustc-dev-guide.rust-lang.org/query.html

the error reporting has changed a bit since i last looked at it, but i think

#[derive(Diagnostic)]
#[diag(query_system_cycle, code = "E0391")]
pub struct Cycle {
#[primary_span]
pub span: Span,
pub stack_bottom: String,
#[subdiagnostic]
pub cycle_stack: Vec<CycleStack>,
#[subdiagnostic]
pub stack_count: StackCount,
#[subdiagnostic]
pub alias: Option<Alias>,
#[subdiagnostic]
pub cycle_usage: Option<CycleUsage>,
}
is the right place.

cc @jieyouxu

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustA-query-systemArea: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-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