#[non_exhaustive]pub enum FrameError {
TooLarge,
Alignment {
slot: StackSlot,
align: u32,
},
OverlappingIncoming {
slot: StackSlot,
},
}Expand description
Why a frame could not be laid out.
§Examples
use backend_lang::mir::{Function, SlotKind};
use backend_lang::target::frame::FrameError;
use backend_lang::x86_64::SYSV;
let mut f = Function::new("f", &SYSV);
let slot = f.stack_slot(SlotKind::Local { size: 32, align: 32 })?;
assert_eq!(f.frame_layout().unwrap_err(), FrameError::Alignment { slot, align: 32 });Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
TooLarge
The frame, or an offset into it, exceeds the 32-bit displacement instructions address it with. Move large data to the heap.
Alignment
A slot’s alignment is zero, not a power of two, or larger than the ABI’s stack alignment (16), which the fixed frame cannot provide without realigning the stack.
OverlappingIncoming
Two incoming slots overlap; each names a distinct stack argument.
Trait Implementations§
Source§impl Clone for FrameError
impl Clone for FrameError
impl Copy for FrameError
Source§impl Debug for FrameError
impl Debug for FrameError
Source§impl Display for FrameError
impl Display for FrameError
impl Eq for FrameError
Source§impl Error for FrameError
impl Error for FrameError
1.30.0 · 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 From<FrameError> for EmitError
impl From<FrameError> for EmitError
Source§fn from(e: FrameError) -> EmitError
fn from(e: FrameError) -> EmitError
Converts to this type from the input type.
Source§impl Hash for FrameError
impl Hash for FrameError
Source§impl PartialEq for FrameError
impl PartialEq for FrameError
impl StructuralPartialEq for FrameError
Auto Trait Implementations§
impl Freeze for FrameError
impl RefUnwindSafe for FrameError
impl Send for FrameError
impl Sync for FrameError
impl Unpin for FrameError
impl UnsafeUnpin for FrameError
impl UnwindSafe for FrameError
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