[rust-dev] Pattern matching on std::os::args()

2014-04-20 Thread richo
o/ Rustlers, So, as an indirect result of the absence of pattern matching on unique vectors, I'm having a lot of trouble writing a sane CLI interface based on the results of os::args() The full code in a more readable format is available at here[1] So what I really want is something like:

[rust-dev] Missing lifetime parameter in std::str::MaybeOwned

2014-04-20 Thread Edward Wang
The snippet is extracted from std::str: pub enum MaybeOwned'a { /// A borrowed string Slice('a str), /// An owned string Owned(~str) } impl'a Eq for MaybeOwned'a { #[inline] fn eq(self, _other: MaybeOwned) - bool { true } } fn main() {} Note the Eq

Re: [rust-dev] Pattern matching on std::os::args()

2014-04-20 Thread Geoffroy Couprie
Hi, I encountered the same problem, and I wound up writing a library to solve it (instead of working on my original code): https://github.com/Geal/typedopts The basic idea is to define a Decoder that can work on command line options. Then you just need to add #[deriving(Decodable)] to a

[rust-dev] LLVM doesn't inline my static, any good reason for that?

2014-04-20 Thread Vladimir Pouzanov
I'm working on a proof-of-concept implementation for https://github.com/rust-lang/rfcs/pull/44 [Linker placement attribute], and I actually got code that is working, but the outcome is worse than I expected. Consider the following snippet: #[unsafe_override_address] static Tinst : T = 1000;

Re: [rust-dev] Pattern matching on std::os::args()

2014-04-20 Thread richo
On 20/04/14 10:44 +0200, Geoffroy Couprie wrote: Hi, I encountered the same problem, and I wound up writing a library to solve it (instead of working on my original code): https://github.com/Geal/typedopts The basic idea is to define a Decoder that can work on command line options. Then you

Re: [rust-dev] Ideas to build Rust projects

2014-04-20 Thread Matthieu Monrocq
I agree that a protable terminal would be sweet, however the terminal and shell are only half the story: you then need a uniform set of tools behind the scenes else all your scripts fail. I would like to take the opportunity to point out Mosh [1] as an existing (and recent) shell, it might make

Re: [rust-dev] LLVM doesn't inline my static, any good reason for that?

2014-04-20 Thread György Andrasek
On Sun, Apr 20, 2014 at 10:46 AM, Vladimir Pouzanov farcal...@gmail.com wrote: The results in the following IR: @Tinst = internal constant %struct.T* inttoptr (i32 1000 to %struct.T*) The problem is that llvm never inlines the constant (even with #[address_insignificant]), so instead of

Re: [rust-dev] LLVM doesn't inline my static, any good reason for that?

2014-04-20 Thread Vladimir Pouzanov
Apparently I had a problem of double pointer. The solution was to use static Tinst : 'static T = 1000; though I have modified the code now so that T works as well. On Sun, Apr 20, 2014 at 2:04 PM, György Andrasek jur...@gmail.com wrote: On Sun, Apr 20, 2014 at 10:46 AM, Vladimir Pouzanov