These are chat archives for rust-lang/rust

Mar 2017
Peter Atashian
Mar 30 2017 05:35
@hollinwilkins Be extremely careful about the lifetime of that slice though
from_raw_parts doesn't impose any restrictions on the lifetime of the returned slice, so you could very easily end up with a slice that lives longer than the data it points to
Ingvar Stepanyan
Mar 30 2017 15:08
also you need to be sure that that slice does not have NULL as a base - e.g. in one C library I had strings which, when empty, were { .data = NULL, .length = 0 }, but apparently this might break some Rust assumptions when constructing slice
or rather when using it later
Hollin Wilkins
Mar 30 2017 15:21
@retep998 For sure, I immediately clone it so Rust owns its own copy of the data and the caller frees theirs
Cajetan Puchalski
Mar 30 2017 17:39
If anyone here is familiar with Redox OS, I was wondering, is it possible to change the keyboard layout in redox running on qemu? I was thinking about writing something for the Redox project but it's kinda hard to test when I can't type almost anything because I use dvorak instead of qwerty..