Files
rust/tests/ui/consts/recursive-const-stack-overflow.stderr
Esteban Küber 2c7186a725 Reduce verbosity of cycle errors when possible
When pointing at each step of cycle errors, do not include the code snippet when the note points at the same place as the previous one (by setting the note's span to DUMMY_SP).
2026-06-04 16:10:12 +00:00

26 lines
1.2 KiB
Plaintext

error[E0391]: cycle detected when checking if `FOO` is a trivial const
--> $DIR/recursive-const-stack-overflow.rs:3:1
|
LL | const FOO: usize = FOO;
| ^^^^^^^^^^^^^^^^
|
= note: ...which requires building MIR for `FOO`...
= note: ...which again requires checking if `FOO` is a trivial const, completing the cycle
= note: cycle used when simplifying constant for the type system `FOO`
= note: for more information, see <https://rustc-dev-guide.rust-lang.org/overview.html#queries> and <https://rustc-dev-guide.rust-lang.org/query.html>
error[E0391]: cycle detected when checking if `main::BAR` is a trivial const
--> $DIR/recursive-const-stack-overflow.rs:8:9
|
LL | const BAR: usize = BAR;
| ^^^^^^^^^^^^^^^^
|
= note: ...which requires building MIR for `main::BAR`...
= note: ...which again requires checking if `main::BAR` is a trivial const, completing the cycle
= note: cycle used when simplifying constant for the type system `main::BAR`
= note: for more information, see <https://rustc-dev-guide.rust-lang.org/overview.html#queries> and <https://rustc-dev-guide.rust-lang.org/query.html>
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0391`.