pub enum ScanError {
DuplicateName(Box<DuplicateNameError>),
NotExpressible {
entries: Vec<NotExpressibleEntry>,
},
AdapterInvariant {
message: String,
},
DeclaredNotFound {
entries: Vec<(&'static str, String)>,
},
QualifiedDeclaredTypes {
entries: Vec<(String, String)>,
},
}Expand description
Errors surfaced by the scan phase.
Variants§
DuplicateName(Box<DuplicateNameError>)
NotExpressible
Items the flat language cannot express, all of them at once.
The message for each comes from
ItemError, so one authority produces it.
This replaces the per-item guards the registry used to duplicate — a self
receiver, a non-ident parameter pattern, a disallowed impl Trait — which
the frontend now catches with a richer diagnosis (it names the parameter).
Fields
entries: Vec<NotExpressibleEntry>AdapterInvariant
An adapter-invariant check failed — see
Prebindgen::validate.
The message is adapter-authored and printed verbatim.
DeclaredNotFound
Explicitly declared items (functions, helper functions, constants)
that match no indexed #[prebindgen] item. A declaration is a
statement of intent — its target being absent is always a bug (a
typo in build.rs, or the item was renamed/removed in the source
crate), so this is a hard error, unlike the soft warnings for stale
ignore entries. All missing names are collected before failing.
QualifiedDeclaredTypes
Declared type keys that qualify a source item with its crate path
(ptr_class!(myflat::Foo) where myflat is a chained source crate).
Source items live in one flat namespace and are keyed by their bare
name — the qualified spelling can never match a captured signature,
so it is a hard error with a fix-it instead of a silent miss (issue
#95). All offenders are collected before failing.
Trait Implementations§
Source§impl Error for ScanError
impl Error for ScanError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<ParseError> for ScanError
impl From<ParseError> for ScanError
Source§fn from(e: ParseError) -> Self
fn from(e: ParseError) -> Self
Auto Trait Implementations§
impl !Send for ScanError
impl !Sync for ScanError
impl Freeze for ScanError
impl RefUnwindSafe for ScanError
impl Unpin for ScanError
impl UnsafeUnpin for ScanError
impl UnwindSafe for ScanError
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more