Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upimpl Error for ! #35715
Conversation
rust-highfive
assigned
alexcrichton
Aug 16, 2016
This comment has been minimized.
This comment has been minimized.
|
(rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@bors r- Travis results in "Aborted (core dumped)" while running std tests. |
This comment has been minimized.
This comment has been minimized.
|
Not sure what's causing this. The test which is aborting is here. It aborts at the very start of the spawned thread. Specifically, I can see execution get to I'm guessing the problem has something to do with the closure returning Can anyone suggest a good next step for debugging this? I'd like to know why it starts unwinding to begin with. |
This comment has been minimized.
This comment has been minimized.
|
I suspect that's bad but not this PR bad, let's see what bors has to say: @bors: r+ |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Aug 18, 2016
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Damn. I dunno what to make of that log though, both the panics that it mentions at the bottom are panics that were supposed to occur. |
This comment has been minimized.
This comment has been minimized.
|
Hm that failed at about the same location as travis, so maybe not spurious? |
This comment has been minimized.
This comment has been minimized.
|
Yeah I'd say it's getting to this test again and aborting. Any idea why? Is there any reason why a closure would start panicking as soon as it's called? |
This comment has been minimized.
This comment has been minimized.
|
Maybe? Not sure. Best next option is likely to reproduce locally so we're not just poking in the dark. |
This comment has been minimized.
This comment has been minimized.
|
Is there an easy way to get the make system to spit out MIR and LLVM code for the libstd tests? I don't know how to reproduce this locally. By the way, it is caused by |
This comment has been minimized.
This comment has been minimized.
|
LLVM IR can be emitted with |
This comment has been minimized.
This comment has been minimized.
|
MIR is |
This comment has been minimized.
This comment has been minimized.
|
I just had another look at this. It looks like it crashes here when it tries to use |
canndrew
force-pushed the
canndrew:never-impl-error
branch
from
7df8271
to
1eadb38
Oct 6, 2016
This comment has been minimized.
This comment has been minimized.
|
Here's how I fixed this: In the old code, let r: R = mem::uninitialized();Later, it either reads the value out of When union MaybeUninitialized<R> {
data: R,
_uninitialized: (),
}
let r: MaybeUninitialized<R> = mem::uninitialized();This is fine since a However this does raise a problem: until now we've always just assumed that |
This comment has been minimized.
This comment has been minimized.
|
Hm in theory we shouldn't have to change the code for something like this, doesn't that mean a bug in the compiler? |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton Sadly, no. Unsafe code everywhere using closures can have subtle dependencies on the closures returning an inhabited type, before the closure has a chance to stop the control-flow. |
This comment has been minimized.
This comment has been minimized.
|
I didn't even have to use Edit: Thinking about this a little more I can't see any situation where it would be better to use |
This comment has been minimized.
This comment has been minimized.
|
An alternative would be to change the way divergence works for |
This comment has been minimized.
This comment has been minimized.
|
@eddyb it seems... bad though if we add |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton Yeah it's not ideal, we'll have to discuss it. @rust-lang/lang is probably more appropriate. EDIT: tagged both for good measure. |
eddyb
added
I-nominated
T-lang
labels
Oct 6, 2016
eddyb
added
the
T-compiler
label
Oct 6, 2016
This comment has been minimized.
This comment has been minimized.
|
One way to avoid an audit would be to put a It's a pretty fundamental problem though. Functions that return an uninhabited type don't return at all. Except This doesn't just effect |
aturon
removed
the
I-nominated
label
Oct 13, 2016
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Ok, I'm going to close this for now in favor of that internals thread (in the interest of clearing out the queue), but we can certainly reopen/resubmit once that's handled! |
canndrew commentedAug 16, 2016
impl Error for ! { ... }