Hitting the recursion limit when evaluating a type does not provide a useful error message #101747
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Inspired by this incredible Twitter thread
Given the following code: Playground
The current output is:
This error message doesn't really communicate the problem to anyone who isn't aware of rustc internals. It also does not communicate the (fairly simple) fix of upping the recursion limit
#![recursion_limit = "256"]
.It would be nice to provide an actual diagnostic pointing out the location of the error in the source code (reconstructing that might be complicated, I'm not sure). The current error can be particularly confusing since the type in the error message can be private to another type that's being evaluated, as is the case in this example where an inner type in
Box
is printed in the error.Rust analyzer does not show any similar warnings or errors.
Nightly prints a slightly different error message, but if anything it's even less helpful
The text was updated successfully, but these errors were encountered: