phase29an(p3): add freeze unstructured tag

This commit is contained in:
2025-12-29 18:15:54 +09:00
parent 19d54f1dd9
commit aa8c12bcf1

View File

@ -39,6 +39,14 @@ impl Freeze {
}
}
pub(in crate::mir::builder) fn unstructured(message: impl Into<String>) -> Self {
Self {
tag: "unstructured",
message: message.into(),
hint: None,
}
}
pub(in crate::mir::builder) fn bug(message: impl Into<String>) -> Self {
Self {
tag: "bug",
@ -64,3 +72,14 @@ impl fmt::Display for Freeze {
}
impl std::error::Error for Freeze {}
#[cfg(test)]
mod tests {
use super::Freeze;
#[test]
fn unstructured_tag_formats_as_expected() {
let text = Freeze::unstructured("x").to_string();
assert!(text.contains("[plan/freeze:unstructured] x"));
}
}