#[non_exhaustive]pub enum PlanLowerError {
UnresolvedName {
name: SmolStr,
span: HirSpan,
},
UndesugaredExpr {
kind: &'static str,
span: HirSpan,
},
EmptyPatternPart {
span: HirSpan,
},
}Expand description
A precondition violation detected by HIR → Plan lowering.
lower_statement requires its input to have been name-resolved
(cyrs-sema::resolve / cy-b4b) and desugared
(cyrs_hir::desugar::desugar_statement / cy-mla). The variants below
describe the kinds of precondition violation the entry point detects.
This enum is #[non_exhaustive]: callers must include a wildcard arm to
remain forward-compatible (spec cy-2i9.1 precedent).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnresolvedName
An cyrs_hir::Expr::Unresolved node survived into plan
lowering — name resolution must run first (cy-b4b). The variable
name is preserved for diagnostics.
Fields
name: SmolStrThe identifier that was never resolved to a cyrs_hir::VarId.
UndesugaredExpr
An expression that must be desugared before plan lowering
survived into the entry point (cy-mla). Possible kind values
are "ListComprehension", "MapProjection", and
"PatternPredicate".
Fields
span: HirSpanApproximate span of the offending clause (see
Self::UnresolvedName::span for why this is clause-scoped).
EmptyPatternPart
A cyrs_hir::PatternPart reached the lowerer with no
cyrs_hir::PatternElements, or with a malformed element
sequence the Source + Expand translation cannot walk (cy-f2t).
The parser’s error-recovery pass can emit such pattern parts for
inputs where the pattern is syntactically incomplete (e.g. a bare
MATCH keyword, or an open MATCH ( with no close). The
previous lowerer assumed every part starts with a cyrs_hir::PatternElement::Node
and panicked on the empty / leading-Rel case; this variant
surfaces the recovery-produced shape as a clean error.
Fields
span: HirSpanApproximate span of the offending clause (see
Self::UnresolvedName::span for why this is clause-scoped).
Trait Implementations§
Source§impl Clone for PlanLowerError
impl Clone for PlanLowerError
Source§fn clone(&self) -> PlanLowerError
fn clone(&self) -> PlanLowerError
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 PlanLowerError
impl Debug for PlanLowerError
Source§impl Display for PlanLowerError
impl Display for PlanLowerError
Source§impl Error for PlanLowerError
impl Error for PlanLowerError
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 PartialEq for PlanLowerError
impl PartialEq for PlanLowerError
Source§fn eq(&self, other: &PlanLowerError) -> bool
fn eq(&self, other: &PlanLowerError) -> bool
self and other values to be equal, and is used by ==.impl Eq for PlanLowerError
impl StructuralPartialEq for PlanLowerError
Auto Trait Implementations§
impl Freeze for PlanLowerError
impl RefUnwindSafe for PlanLowerError
impl Send for PlanLowerError
impl Sync for PlanLowerError
impl Unpin for PlanLowerError
impl UnsafeUnpin for PlanLowerError
impl UnwindSafe for PlanLowerError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.