pub enum LoweringError {
UnsupportedOpcode {
op: String,
location: InstLocation,
},
UnsupportedType {
ty: String,
location: InstLocation,
},
UndefinedValue {
value: Value,
location: InstLocation,
},
BadBlockReference {
block: Block,
location: InstLocation,
},
MalformedTerminator {
block_id: LoweredBlockId,
},
Rejected {
reason: String,
location: InstLocation,
},
}Expand description
Structured errors produced by the Cranelift → LoweredFunction
lowering pipeline.
Each variant carries enough context for a maintainer to grep the call
site and understand the failure. The wave-2 lowering driver (W2.4)
and CraneliftLowerer impl (W2.5) return this error type, which is
then mapped into [crate::pliron_dialect::PlironLoweringError] at
the trait boundary.
Variants§
UnsupportedOpcode
The opcode has no LoweredOp equivalent and isn’t on the
reject-list either — this is a “we forgot to wire it up” path.
Distinct from LoweringError::Rejected because it indicates a
hole, not a deliberate refusal.
Fields
location: InstLocationBlock + instruction index inside the function, for diagnostics.
UnsupportedType
Fields
location: InstLocationWhere the unsupported type appears.
UndefinedValue
An operand Value wasn’t allocated in the
LoweringBuilder before use. Indicates a use-before-def in the
walker (caller bug, not user input).
Fields
location: InstLocationWhere the missing operand appeared.
BadBlockReference
A branch instruction referred to a Block that the
walker didn’t visit (so the block_map has no entry).
MalformedTerminator
A LoweredBlock has no terminator (or has a terminator that isn’t
last).
Fields
block_id: LoweredBlockIdThe LoweredBlockId of the offending block.
Rejected
The function was hit by the reject-list (W2.1). Carries the first
rejection for diagnostics; the full list is available from
crate::reject_list.
Fields
location: InstLocationWhere the rejected op appears.
Trait Implementations§
Source§impl Clone for LoweringError
impl Clone for LoweringError
Source§fn clone(&self) -> LoweringError
fn clone(&self) -> LoweringError
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 LoweringError
impl Debug for LoweringError
Source§impl Display for LoweringError
impl Display for LoweringError
impl Eq for LoweringError
Source§impl Error for LoweringError
impl Error for LoweringError
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 LoweringError
impl PartialEq for LoweringError
Source§fn eq(&self, other: &LoweringError) -> bool
fn eq(&self, other: &LoweringError) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LoweringError
Auto Trait Implementations§
impl Freeze for LoweringError
impl RefUnwindSafe for LoweringError
impl Send for LoweringError
impl Sync for LoweringError
impl Unpin for LoweringError
impl UnsafeUnpin for LoweringError
impl UnwindSafe for LoweringError
Blanket Implementations§
impl<T> AnyError for T
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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.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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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