Re: [rust-dev] Static_assert on a hash

2014-03-30 Thread Simon Sapin
On 30/03/2014 09:50, Vladimir Pouzanov wrote: I have a chunk of code that toggles different functions on hardware pins, that looks like this: enum Function { GPIO = 0, F1 = 1, F2 = 2, F3 = 3, } fn set_mode(port: u8, pin: u8, fun: Function) What I would like to have

Re: [rust-dev] Static_assert on a hash

2014-03-30 Thread Vladimir Pouzanov
That shifts the issue even more into runtime, doesn't it? My goal is to find a way to resolve a tuple of (u8, u8, FuncNameEnum) to u8, where FuncNameEnum is a long enum of all possible functions. And I need to do that in compile time. One way I see that is to make a really long list of enums

Re: [rust-dev] Static_assert on a hash

2014-03-30 Thread Simon Sapin
On 30/03/2014 10:30, Vladimir Pouzanov wrote: That shifts the issue even more into runtime, doesn't it? My goal is to find a way to resolve a tuple of (u8, u8, FuncNameEnum) to u8, where FuncNameEnum is a long enum of all possible functions. And I need to do that in compile time. One way I see

[rust-dev] To build libstd as separate library

2014-03-30 Thread Alexander Stavonin
Hi! I’m trying to build libstd like separate library (long term goal is Rust + libstd in kernel drivers). So, I made a copy of lib std and compiling it: num/int_macros.rs:231:1: 231:19 error: failed to find an implementation of trait kinds::Copy for int num/int_macros.rs:231 impl Int for $T

Re: [rust-dev] Static_assert on a hash

2014-03-30 Thread Vladimir Pouzanov
Ok, so I have a number of hardware pins which are defined by port+pin numbers. Each pin can be connected to different peripheral (e.g. generic purpose i/o, serial, analog in) which defines it's function. So, to configure that I have a few u32 registers where each pair of bits defines a function

Re: [rust-dev] To build libstd as separate library

2014-03-30 Thread Alexander Stavonin
I’ve latest night build version of rustic: libstd: rustc -v rustc 0.10-pre-nightly (ff64381 2014-03-28 00:26:52 -0700) host: x86_64-apple-darwin Unfortunately, same error with `--cfg stage2`: libstd: rustc --cfg stage2 lib.rs

Re: [rust-dev] To build libstd as separate library

2014-03-30 Thread Alexander Stavonin
Fixed. —cfg stage0 should be used. Best regards, Alexander www.sysdev.me On 30 Mar 2014, at 16:17, Alexander Stavonin a.stavo...@gmail.com wrote: I’ve latest night build version of rustic: libstd: rustc -v rustc 0.10-pre-nightly (ff64381

Re: [rust-dev] Static_assert on a hash

2014-03-30 Thread comex
On Sun, Mar 30, 2014 at 8:08 AM, Vladimir Pouzanov farcal...@gmail.com wrote: gpio::Pin::new(0, 15, gpio::Out, gpio::UART1_TXD); // p13 - TXD compiles, but something like gpio::Pin::new(0, 15, gpio::Out, gpio::SPI_MISO); // p13 - TXD would fail, because there's no SPI_MISO defined for

Re: [rust-dev] To build libstd as separate library

2014-03-30 Thread Daniel Micay
On 30/03/14 02:00 PM, Alexander Stavonin wrote: Fixed. —cfg stage0 should be used. That just means the compiler build you're using is too out-of-date to build the real standard library. The `--cfg stage0` version of the library is an out-of-date variant only there to allow bootstrapping the