pub enum Conversion {
Lvalue,
ArrayDecay,
FunctionDecay,
Arithmetic,
Pointer,
Bool,
NullPointer,
Void,
}Expand description
A conversion the language performs without being asked.
Each of these is a node in the tree rather than a difference between two types that a later
pass notices. The IR builder is entitled to assume it never has to insert one, and the
verifier in spec/08-ir.md checks that assumption on every function.
Variants§
Lvalue
Reading an object, which drops the qualifiers and turns an lvalue into a value.
ArrayDecay
An array becoming a pointer to its first element.
FunctionDecay
A function becoming a pointer to itself.
Arithmetic
One arithmetic type to another. The integer promotions, the usual arithmetic conversions, and the conversions an assignment or an argument performs are all this.
Pointer
A pointer to another pointer type, which includes both directions of void *.
Bool
A scalar to bool, which is a comparison against zero rather than a truncation, and
which is why it is not Conversion::Arithmetic.
NullPointer
A null pointer constant becoming a pointer, which is not the same as converting the
integer zero, because the constant may have any integer type and (void *)0 is one.
Void
A value being discarded, which is what a cast to void and an expression statement do.
Implementations§
Trait Implementations§
Source§impl Clone for Conversion
impl Clone for Conversion
Source§fn clone(&self) -> Conversion
fn clone(&self) -> Conversion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more