diff options
author | Nathan Stocks <cleancut@github.com> | 2022-08-24 16:28:56 -0600 |
---|---|---|
committer | Nathan Stocks <cleancut@github.com> | 2022-08-25 11:06:45 -0600 |
commit | 30c750665517756484b0154b1b33a1256e614e6b (patch) | |
tree | e1c49c1441edf6a763a92b48a881b8d34ac8c512 /compiler/rustc_hir/src/errors.rs | |
parent | e9142473dfca7e274d24695e86f9100b020acab5 (diff) | |
download | rust-30c750665517756484b0154b1b33a1256e614e6b.tar.gz |
allow non-monomorphize modules to access hard-coded error message through new struct, use fluent message in monomorphize
Diffstat (limited to 'compiler/rustc_hir/src/errors.rs')
-rw-r--r-- | compiler/rustc_hir/src/errors.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_hir/src/errors.rs b/compiler/rustc_hir/src/errors.rs new file mode 100644 index 00000000000..7ed09d3f293 --- /dev/null +++ b/compiler/rustc_hir/src/errors.rs @@ -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()) + } +} |