The `nums` array is allocated on the stack and is 8 MB (assuming you're on
a 64 bit platform).
On Wed Nov 26 2014 at 8:23:08 PM Ben Wilson wrote:
> Hey folks, I've started writing some rust code lately and run into weird
> behavior when benchmarking. When running
>
> https://gist.github.com/benw
The syntax is ambiguous:
let foo = (HashMapnew());
is foo a HashMap, or is it a tuple containing the results of
these two comparisons: HashMap < Foo and Bar > new()?
On Tue Nov 18 2014 at 1:38:26 PM Daniel Trstenjak <
daniel.trsten...@gmail.com> wrote:
>
> Dear rust devs,
>
> is there a reason
assert! Takes a boolean expression and an optional error message. The
`false` is being interpreted as an error message which results in the
Box output. You probably want to use assert_eq!
On Mon Nov 17 2014 at 8:31:46 AM Max R.D. Parmer wrote:
> The code and error generated from the test suite a
thing {
do_bar();
}
```
is equivalent to
```
loop {
if !thing {
break;
}
do_bar();
}
```
We judged that the convenience of the `if let` syntax justified its
inclusion in the language, just like `for` and `while`.
Steven Fackler
On Tue, Oct 14, 2014 at 8:40 AM, M
`if let` acts on *any* refutable pattern, not just `Option`s. The RFC that
proposed the syntax is a good place to look for the rationale of why it was
added: https://github.com/rust-lang/rfcs/pull/160
Steven Fackler
On Sun, Oct 12, 2014 at 10:41 PM, Michael Giagnocavo
wrote:
> I came acr
Is a logger that synchronously writes to the filesystem and doesn't offer
any type of rotation more useful than redirecting stderr?
Steven Fackler
On Tue, Jul 22, 2014 at 8:11 AM, Diggory Hardy wrote:
> Are you saying that liblog should be moved too? Because I don't see wh
Foo { a: int, b: &'static str }).
In addition, if a type implements Drop, it is no longer Copy.
Steven Fackler
On Sun, Jul 20, 2014 at 7:39 PM, David Henningsson wrote:
>
>
> On 2014-07-21 03:33, Patrick Walton wrote:
>
>> On 7/20/14 6:29 PM, David Henningsson wrote
ntil we've given the compiler an
opportunity to use it!
Steven Fackler
On Wed, Jul 16, 2014 at 5:16 PM, Ben Harris wrote:
> Have a quick skim over this (
> http://tomlee.co/2014/04/03/a-more-detailed-tour-of-the-rust-compiler/).
> Lint is the last thing to run before conversion to L
omment is just saying that if you *do* want to visit everything, you have
to manually check to make sure you're overriding everything.
Steven Fackler
On Wed, Jul 16, 2014 at 11:59 AM, Christoph Husse <
thesaint1...@googlemail.com> wrote:
> This comment from "syntax::visit::Vi
There's a fix for make install waiting on bors right now:
https://github.com/rust-lang/rust/pull/15550
Steven Fackler
On Wed, Jul 9, 2014 at 1:11 PM, Ben Gamari wrote:
> Brian Anderson writes:
>
> > Hi.
> >
> > Very soon now the way rustc links crates dynamic
tains a reference to the Database
instead.
Steven Fackler
On Tue, Jul 1, 2014 at 7:35 AM, David Brown wrote:
> Imagine a hypothetical database interface:
>
>struct Database { ... }
>struct Cursor<'a> {
>db: &'a Database,
>...
>
Yep!
main.rs:
mod foo;
mod bar;
fn main() {
foo::foo();
}
foo.rs:
use bar; // this use lets you refer to the bar fn as bar::bar() instead of
::bar::bar()
pub fn foo() {
bar::bar();
}
bar.rs:
pub fn bar() {}
Steven Fackler
On Sun, Jun 1, 2014 at 5:25 PM, Nicholas Bishop
wrote
foo/
mod.rs
bar/
mod.rs
The first configuration seems to be what most code uses. If bar ends up
having submodules of its own, it would need to move to the second setup.
Steven Fackler
On Sun, Jun 1, 2014 at 3:02 PM, Nicholas Bishop
wrote:
> Here's
It may not fulfill your exact use case, but you can get this in a way:
let mut foo = bar.iter().peekable();
{
let mut limit_foo = foo.by_ref().limit(50);
for baz in limit_foo {
...
}
}
if foo.is_empty() {
...
}
Steven Fackler
On Fri, May 30, 2014 at 9:51 AM, Evan G
A glob crate like this one?
https://github.com/mozilla/rust/blob/master/src/libglob/lib.rs
Steven Fackler
On Mon, May 26, 2014 at 6:57 PM, Daniel Fagnan wrote:
> Writing it here to gauge an interest of the community for a glob crate. If
> it seems people are liking the idea, I'll w
Type annotations are not there for the compiler; they're there for people
reading the code. If I want to use some function I don't want to be forced
to read the entire implementation to figure out what the lifetime of the
return value is.
Steven Fackler
On Thu, May 15, 2014 at 9:30
That will be possible, but the Index trait needs to be overhauled first.
Steven Fackler
On Sun, May 4, 2014 at 3:01 PM, Brian Rogoff wrote:
> On Sat, May 3, 2014 at 2:27 AM, Artella Coding <
> artella.cod...@googlemail.com> wrote:
>
>> Hi looking at https://github.com/r
that program compile. I'm not sure if it's already been run into
and filed.
Steven Fackler
On Fri, Apr 18, 2014 at 8:30 AM, Ziad Hatahet wrote:
> Confirm repro on an older rustc version. Ubuntu 13.10 running rustc
> 0.11-pre (ecc774f 2014-04-11 13:46:45 -0700).
>
>
>
You can use task::try(...).ok().unwrap() for Results with non-Show error
types.
Steven Fackler
On Thu, Apr 17, 2014 at 8:55 AM, Edward Wang wrote:
> It current can compile, but judging from signatures:
>
> std::task::try is pub fn try(f: proc(): Send -> T) -> Result ~Any:Send
You can do it like this:
impl MySerialization for T {
...
}
Steven Fackler
On Sat, Apr 5, 2014 at 12:57 PM, Frank Huang wrote:
> Hello everyone,
>
> I have a question about making "extension methods" on something like
> io::Writer. Basically, I have a data format th
println is a function in std::io that prints strings to standard out.
println! is a macro that allows for formatted output (e.g. println!("hello,
{}!", "world")). More details here:
http://static.rust-lang.org/doc/master/std/fmt/index.html
Steven Fackler
On Fri, Mar 14, 201
You can also use a nested pattern:
match reader.read(buf) {
Ok(cnt) => { /* stuff */ }
Err(IoError { kind: EndOfFile, .. } => { /* eof stuff */ }
Err(e) => return Err(e)
}
Steven Fackler
On Mon, Feb 3, 2014 at 10:32 PM, Alex Crichton wrote:
> I'd recommend one
The Zen of Python also says "There should be one-- and preferably only one
--obvious way to do it."
Steven Fackler
On Thu, Jan 30, 2014 at 11:35 AM, Donaldo Fastoso <
donquest...@rocketmail.com> wrote:
> I like python's rational of "consenting adults": Give
which is currently only used with `extern mod` statements but
could be extended to functions and whatever else:
#[phase(syntax)]
fn ctfe_function() -> int {
10
}
static FOO: int = ctfe_function();
Steven Fackler
On Wed, Jan 29, 2014 at 11:44 AM, Niko Matsakis wrote:
> On Tue, Jan 28
syntax
extensions aren't and it's unclear whether or not that's a good idea.
Steven Fackler
On Thu, Jan 23, 2014 at 8:32 PM, benjamin adamson <
adamson.benja...@gmail.com> wrote:
> Question, what constitutes whether a 'trait' is applicable for
> implementati
#[macro_export] exports macros from one crate to another (across an "extern
mod" boundary). It doesn't have any effect inside of the crate in which it
is defined.
Steven Fackler
On Sun, Jan 19, 2014 at 11:50 PM, Vladimir Matveev
wrote:
> I thought so :)
> By the way, is
Something like this should work:
pub fn cell_alive(&self, Row(row): Row, Column(column): Column) -> uint {
return match self.inner[row][column].value {
dead => 0,
alive => 1
};
}
Steven Fackler
On Sat, Jan 11, 2014 at 2:03 PM, benjamin adamson <
adamson.benja...@
There's an old open PR to optionally integrate with rust-ssl or rust-nss (
https://github.com/chris-morgan/rust-http/pull/31) but it'd need to be
updated.
Steven Fackler
On Sun, Dec 29, 2013 at 10:12 AM, Patrick Walton wrote:
> On 12/29/13 7:48 AM, Erick Tryzelaar wrote:
>
&
ic API would be nice just to push the APIs of different SQL client
libraries closer together.
Someone could absolutely take the interface used by rust-postgres and make
a MySQL/MariaDB driver with it, but that person wouldn't be me :)
Steven Fackler
On Wed, Dec 11, 2013 at 7:15 AM, Gaetan
ts of Base64, you'll need to use a custom config struct.
Steven Fackler
On Mon, Nov 11, 2013 at 5:23 PM, Brendan Zabarauskas wrote:
> On 12 Nov 2013, at 10:12 am, John Clements
> wrote:
>
> > If you had the energy to build an alternate front-end using a
> parenthesized syntax,
If T is a trait, its trait objects ~T, @T and &T do not implement T. There
is an implementation of Writer for @Writer, but not for ~Writer or &Writer
which is why you're seeing that error.
Steven Fackler
On Fri, Oct 18, 2013 at 11:27 PM, Oren Ben-Kiki wrote:
> Ugh, I was too
py
it into a new ~str. In the IO case, you could keep this cost free to
implement by having `Reader` contain a default implementation for `read`
and only require users to implement `try_read`. See
http://docs.octayn.net/postgres/struct.PostgresConnection.html for some
examples.
Steven Fackler
O
oo.baz would point to deallocated memory if we replace self.bar or
self.bar.baz.
Steven Fackler
On Sun, Sep 29, 2013 at 3:15 PM, Tim Kuehn wrote:
> Could you use struct methods for "quick access"? Or is there a reason this
> wouldn't fit your use case? Sorry, I haven
33 matches
Mail list logo