INNER CODE UNIT · Rust
validate_name
NVlabs/cuda-oxide · cuda-oxide/crates/cuda-artifact-finalizer/src/lib.rs:389
fn validate_name(name: &str) -> Result<(), FinalizerError> {
if name.as_bytes().contains(&0) {
Err(FinalizerError::InvalidInputName {
name: name.to_string(),
})
} else {
Ok(())
}
}
#[cfg(test)]
mod live_tests {
use super::*;
/// `@llvm.used` keeps the kernel alive through LTO, exactly as cuda-oxide's
/// NVVM exporter emits it for real kernels. Without it nvJitLink's link-time
/// optimizer dead-strips the annotation-marked kernel as unreachable and
/// links an empty module: the pipeline still succeeds, so every assertion