Skip to content

Stacked Borrows: aliasing rules for local variables #363

Open
@RalfJung

Description

@RalfJung

What should the aliasing rules for local variables in a function be? Stacked Borrows currently says they behave like &mut. For safe code that is definitely sound, but people coming from C are often surprised that there are aliasing rules to uphold even when there is no reference anywhere.

There's a c2rust translator that had to be adjusted to for this rule, and also see this discussion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-aliasing-modelTopic: Related to the aliasing model (e.g. Stacked/Tree Borrows)C-open-questionCategory: An open question that we should revisit

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions