pub enum Unsupported {
Inst {
inst: Inst,
term: Option<&'static str>,
opcode: Opcode,
ty: Option<Type>,
},
Argument {
index: usize,
missing: Missing,
},
Call {
inst: Inst,
refused: Refused,
},
Indirect {
inst: Inst,
},
Dynamic {
inst: Inst,
},
}Expand description
Why a function could not be lowered.
One reason and then nothing. A function with no rule for something in it is a function this cannot finish, and the second thing it could not lower is not news.
Variants§
Inst
An instruction no rule fires on.
Fields
term: Option<&'static str>What the rule file would call it, or nothing if the rule language has no name for it at all, which is what an instruction at a width nothing is written about looks like.
Argument
A parameter that does not arrive somewhere this can bring it in from.
Not an instruction, which is why it is a separate arm: it is a fact about the signature and there is nothing in the body of the function to point at.
Fields
Call
A call that passes or gives back a value this cannot put where the convention wants it.
Indirect
A call through an address rather than to a name.
The address is a value in a register and the instruction that calls one is a different instruction, which nothing describes yet.
Dynamic
A stack slot whose size is not known until the function runs, which is what a variable length array is.
Not an instruction no rule covers. Growing the stack where the declaration stands is arithmetic on the stack pointer, and everything else in the frame then has to be reached through a frame pointer instead, and neither of those is a term a rule could be written about or a thing the frame here knows how to lay out.
Implementations§
Source§impl Unsupported
impl Unsupported
Sourcepub fn inst(&self) -> Option<Inst>
pub fn inst(&self) -> Option<Inst>
The instruction it is about, or nothing for the one arm that is about a signature.
What a caller wants this for is the span. The function knows where every instruction in it came from, so a caller holding both can point a message at the line somebody wrote rather than at the file as a whole, and nothing here has to carry a span of its own.
Trait Implementations§
Source§impl Clone for Unsupported
impl Clone for Unsupported
Source§fn clone(&self) -> Unsupported
fn clone(&self) -> Unsupported
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Unsupported
impl Debug for Unsupported
Source§impl Display for Unsupported
impl Display for Unsupported
impl Eq for Unsupported
Source§impl Error for Unsupported
impl Error for Unsupported
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()