mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-01 01:26:32 +00:00
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