-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Query system cycle errors should be extendable with notes #53453
Copy link
Copy link
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-query-systemArea: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html)Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-query-systemArea: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html)Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Relevant PR: #53316
Relevant Issue: #52985
The query system automatically detects and emits a cycle error if a cycle occurs when dependency nodes are added to the query DAG. This error is extensible with a custom main message defined as below to help human readability,
rust/src/librustc/ty/query/config.rs
Line 93 in a385095
but is otherwise closed for modification outside of the query::plumbing module:
rust/src/librustc/ty/query/plumbing.rs
Line 248 in b239743
It would be nice to have a mechanism in addition that allows custom notes and suggestions to be added to these errors to help illustrate why a cycle occurred, not just where. It may be possible to expose the
DiagnosticBuilderor provide wrappers for methods likespan_suggestion()andspan_note()