Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

get_mut method on Outputs allows for creating multiple refererences as mutable to the same data #73

@PieterPenninckx

Description

@PieterPenninckx

The method get_mut on Outputs has the following signature:

pub fn get_mut(&self, i: usize) -> &'a mut [T]

Here we are creating a reference as mutable from a reference as immutable. In this way, we can get multiple references as mutable to the same data by passing the same index i more than once, violating Rust's aliasing rules.

This is similar to #66, but not fixed by my PR #67, which is why I created a separate issue.

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