These are chat archives for rust-lang/rust

26th
Oct 2017
Daniel Lin
@power10dan
Oct 26 2017 04:29
hi guys, so while building rust compiler using python x.py test,
i got the following error:
error: Could not create incremental compilation crate directory tmp/partitioning-tests/statics/statics-2274d9nt8ooh9: Permission denied (os error 13)
the error message told me that this is a bug, and I should reported, but I am a little suspicious whether this is a bug or it's just my system
so I decided to ask here. Any suggestions?
Daniel Lin
@power10dan
Oct 26 2017 04:48
I got it fixed, have to change the permission of tmp folder
Abhay Bothra
@bothra90
Oct 26 2017 06:21
I'm trying out something with example an from the Rust book, ch-15 on Smart Pointers and need some help in debugging a compilation failure. Please see: https://play.rust-lang.org/?gist=60371bbd648e95e06c7dd0405c2a3fcd&version=stable
Jonas Platte
@jplatte
Oct 26 2017 06:41
@bothra90 Your commented out code works though...
Maybe you have a different version of Rust locally?
Abhay Bothra
@bothra90
Oct 26 2017 06:42
@jplatte : actually, if you comment the last 3 lines // But this is OK. // let x = branch.parent.borrow().upgrade(); // if let None = x { // println!("I am here"); // }, you will see the error I'm referring to
Jonas Platte
@jplatte
Oct 26 2017 06:43
Okay, that is pretty weird...
Abhay Bothra
@bothra90
Oct 26 2017 06:44
Adding a simple println!("foo"); after the if let also allows the code to pass the borrow checker.
Jonas Platte
@jplatte
Oct 26 2017 06:46
Yeah or drop(branch);
This seems like a bug to me
Abhay Bothra
@bothra90
Oct 26 2017 06:46
I've filed rust-lang/rust#45546
Jonas Platte
@jplatte
Oct 26 2017 06:47
Unfortunately, the playground doesn't let you choose an older version to see whether this is a regression
But beta and stable do the same thing
very strange..
Abhay Bothra
@bothra90
Oct 26 2017 06:49
Alright @jplatte, thanks for confirming that this is indeed suspicious behavior. Will wait for one of core team devs to look into it.
Alexander Larin
@scalar438
Oct 26 2017 07:09
What is if let None? I thought that enum variants without variables in if let are not allowed
But I agree - behavior is very strange :)
Jonas Platte
@jplatte
Oct 26 2017 07:10
@scalar438 Why shouldn't they be allowed?
I guess it's more common to use is_none() in cases like this, but if let None works too.
Marcel
@marcelbuesing
Oct 26 2017 13:12
@jplatte thank you, I tried the for<T> Stream<Item = T, Error = ...> I get an error saying that T must be a lifetime specifier. It worked for me like this:
impl<S1, S2, T1: Clone, T2: Clone> Stream for ZipLatest<S1, S2>
where
    S1: Stream<Item = T1>,
    S2: Stream<Item = T2, Error = S1::Error>,
\\ ...
Jonas Platte
@jplatte
Oct 26 2017 14:36
@marcelbuesing That is what I meant. You just didn't provide enough details about what the code around your stream bound looked like so I just wrote for<T> instead of impl<T> or fn<T>.
Sorry if that confused you ^^°
Nikita
@nikita-y
Oct 26 2017 15:52
@scalar438 if let None = x is legit we can rewrite it like if let Some(_) = x {...} else {...}
Nikita
@nikita-y
Oct 26 2017 16:16
@bothra90 I think that the compiler expects to see a binding. That's why in if let Some(_) = x we use _ if we don't need the value.
Ravi Teja
@tekjar
Oct 26 2017 18:24
Hi. Is crossbeam included in libblitz?
Ok. Doesn't seem so