Skip to content

Tying the knot with @ #7082

Closed
Closed
@huonw

Description

@huonw

At the moment there doesn't seem to be a way to create an @ graph that has a cycle in it, without an @mut or &mut somewhere in its ownership tree, and so one can't write something that does, for example:

struct Foo { name: ~str, other: @Foo }

let a = @Foo { name: ~"a", other: b };
let b = @Foo { name: ~"a", other: a };

without using @mut, even though construction is the only time mutability is required.

(Examples of where it would be useful: part 1, part 2, one from IRC: log, code)

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