pub enum CaptureError {
Unbounded {
bound: CaptureBound,
},
Unread {
cause: LiteralReadCause,
path: TokenPath,
at: SpanHandle,
},
}Expand description
How reading one declared input into a captured surface refuses.
Two rows, because the two are facts about different things — and the difference is where each is reported.
Variants§
Unbounded
The read ran past one of the declared magnitudes.
Fields
bound: CaptureBoundWhich magnitude.
Unread
One literal’s spelling could not be read into the value it names, with declaration identity and producer placement retained separately.
Fields
cause: LiteralReadCauseWhy it could not be read.
at: SpanHandleThe producer-local handle already bound to the token’s compiler span.
Implementations§
Source§impl CaptureError
impl CaptureError
Sourcepub fn canonical_bytes(&self) -> Vec<u8> ⓘ
pub fn canonical_bytes(&self) -> Vec<u8> ⓘ
This refusal’s complete canonical material: which row it is, the stable name of what stopped the read, and — for a refusal about one token — that token’s declaration-local path.
The row’s position leads, so two rows whose names happened to coincide still derive two related identities. The producer-local span handle is excluded: captures of one declaration may issue different handles when they share a span table, while their declaration-local paths remain one fact.
Source§impl CaptureError
impl CaptureError
Sourcepub fn placed(self, spans: &Spans) -> TokenStream
pub fn placed(self, spans: &Spans) -> TokenStream
The compile_error! this refusal expands to, at the position it is a fact about.
A magnitude is a fact about the whole declaration and no one token overran it, so it is reported at the invocation. A literal this crate could not read is a fact about exactly one token, and that token’s handle was issued before its payload was read — so the span is held and the report goes there.
§Nonclaims
It is not a Diagnostic: composing one needs the door whose prefix, grammar, and callable entry the line carries, and a capture runs before any door is named.
Trait Implementations§
Source§impl Clone for CaptureError
impl Clone for CaptureError
Source§fn clone(&self) -> CaptureError
fn clone(&self) -> CaptureError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CaptureError
impl Debug for CaptureError
Source§impl Display for CaptureError
impl Display for CaptureError
impl Eq for CaptureError
Source§impl Error for CaptureError
impl Error for CaptureError
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()