pub enum Definition {
Declared,
Tentative,
Defined,
}Expand description
How much of a definition a declaration is.
The three states are what the one-definition rules are written in terms of, and keeping them apart is what makes a tentative definition become a definition at the end of the translation unit rather than at the point it was read.
Variants§
Declared
A declaration and nothing more, which is what extern int x; is and what every
function declaration without a body is.
Tentative
A file-scope object with no initializer and no extern, which is a definition only if
nothing else in the translation unit defines it. C calls this a tentative definition and
it is the reason int x; int x; is one object and not an error.
Defined
A definition: an object with an initializer, a block-scope object with automatic storage, or a function with a body.
Trait Implementations§
Source§impl Clone for Definition
impl Clone for Definition
Source§fn clone(&self) -> Definition
fn clone(&self) -> Definition
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Definition
Source§impl Debug for Definition
impl Debug for Definition
impl Eq for Definition
Source§impl PartialEq for Definition
impl PartialEq for Definition
impl StructuralPartialEq for Definition
Auto Trait Implementations§
impl Freeze for Definition
impl RefUnwindSafe for Definition
impl Send for Definition
impl Sync for Definition
impl Unpin for Definition
impl UnsafeUnpin for Definition
impl UnwindSafe for Definition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more