These are chat archives for rust-lang/rust

7th
Aug 2017
Joonas Koivunen
@koivunej
Aug 07 2017 08:17
@target-san did you find out how to do it with nightly?
@target-san i might have a Rc<[str]> usecase in my string-cache, which uses Rc<String> at the moment...
Igor
@target-san
Aug 07 2017 08:27
@koivunej #![feature(allocator_api)], then std::heap::{ Heap, Alloc, Layout}. And check nightly docs for details, because stable docs are obsolete on this topic.
Then, I bikeshed another variant of Rc, which is initialized from I: IntoIterator, I::IntoIter: ExactSizeIterator. The memory chunk is allocated and initialized manually.
Igor
@target-san
Aug 07 2017 09:49
If we had runtime-sized arrays, I'd simply use Rc<[T]>.
David Harvey-Macaulay
@alteous
Aug 07 2017 11:28

Is it possible to propagate feature flags to subcrates in Cargo.toml? I have a situation like this:

parent-crate/Cargo.toml

[dependencies.child]
features = [<<parent_features>>]
[features]
foo = []
bar = []

child-crate/Cargo.toml

[features]
foo = []
bar = []
Denis Lisov
@tanriol
Aug 07 2017 11:30
From manifest doc
# Features can be used to reexport features of other packages. The `session`
# feature of package `awesome` will ensure that the `session` feature of the
# package `cookie` is also enabled.
session = ["cookie/session"]
David Harvey-Macaulay
@alteous
Aug 07 2017 11:31
@tanriol That's great, thanks!
Ravi Teja
@tekjar
Aug 07 2017 15:14
Hi all. Is anyone aware of crates which use shared memory for doing ipc?
James McCoy
@jamessan
Aug 07 2017 15:27
Andrey Torsunov
@gtors
Aug 07 2017 18:41
Hi folks! Is there any reason why the Default trait is not implemented for the *mut T type?
Denis Lisov
@tanriol
Aug 07 2017 18:41
Does it really have an obvious default value?
Andrey Torsunov
@gtors
Aug 07 2017 18:47
ptr::null_mut() ?