aboutsummaryrefslogtreecommitdiffstats
path: root/src/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
index f967685..52bcc82 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -143,3 +143,13 @@ impl fmt::Display for Error {
}
}
+impl Error {
+ pub fn new_nowhere(kind: ErrorKind, message: Option<String>) -> Self {
+ Self {
+ kind,
+ message,
+ file: PathBuf::from("!compiler!"),
+ line: 0,
+ }
+ }
+}