phase29an(p3): add freeze unstructured tag
This commit is contained in:
@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user