Skip to content

Rust Binder: remove is_aligned helper #1220

@Darksonn

Description

@Darksonn

The recently landed patch rust_binder: add additional alignment checks adds this helper to Rust Binder:

fn is_aligned(value: usize, to: usize) -> bool {
    value % to == 0
}

This is done because is_multiple_of is not available prior to Rust v1.87.0. However, I would like to replace it with is_multiple_of as a follow-up change.

This may be worked around using the same strategy as rust: enable slice_flatten feature and provide it through an extension trait.

Note that if this change is implemented after Rust for Linux bumps its Minimum Supported Rust version to 1.85.0, then this may instead be implemented by the same strategy as rust: enable raw_ref_op feature, as the is_multiple_of method was added as unstable in rustc v1.82.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    • libRelated to the `rust/` library.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions