pub enum ModuleError {
Parse {
module: String,
source: String,
error: SyntaxError,
},
NotFound {
module: String,
from: String,
path: String,
source_name: String,
span: SourceSpan,
},
ImportCycle {
cycle: String,
source_name: String,
span: SourceSpan,
},
DuplicateImport {
module: String,
import: String,
source_name: String,
first_span: SourceSpan,
duplicate_span: SourceSpan,
},
BrowserStaticImportUnsupported {
allowed: String,
found: String,
source_name: String,
span: SourceSpan,
},
Io {
path: String,
error: Error,
},
}Expand description
Module resolution error produced while loading imports.
Variants§
Parse
Imported module failed to parse.
Fields
§
error: SyntaxErrorUnderlying syntax error from parsing.
NotFound
Imported module path could not be resolved.
Fields
§
span: SourceSpanSpan of the import clause.
ImportCycle
Cyclic import chain was detected.
Fields
§
span: SourceSpanSpan of the triggering import.
DuplicateImport
The same import name was declared twice in one module.
Fields
§
first_span: SourceSpanSpan of the first import declaration.
§
duplicate_span: SourceSpanSpan of the second import declaration.
BrowserStaticImportUnsupported
Browser import violated static-import restrictions.
Fields
§
span: SourceSpanSpan of the unsupported import.
Io
Reading a module file from disk failed.
Implementations§
Source§impl ModuleError
impl ModuleError
Sourcepub fn diagnostic_line_column(&self) -> Option<(usize, usize)>
pub fn diagnostic_line_column(&self) -> Option<(usize, usize)>
Return the primary diagnostic line/column when one is available.
Trait Implementations§
Source§impl Debug for ModuleError
impl Debug for ModuleError
Source§impl Display for ModuleError
impl Display for ModuleError
Source§impl Error for ModuleError
impl Error for ModuleError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl<DE> From<ModuleError> for CompileError<DE>where
DE: Error + 'static,
impl<DE> From<ModuleError> for CompileError<DE>where
DE: Error + 'static,
Source§fn from(source: ModuleError) -> Self
fn from(source: ModuleError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ModuleError
impl !RefUnwindSafe for ModuleError
impl Send for ModuleError
impl Sync for ModuleError
impl Unpin for ModuleError
impl !UnwindSafe for ModuleError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more