Cycle errors lead to confusing errors referencing rustc-dev-guide (i.e., not user-facing docs) #130032
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-bug
Category: This is a bug.
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen: Maybe "just work", but maybe give a helpful error
Instead, this happened:
Meta
Reproduces on 1.81.0 stable and 2024-09-05 nightly.
Bigger picture
I'm working on "Schema"s (which are kind of home-rolled reflection) for postcard, and I attempted to implement the
Schema
trait for the types used for schemas themselves.Actual commit here: jamesmunns/postcard@ded8c30
I'm at least partially convinced this can't actually work in my case (it ends up making infinitely recursive consts), but the error message was somewhat surprising (I don't know if "normal" user errors should reference the rustc-dev-guide), and maybe would expect a more direct error like "Tried to make a constant value with infinite size due to recursion".
CC @Dirbaio who helped minimize this.
The text was updated successfully, but these errors were encountered: