use super::{
    RuleConfigurability, RuleDefaultSeverity, RuleDefinition, RuleLanguage, RuleStatus, bindings,
};

pub(crate) const RULE_DEFINITIONS: &[RuleDefinition] = &[
    RuleDefinition {
        id: "rust_aos_hot_path",
        language: RuleLanguage::Rust,
        family: "performance",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Repeated struct-field dereferences inside a loop that may indicate an array-of-structs hot path.",
        binding_location: bindings::RUST_PERFORMANCE,
    },
    RuleDefinition {
        id: "rust_blocking_drop",
        language: RuleLanguage::Rust,
        family: "performance",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "A Drop implementation performs blocking work.",
        binding_location: bindings::RUST_PERFORMANCE,
    },
    RuleDefinition {
        id: "rust_blocking_io_in_async",
        language: RuleLanguage::Rust,
        family: "performance",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Experimental,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
            RuleConfigurability::RustAsyncExperimental,
        ],
        description: "Blocking I/O or blocking work observed in async Rust code.",
        binding_location: bindings::RUST_PERFORMANCE,
    },
    RuleDefinition {
        id: "rust_hashmap_default_hasher",
        language: RuleLanguage::Rust,
        family: "performance",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "HashMap default-hasher construction in a likely hot path.",
        binding_location: bindings::RUST_PERFORMANCE,
    },
    RuleDefinition {
        id: "rust_large_future_stack",
        language: RuleLanguage::Rust,
        family: "performance",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Large allocations may be captured across await points and bloat future size.",
        binding_location: bindings::RUST_PERFORMANCE,
    },
    RuleDefinition {
        id: "rust_lines_allocate_per_line",
        language: RuleLanguage::Rust,
        family: "performance",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: ".lines() iteration used in a loop where per-item allocation may matter.",
        binding_location: bindings::RUST_PERFORMANCE,
    },
    RuleDefinition {
        id: "rust_lock_across_await",
        language: RuleLanguage::Rust,
        family: "performance",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Experimental,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
            RuleConfigurability::RustAsyncExperimental,
        ],
        description: "A lock appears to be held across an .await boundary.",
        binding_location: bindings::RUST_PERFORMANCE,
    },
    RuleDefinition {
        id: "rust_path_join_absolute",
        language: RuleLanguage::Rust,
        family: "performance",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Path::join used with an absolute segment that discards the existing base path.",
        binding_location: bindings::RUST_PERFORMANCE,
    },
    RuleDefinition {
        id: "rust_pointer_chasing_vec_box",
        language: RuleLanguage::Rust,
        family: "performance",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Pointer-heavy boxed vector-style storage that may hurt cache locality.",
        binding_location: bindings::RUST_PERFORMANCE,
    },
    RuleDefinition {
        id: "rust_tokio_mutex_unnecessary",
        language: RuleLanguage::Rust,
        family: "performance",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Experimental,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
            RuleConfigurability::RustAsyncExperimental,
        ],
        description: "tokio::sync::Mutex used in a fully synchronous critical path with no await.",
        binding_location: bindings::RUST_PERFORMANCE,
    },
    RuleDefinition {
        id: "rust_unbuffered_file_writes",
        language: RuleLanguage::Rust,
        family: "performance",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "File-like writes performed inside a loop without buffering or batching.",
        binding_location: bindings::RUST_PERFORMANCE,
    },
    RuleDefinition {
        id: "rust_utf8_validate_hot_path",
        language: RuleLanguage::Rust,
        family: "performance",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "UTF-8 validation appears in a likely hot path and may deserve profiling.",
        binding_location: bindings::RUST_PERFORMANCE,
    },
];
