fuel_dispatch/fkc/warn.rs
1// SPDX-License-Identifier: MIT OR Apache-2.0
2//! Soft, non-fatal FKC import diagnostics.
3//!
4//! FKC's importer surfaces *failures* as typed [`crate::fkc::FkcError`] values.
5//! This module carries the complementary *warnings* — soft-degradation notices
6//! (§3.5 "importer warns, does not reject", a precision claim downgraded for
7//! lack of a verification-ledger entry, a shape_constraint that resolved to
8//! seed shapes) that must NOT fail the import but MUST be visible to a caller.
9//! Collected on [`crate::fkc::register::ImportedProvider::warnings`].
10
11/// A single non-fatal FKC import diagnostic.
12#[derive(Debug, Clone, PartialEq)]
13pub struct ImportWarning {
14 /// The kernel section (`## name`) the warning is about.
15 pub section: String,
16 /// Human-readable description of the soft-degradation that occurred.
17 pub message: String,
18}
19
20#[cfg(test)]
21mod tests {
22 use super::*;
23
24 #[test]
25 fn import_warning_constructs_and_carries_section_and_message() {
26 let w = ImportWarning {
27 section: "add_f32".into(),
28 message: "downgraded bit_stable".into(),
29 };
30 assert_eq!(w.section, "add_f32");
31 assert!(w.message.contains("downgraded"));
32 assert_eq!(w.clone(), w); // Clone + PartialEq derive present
33 }
34}