forked from Orchid/orchid
- InertAtomic replaced atomic_inert! for improved tooling support - atomic_defaults! is easier to type out than to explain in a docstring - Changed rustfmt config to better support tiny functions such as as_any
28 lines
806 B
Rust
28 lines
806 B
Rust
use super::ProjectError;
|
|
use crate::representations::location::Location;
|
|
use crate::{Interner, VName};
|
|
|
|
/// Error produced when an import path starts with more `super` segments
|
|
/// than the current module's absolute path
|
|
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
|
|
pub struct TooManySupers {
|
|
/// The offending import path
|
|
pub path: VName,
|
|
/// The faulty import statement
|
|
pub location: Location,
|
|
}
|
|
impl ProjectError for TooManySupers {
|
|
fn description(&self) -> &str {
|
|
"an import path starts with more `super` segments than the current \
|
|
module's absolute path"
|
|
}
|
|
fn message(&self) -> String {
|
|
format!(
|
|
"path {} contains too many `super` steps.",
|
|
Interner::extern_all(&self.path).join("::"),
|
|
)
|
|
}
|
|
|
|
fn one_position(&self) -> Location { self.location.clone() }
|
|
}
|