bug fixes and performance improvements
This commit is contained in:
36
src/pipeline/error/not_exported.rs
Normal file
36
src/pipeline/error/not_exported.rs
Normal file
@@ -0,0 +1,36 @@
|
||||
use std::rc::Rc;
|
||||
|
||||
use crate::{utils::BoxedIter, representations::location::Location};
|
||||
|
||||
use super::{ProjectError, ErrorPosition};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct NotExported {
|
||||
pub file: Vec<String>,
|
||||
pub subpath: Vec<String>,
|
||||
pub referrer_file: Vec<String>,
|
||||
pub referrer_subpath: Vec<String>,
|
||||
}
|
||||
impl ProjectError for NotExported {
|
||||
fn description(&self) -> &str {
|
||||
"An import refers to a symbol that exists but isn't exported"
|
||||
}
|
||||
fn positions(&self) -> BoxedIter<ErrorPosition> {
|
||||
Box::new([
|
||||
ErrorPosition{
|
||||
location: Location::File(Rc::new(self.file.clone())),
|
||||
message: Some(format!(
|
||||
"{} isn't exported",
|
||||
self.subpath.join("::")
|
||||
)),
|
||||
},
|
||||
ErrorPosition{
|
||||
location: Location::File(Rc::new(self.referrer_file.clone())),
|
||||
message: Some(format!(
|
||||
"{} cannot see this symbol",
|
||||
self.referrer_subpath.join("::")
|
||||
)),
|
||||
}
|
||||
].into_iter())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user