A copy of the http://doc.rust-lang.org/std/rc/ module
that runs on stable Rust with Weak references.
As of this writing, std::rc::Weak is marked #[unstable]
and therefore can not be used on stable Rust yet.
To make this work, some features had to be removed:
T are not supported in Rc<T> or Weak<T>#[unsafe_no_drop_flag] is not used,
so (in curent Rust) Rc<T> and Weak<T> have a drop flag
and are two words big (16 bytes 64-bit platforms) instead of one.NonZero is not used,
so Option<Rc<T>> and Option<Weak<T>> are one word bigger than Rc<T> or Weak<T>
(for a total of 24 bytes instead of 8 on 64-bit platforms).std::intrinsics::assume is not used,
so the optimizer may not be able to remove as many redundant checks.```toml
[features] unstable = []
[dependencies] rc = { "0.1.0", # Unfortunately, as of this writing, Cargo features can not disable dependencies. # See https://github.com/rust-lang/cargo/issues/1839 # optional = true, } ```
```rust // lib.rs
```
```rust // some_module.rs
```