pub enum AsmError {
UnknownMnemonic {
mnemonic: String,
arch: ArchName,
span: Span,
},
InvalidOperands {
detail: String,
span: Span,
},
ImmediateOverflow {
value: i128,
min: i128,
max: i128,
span: Span,
},
UndefinedLabel {
label: String,
span: Span,
},
DuplicateLabel {
label: String,
span: Span,
first_span: Span,
},
BranchOutOfRange {
label: String,
disp: i64,
max: i64,
span: Span,
},
MisalignedBranchTarget {
label: String,
disp: i64,
alignment: u8,
span: Span,
},
Syntax {
msg: String,
span: Span,
},
RelaxationLimit {
max: usize,
},
ResourceLimitExceeded {
resource: String,
limit: usize,
},
Multiple {
errors: Vec<AsmError>,
},
}Expand description
Assembly error with source location and descriptive message.
Variants§
UnknownMnemonic
Unknown mnemonic for the target architecture.
Fields
InvalidOperands
Invalid operand combination for the instruction.
Fields
ImmediateOverflow
Immediate value exceeds the allowed range.
Fields
UndefinedLabel
Referenced label was never defined.
DuplicateLabel
Label was defined more than once.
Fields
BranchOutOfRange
Branch target is out of range even after relaxation.
Fields
MisalignedBranchTarget
A branch target is not aligned to the granularity its encoding can represent.
PC-relative branches store their displacement pre-scaled — AArch64 shifts right by 2, Thumb and RISC-V by 1 — so the low bits of an unaligned target have nowhere to go. Truncating them would silently branch somewhere other than the label.
Fields
Syntax
Syntax error during lexing or parsing.
RelaxationLimit
Branch relaxation did not converge within the allowed number of passes.
ResourceLimitExceeded
A configurable resource limit was exceeded (defense against DoS).
Fields
Multiple
Multiple errors collected during assembly.
Trait Implementations§
impl Eq for AsmError
Source§impl Error for AsmError
Available on crate feature std only.
impl Error for AsmError
std only.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()