[rust-dev] Debugging rust for a newbie

2014-07-23 Thread Urban Hafner
Hey there, I'm still quite new to Rust. Until now I was able to fix all my bugs by writing tests and/or randomly adding lifetime parameters to keep the compiler happy. Now I've hit my first stack overflow. I assume it's due to the fact that I've screwed up the lifetimes and the objects live too

Re: [rust-dev] Debugging rust for a newbie

2014-07-23 Thread Huon Wilson
It is unlikely to be a lifetimes thing; far, far more likely to be a normal infinite recursion. The size of the stack frame of each function is fixed at compile time, so the way to blow the stack is by calling a lot of functions deeply, e.g. it's not possible to write a loop that places more

Re: [rust-dev] Debugging rust for a newbie

2014-07-23 Thread Urban Hafner
Hey Huon, thanks for the help. The problem is really obvious now that you mention it! Thanks for the debugging tips however. Coming from Ruby all I ever use are print statements. So it's good to know how to do it! Urban On Wed, Jul 23, 2014 at 10:02 AM, Huon Wilson dbau...@gmail.com wrote:

Re: [rust-dev] A shiny test framework

2014-07-23 Thread Nat Pryce
Could you use RAII to call a lambda? On 22 July 2014 20:31, Vladimir Pouzanov farcal...@gmail.com wrote: One note on why there's no after_each: You cannot really make sure that the epilogue is being called, so if you need to do anything after your test case, use RAII in before_each. On

Re: [rust-dev] A shiny test framework

2014-07-23 Thread Nat Pryce
It's great to see Hamcrest ported to Rust. On 22 July 2014 20:06, Vladimir Pouzanov farcal...@gmail.com wrote: I've just published a tiny test framework: shiny at https://github.com/farcaller/shiny. It's best used with hamcrest-rust. This library exists because I find it ugly to redefine

[rust-dev] Using 'mod' for test code

2014-07-23 Thread Allen Welkie
I'm having an issue with creating a separate testing file for a program I'm writing. I have a file called 'myprogram.rs', which imports complex numbers with the following extern crate num; use num::complex::Complex; and then defines a bunch of functions. I want to test these functions in a

Re: [rust-dev] Opt-In Built-In Traits (was: Mutable files)

2014-07-23 Thread David Henningsson
On 2014-07-21 19:17, Patrick Walton wrote: On 7/21/14 8:49 AM, Tobias Müller wrote: Patrick Walton pcwal...@mozilla.com wrote: On 7/20/14 8:12 PM, David Henningsson wrote: From a language design perspective, maybe it would be more intuitive to have different syntaxes for copy and move,

Re: [rust-dev] Announcing the Rust Community Calendar

2014-07-23 Thread Paul Nathan
Seattle has a Rust meetup Monthly. Second Monday of the month, 7pm. There's a event signup on Eventbrite. In August there will be pizza. :) On Jul 23, 2014 2:22 PM, Erick Tryzelaar erick.tryzel...@gmail.com wrote: Good afternoon Rustaceans! I just created a community calender for all the