pub enum LayoutError {
Incomplete,
Function,
Variable,
TooLarge,
}Expand description
Why a type has no layout.
Variants§
Incomplete
The type is incomplete: void, an array with no size, or a record or enumeration whose
definition has not been seen. GNU C gives sizeof(void) the value one, and that is a
dialect decision made where there is a warning to emit, not here.
Function
The type is a function type, which has no size at all. GNU C gives it the value one for
the same reason it does for void.
Variable
The type is complete and how large it is depends on something the program computes, which is a variable length array or a record with one among its members.
Not a diagnostic on its own. Every one of these has a size, worked out where the
declaration carrying it was reached, and this is what tells a caller to go and ask for it
rather than to report that there is none. align still answers for one.
TooLarge
The type is complete and describes an object larger than one may be, which an array declaration can ask for by multiplying two innocent looking numbers.
The limit is
TargetInfo::max_object_size, which is
PTRDIFF_MAX and not the address space: an object of every byte there is would have a
pointer subtraction across it with no answer.
Trait Implementations§
Source§impl Clone for LayoutError
impl Clone for LayoutError
impl Copy for LayoutError
Source§impl Debug for LayoutError
impl Debug for LayoutError
Source§impl Display for LayoutError
impl Display for LayoutError
impl Eq for LayoutError
Source§impl Error for LayoutError
impl Error for LayoutError
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()