pub enum Error {
Opcode {
func: String,
opcode: String,
},
Virtual {
func: String,
opcode: String,
},
Encode {
func: String,
opcode: String,
why: String,
},
Distance {
func: String,
bytes: i64,
},
Machine {
triple: String,
},
Thread {
name: String,
},
Image {
name: String,
why: String,
},
}Expand description
A function this compiler could not write out as assembly.
Neither of these is a program’s fault and neither should ever reach a user, since a machine function that reaches here has been through the whole backend and the tests pin both of the claims below. They are errors rather than assertions because the alternative to reporting one is writing a listing that is quietly wrong, and a wrong listing is the failure section 11.1 is written to prevent.
Variants§
Opcode
An opcode the target has no description of.
Fields
Virtual
A register that is still virtual, which is a function that was never allocated.
Fields
Encode
An instruction the description names and the encoder could not write bytes for.
The two halves of the description are meant to hold the same instructions, and a test pins that they do, so this is either a row that was left out of one of them or an operand the machine cannot express in the instruction that was chosen for it.
Fields
Distance
A jump inside a function to somewhere more than two gigabytes away.
A single function that long is not a program anybody wrote, and the four bytes a jump carries are all there are, so this is reported rather than wrapped around into a jump somewhere else entirely.
Fields
Machine
A machine this crate cannot write assembly for.
Thread
A thread-local variable, which is not a mistake and not written yet.
The only one of these that is about a program rather than about this compiler. Reaching a thread-local variable is a call or a load off the thread pointer depending on the model, and none of that is built, so one is refused rather than written out as an ordinary variable that every thread would share.
Image
A piece of an initializer nothing here can write down.
Trait Implementations§
impl Eq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.