rust/compiler/rustc_monomorphize
kulst 630c7596e9 Ensure that static initializers are acyclic for NVPTX
NVPTX does not support cycles in static initializers. LLVM produces an error when attempting to codegen such constructs (like self referential structs).

To not produce LLVM UB we instead emit a post-monomorphization error on
Rust side before reaching codegen.

This is achieved by analysing a subgraph of the "mono item graph" that
only contains statics:
1. Calculate the strongly connected components (SCCs) of the graph
2. Check for cycles (more than one node in a SCC or exactly one node
   which references itself)
2026-01-06 17:00:21 +01:00
..
src Ensure that static initializers are acyclic for NVPTX 2026-01-06 17:00:21 +01:00
Cargo.toml Ensure that static initializers are acyclic for NVPTX 2026-01-06 17:00:21 +01:00
messages.ftl Ensure that static initializers are acyclic for NVPTX 2026-01-06 17:00:21 +01:00