These are chat archives for rust-lang/rust

Jun 2017
Sathya Narrayanan
Jun 12 2017 01:36
@snarf95_twitter @vorner I am trying to use rust-crypto but a different head
Jun 12 2017 02:39
why rust's crate so annoying, no flexible. for example, to add a test, i need to modify dev.dependencies in cargo.toml, add 'extern crate name'; and add 'use self::cratename;'. too many step
Alexander Irbis
Jun 12 2017 02:43
"add use self::cratename;" - why?
Jun 12 2017 03:09
because my imported crate is only used in test, so i add crate spec into dev.dependencies
rand = "0.3"
extern crate rand;
use self::rand;
it cannot be written as "use rand;"
Alexander Irbis
Jun 12 2017 04:29
You don't need use self::rand;. extern crate rand; does this work.
Jun 12 2017 06:32
for a complete case;

/tmp/app $ cat Cargo.toml
name = "app"
version = "0.1.0"
authors = [""]

protobuf = { version = "^1.0.0"}
/tmp/app $ cat src/


mod tests {
extern crate protobuf;
use protobuf::*;

fn test1() {
    let _: &Message;


cargo test
Compiling app v0.1.0 (file:///tmp/app)
error[E0432]: unresolved import protobuf::*
10 | use protobuf::*;
| ^^^^^^^^^^^^ Did you mean self::protobuf?

compiler complains, and it is ok when changed to 'use self::protobuf;'
Alexander Irbis
Jun 12 2017 08:02
Hmm, it's very strange to replace protobuf::* with protobuf. - for example of working imports.
Jun 12 2017 08:31
Da Xian Sheng
Jun 12 2017 15:00
hi all
I want to use rust to write an os for arm.
Denis Lisov
Jun 12 2017 15:04
@daxiansheng Well, that's certainly possible... what kind of ARM systems do you target?
Da Xian Sheng
Jun 12 2017 15:06
@tanriol Memory limited devices such as arm cortex m0 m3.
Denis Lisov
Jun 12 2017 15:09
There are several projects in this space, IIRC. If you don't require the experience of inventing everything from scratch, I'd suggest looking into them and contributing to some :-)
You should probably start by reading the internals post on the state of embedded in Rust.
Da Xian Sheng
Jun 12 2017 15:10
I noticed that rust-lang use llvm as compiler backend, and llvm support thumb instructions, so write os in rust is possiable, isn't?
@tanriol great Idea,
Sherzod Mutalov
Jun 12 2017 15:12
@daxiansheng Possible, yes.
Denis Lisov
Jun 12 2017 15:12
People are already doing them, so, unless you have some unique concepts, helping them out would probably be more productive than competing with them.
@shmutalov Isn't Redox currently x86_64-only?
Uwe Arzt
Jun 12 2017 16:22
@daxiansheng Do you know the blog ? There re also a lot of helpful repos on github by japaric ;) His blog and repos are a nice starting point for rust on ARM Microcontrollers.