#[non_exhaustive]pub enum MoveError {
DuplicateDestination {
index: usize,
},
ClassMismatch {
index: usize,
},
NoScratch {
class: RegClass,
},
NoTemp {
class: RegClass,
},
TooMany,
}Expand description
Why a parallel copy could not be resolved.
§Examples
use backend_lang::moves::{Move, MoveEnv, MoveError, MoveResolver};
use backend_lang::x86_64::{self, GPR, RAX, RBX};
let twice = [Move::new(RAX, RBX, GPR), Move::new(RAX, 1, GPR)];
let err = MoveResolver::new()
.resolve(&x86_64::TARGET, &twice, &MoveEnv::new(), &mut Vec::new())
.unwrap_err();
assert_eq!(err, MoveError::DuplicateDestination { index: 1 });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.
DuplicateDestination
Two moves write the same location; a parallel copy’s destinations are
distinct. index is the later of the two.
ClassMismatch
A register in move index is not in the move’s class (or the target
has no such class or register).
NoScratch
A cycle of class class needs a scratch location: no free register
of the class, no swap, and no scratch slot was provided.
NoTemp
A memory-to-memory move (or an immediate store) of class class
needs a temporary register: no free register of the class, and no
victim slot to borrow one with (or the class has no register to
borrow).
TooMany
More than u32::MAX - 2 moves in one parallel copy.
Trait Implementations§
impl Copy for MoveError
impl Eq for MoveError
Source§impl Error for MoveError
impl Error for MoveError
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()
impl StructuralPartialEq for MoveError
Auto Trait Implementations§
impl Freeze for MoveError
impl RefUnwindSafe for MoveError
impl Send for MoveError
impl Sync for MoveError
impl Unpin for MoveError
impl UnsafeUnpin for MoveError
impl UnwindSafe for MoveError
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