allow non-monomorphize modules to access hard-coded error message through new struct, use fluent message in monomorphize

This commit is contained in:
Nathan Stocks
2022-08-24 16:28:56 -06:00
parent e9142473df
commit 30c7506655
8 changed files with 29 additions and 13 deletions

View File

@@ -0,0 +1,9 @@
use crate::LangItem;
pub struct LangItemError(pub LangItem);
impl ToString for LangItemError {
fn to_string(&self) -> String {
format!("requires `{}` lang_item", self.0.name())
}
}