PointerArithmetic in rustc_middle::mir::interpret - Rust
Description: API documentation for the Rust `PointerArithmetic` trait in crate `rustc_middle`.

Skip to main content

## PointerArithmetic

# Trait PointerArithmetic

Source

    pub trait PointerArithmetic: HasDataLayout {
        // Provided methods
        fn pointer_size(&self) -> Size { ... }
        fn max_size_of_val(&self) -> Size { ... }
        fn target_usize_max(&self) -> u64 { ... }
        fn target_isize_min(&self) -> i64 { ... }
        fn target_isize_max(&self) -> i64 { ... }
        fn truncate_to_target_usize(&self, val: u64) -> u64 { ... }
        fn sign_extend_to_target_isize(&self, val: u64) -> i64 { ... }
    }

## Provided Methods§

Source

#### fn pointer_size(&self) -> Size

Source

#### fn max_size_of_val(&self) -> Size

Source

#### fn target_usize_max(&self) -> u64

Source

#### fn target_isize_min(&self) -> i64

Source

#### fn target_isize_max(&self) -> i64

Source

#### fn truncate_to_target_usize(&self, val: u64) -> u64

Source

#### fn sign_extend_to_target_isize(&self, val: u64) -> i64

## Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

## Implementors§

Source§

### impl<T: HasDataLayout> PointerArithmetic for T