rust/compiler/rustc_monomorphize/messages.ftl
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

82 lines
3.1 KiB
Text

monomorphize_abi_error_disabled_vector_type =
this function {$is_call ->
[true] call
*[false] definition
} uses {$is_scalable ->
[true] scalable
*[false] SIMD
} vector type `{$ty}` which (with the chosen ABI) requires the `{$required_feature}` target feature, which is not enabled{$is_call ->
[true] {" "}in the caller
*[false] {""}
}
.label = function {$is_call ->
[true] called
*[false] defined
} here
.help = consider enabling it globally (`-C target-feature=+{$required_feature}`) or locally (`#[target_feature(enable="{$required_feature}")]`)
monomorphize_abi_error_unsupported_unsized_parameter =
this function {$is_call ->
[true] call
*[false] definition
} uses unsized type `{$ty}` which is not supported with the chosen ABI
.label = function {$is_call ->
[true] called
*[false] defined
} here
.help = only rustic ABIs support unsized parameters
monomorphize_abi_error_unsupported_vector_type =
this function {$is_call ->
[true] call
*[false] definition
} uses SIMD vector type `{$ty}` which is not currently supported with the chosen ABI
.label = function {$is_call ->
[true] called
*[false] defined
} here
monomorphize_abi_required_target_feature =
this function {$is_call ->
[true] call
*[false] definition
} uses ABI "{$abi}" which requires the `{$required_feature}` target feature, which is not enabled{$is_call ->
[true] {" "}in the caller
*[false] {""}
}
.label = function {$is_call ->
[true] called
*[false] defined
} here
.help = consider enabling it globally (`-C target-feature=+{$required_feature}`) or locally (`#[target_feature(enable="{$required_feature}")]`)
monomorphize_couldnt_dump_mono_stats =
unexpected error occurred while dumping monomorphization stats: {$error}
monomorphize_encountered_error_while_instantiating =
the above error was encountered while instantiating `{$kind} {$instance}`
monomorphize_encountered_error_while_instantiating_global_asm =
the above error was encountered while instantiating `global_asm`
monomorphize_large_assignments =
moving {$size} bytes
.label = value moved from here
.note = The current maximum size is {$limit}, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
monomorphize_no_optimized_mir =
missing optimized MIR for `{$instance}` in the crate `{$crate_name}`
.note = missing optimized MIR for this item (was the crate `{$crate_name}` compiled with `--emit=metadata`?)
monomorphize_recursion_limit =
reached the recursion limit while instantiating `{$instance}`
.note = `{$def_path_str}` defined here
monomorphize_start_not_found = using `fn main` requires the standard library
.help = use `#![no_main]` to bypass the Rust generated entrypoint and declare a platform specific entrypoint yourself, usually with `#[no_mangle]`
monomorphize_static_initializer_cyclic = static initializer forms a cycle involving `{$head}`
.label = part of this cycle
.note = cyclic static initializers are not supported for target `{$target}`
monomorphize_symbol_already_defined = symbol `{$symbol}` is already defined