These are chat archives for rust-lang/rust

23rd
Aug 2017
Restioson
@Restioson
Aug 23 2017 04:42
@omni-viral cool, don't mind that
Restioson
@Restioson
Aug 23 2017 10:25
And expression returns? Does that return the function or the block
If the block is last does it matter?
Zakarum
@omni-viral
Aug 23 2017 10:25
return always returns from function
Restioson
@Restioson
Aug 23 2017 10:26
I don't really care as long as I can match a block with returns using the macro block match
About expression thing
Oh does it, nice
That makes it easier... And expression returns?
Zakarum
@omni-viral
Aug 23 2017 10:26
always
lemonxah
@lemonxah
Aug 23 2017 10:30
any rustconf vids up somewhere?
Restioson
@Restioson
Aug 23 2017 10:33
@omni-viral I don't mean return as in return
Like fn three() -> u8 { 3u8}
Zakarum
@omni-viral
Aug 23 2017 10:34
Ah. You mean like this?
fn foo() {
    let x = {
        let y = bar();
        y.x
    };
}
Here x gets value of y.x
And y is dropped before end of the block
Restioson
@Restioson
Aug 23 2017 10:37
If you didn't have the let would foo return the return of the block?
Zakarum
@omni-viral
Aug 23 2017 10:37
I think so
Restioson
@Restioson
Aug 23 2017 10:37
Sry on phone, can't really type code
Cool, cool...
Zakarum
@omni-viral
Aug 23 2017 10:38
As block evaluates in whatever evaluates its last expression
Restioson
@Restioson
Aug 23 2017 10:38
Writing a macro which will use block matching
To create certain wrapped functions
lemonxah
@lemonxah
Aug 23 2017 10:38
the last expression is the ; wouldn't that be unit then?
Restioson
@Restioson
Aug 23 2017 10:39
If without that
Zakarum
@omni-viral
Aug 23 2017 10:39
@lemonxah if expression have ; at the end it evaluates in ()
lemonxah
@lemonxah
Aug 23 2017 10:39
yes that is what i meant
Zakarum
@omni-viral
Aug 23 2017 10:40
It is general rule and works in blocks as usual
Nikolay Denev
@ndenev
Aug 23 2017 13:44
Hi! Can anyone recommend a good gossip protocol library? On crates.io I see only crust, but that's GPL-3.0 and I would like to avoid it.
Michal 'vorner' Vaner
@vorner
Aug 23 2017 14:29
Hello. I'm trying to build the compiler and install it inside my home. I tried both editing config.toml by hand and running ./configure. I tried both ./x.py install and make install. I either get an error it wants to write somewhere outside of my home or only the std installed, but not the compiler itself. Am I doing something obviously wrong?
Zakarum
@omni-viral
Aug 23 2017 14:59
Why Any + Send + Sync doesn't has same methods as Any?
While Any + Send has them
Being have to manually cast &(Any + Send + Sync) to &Any in order to call downcast_ref isn't very convenient
Restioson
@Restioson
Aug 23 2017 15:06
@vorner did you x.py build first?
Michal 'vorner' Vaner
@vorner
Aug 23 2017 15:31
Yes. And it seems to make no difference (the build is being run as a dependency in install anyway).
I'm trying the full bootstrap option now
Zakarum
@omni-viral
Aug 23 2017 19:15
Ho to convert Vec<[T;N]> to Vec<T> without cloning?
Michal 'vorner' Vaner
@vorner
Aug 23 2017 19:19
I think you could do something with into_raw_parts, mem::transmute and from_raw_parts