allow non-monomorphize modules to access hard-coded error message through new struct, use fluent message in monomorphize
This commit is contained in:
9
compiler/rustc_hir/src/errors.rs
Normal file
9
compiler/rustc_hir/src/errors.rs
Normal 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())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user