Skip to content

Stacked Borrows cannot properly handle extern type #276

Open
@RalfJung

Description

@RalfJung

While working on rust-lang/miri#1725, I realized that Stacked Borrows does not really work properly when extern type is used: on a reborrow, the newly created reference is only valid for the memory range that Miri can actually know belongs to this reference. So a reference with an extern type tail would be reborrowed in a way that that tail becomes inaccessible. This is incompatible with e.g. how the standard library format string machinery uses extern type as its implementation for Opaque.

In a sense this is a variant of #134, but it felt worth pointing out separately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-aliasing-modelTopic: Related to the aliasing model (e.g. Stacked/Tree Borrows)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions