[][src]Struct c2rust_transpile::c_ast::Qualifiers

pub struct Qualifiers {
    pub is_const: bool,
    pub is_restrict: bool,
    pub is_volatile: bool,
}

Type qualifiers (6.7.3)

Fields

is_const: bool

The const qualifier, which marks lvalues as non-assignable.

We make use of const in only two places:

  • Variable and function bindings (which matches up to Rust's mut or not bindings)
  • The pointed type in pointers (which matches up to Rust's *const/*mut)
is_restrict: boolis_volatile: bool

The volatile qualifier, which prevents the compiler from reordering accesses through such qualified lvalues past other observable side effects (other accesses, or sequence points).

The part here about not reordering (or changing in any way) access to something volatile can be replicated in Rust via std::ptr::read_volatile and std::ptr::write_volatile. Since Rust's execution model is still unclear, I am unsure that we get all of the guarantees volatile needs, especially regarding reordering of other side-effects.

To see where we use volatile, check the call-sites of Translation::volatile_write and Translation::volatile_read.

Methods

impl Qualifiers[src]

pub fn and(self, other: Qualifiers) -> Qualifiers[src]

Aggregate qualifier information from two sources.

Trait Implementations

impl Copy for Qualifiers[src]

impl PartialEq<Qualifiers> for Qualifiers[src]

impl Clone for Qualifiers[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Default for Qualifiers[src]

impl Debug for Qualifiers[src]

Auto Trait Implementations

impl Send for Qualifiers

impl Sync for Qualifiers

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<E> SpecializationError for E[src]

impl<T> Erased for T[src]

impl<T> Send for T where
    T: ?Sized
[src]

impl<T> Sync for T where
    T: ?Sized
[src]

impl<T> Make for T[src]

impl<T> MaybeResult for T[src]

impl<'a, T> Captures for T where
    T: ?Sized
[src]

impl<T> Erased for T