Closed
Description
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
Labels
No labels