mirror of
https://github.com/rust-lang/rust.git
synced 2026-07-08 00:38:40 -04:00
ce811cd701
Avoid infinite recursion when trying to build valtrees for self-referential consts This PR adds cycle detection to `const_to_valtree_inner` by using a tricolor DFS, so self-referential statics in pats don't cause valtree construction to recurse infinitely. Instead, we now return a new `ValTreeCreationError::CyclicConst`, similar to the current `InvalidConst` and `NodesOverflow` variants. fixes rust-lang/rust#144719