pub enum Error {
Unwritten {
mnemonic: String,
args: Vec<Kind>,
},
Immediate {
mnemonic: String,
imm: i64,
},
Crowded {
mnemonic: String,
},
Scale {
scale: u8,
},
Index,
Argument {
mnemonic: String,
at: u8,
},
}Expand description
Why an instruction could not be encoded.
Every one of these is a bug in the compiler rather than anything a program could ask for, so they carry enough to say which instruction it was and nothing more.
Variants§
Unwritten
Nothing here encodes that mnemonic with those arguments.
Immediate
An immediate no form of that instruction can carry, which the machine cannot write and which would be a different number if it were cut down to fit.
Crowded
An instruction naming ah and also a register that cannot be named without a REX byte,
which is a pair the encoding has no way to write.
Scale
A scale that is not one of the four the machine has.
Index
The stack pointer as an index, which is the one register that cannot be one, because its number is what the encoding uses to say there is no index.
Argument
An argument that is not the kind the row said it was, which cannot happen through
encode and can through a row that disagrees with itself.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
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()