Skip to content

is_aligned goes wrong on non-provenance pointers with symbolic alignment #2682

Closed
@RalfJung

Description

@RalfJung

The following should pass even with symbolic alignment checks:

#![feature(strict_provenance, pointer_is_aligned)]

use std::ptr;

fn main() {
    let p = ptr::invalid::<()>(1);
    assert!(p.is_aligned());
}

However, the assertion fails. This is almost certainly caused by rust-lang/rust#102795.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions