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 up[regression] rustc panic on nightly (0667ae9 2016-05-17): Encountered errors `[FulfillmentError(Obligation(predicate=Binder(TraitPredicate #33723
Comments
sanxiyn
added
the
I-ICE
label
May 20, 2016
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@xen0n
That's odd. Could you post a backtrace ( |
This comment has been minimized.
This comment has been minimized.
|
@arielb1 It's like this on latest nightly (179539f), zetok/tox@8c63279:
|
This comment has been minimized.
This comment has been minimized.
|
The same backtrace with my debug build:
|
This comment has been minimized.
This comment has been minimized.
|
… Now this crap also breaks beta builds and is getting stabilized? WTF? |
steveklabnik
added
the
regression-from-stable-to-beta
label
Jun 13, 2016
This comment has been minimized.
This comment has been minimized.
|
Triage: it appears this is a stable-to-beta regression, so tagging. |
brson
added
I-nominated
T-compiler
A-compiler
labels
Jun 23, 2016
This comment has been minimized.
This comment has been minimized.
|
cc @michaelwoerister related to the item collector? @rust-lang/compiler This is a pretty ugly regression that is going to hit stable very soon. Can you consider it? |
This comment has been minimized.
This comment has been minimized.
|
If we don't manage fix the bug in time, we can turn off item collection for the next stable release. The results of the collector are only used for auto-tests so far. |
This comment has been minimized.
This comment has been minimized.
|
assigning to self to reduce to test case (and maybe fix) |
pnkfelix
self-assigned this
Jun 23, 2016
pnkfelix
added
P-high
and removed
I-nominated
labels
Jun 23, 2016
This comment has been minimized.
This comment has been minimized.
|
Okay, I reduced the problem down to this relatively simple regression "standalone" test against the extern crate quickcheck;
#[test]
fn send_nodes_to_bytes_test() {
use self::quickcheck::{Arbitrary, Gen, quickcheck};
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
struct PackedNode;
/// Valid, random PackedNode.
impl Arbitrary for PackedNode {
fn arbitrary<G: Gen>(_: &mut G) -> Self { unimplemented!() }
}
fn with_nodes(_: PackedNode, _: Option<PackedNode>) { unimplemented!() }
quickcheck(with_nodes as fn(PackedNode, Option<PackedNode>));
}A semi-interesting details is that I seem to have to use a I'm going to shift now to the |
This comment has been minimized.
This comment has been minimized.
|
Here is a standalone file that causes the ICE on a nightly // Heavily reduced version of `quickcheck` with an `fn main`that ICE's the compiler.
//
// This is for issue #33723.
pub trait Arbitrary : Clone + 'static {
fn arbitrary<G>() -> Self { unimplemented! () }
fn shrink(&self) -> Box<Iterator<Item=Self>> { unimplemented!() }
}
impl<A: Arbitrary> Arbitrary for Option<A> { }
impl<A: Arbitrary> Arbitrary for (A,)
{
fn shrink(&self) -> Box<Iterator<Item=(A,)>> {
let (ref a, ) = *self;
let srest = a
.shrink()
.scan((), |_, _| unimplemented!());
Box::new(srest)
}
}
impl<A: Arbitrary, B: Arbitrary> Arbitrary for (A, B,)
{
fn shrink(&self) -> Box<Iterator<Item=(A, B)>> {
let (ref a, ref b) = *self;
let srest = (b.clone(),)
.shrink()
.scan(a.clone(), |_, _| unimplemented!());
Box::new(srest)
}
}
pub fn quickcheck<A: Testable>(f: A) {
f.result::<A>();
}
pub trait Testable : Send + 'static {
fn result<G>(&self) { unimplemented!() }
}
impl Testable for () { }
impl<T: Testable, A: Arbitrary, B: Arbitrary> Testable for fn(A, B) -> T
{
fn result<G_>(&self) {
let a: (A, B) = Arbitrary::arbitrary::<G_>();
a.shrink();
}
}
#[derive(Clone, Debug)]
struct PackedNode;
impl Arbitrary for PackedNode { }
fn main() {
fn with_nodes(_: PackedNode, _: Option<PackedNode>) { unimplemented!() }
quickcheck(with_nodes as fn(PackedNode, Option<PackedNode>));
}I'm going to open a fresh issue with this specific test case, so that we can focus on the discussion of how to resolve this without having to scroll through the stack-traces in the thread here. |
pnkfelix
referenced this issue
Jun 27, 2016
Closed
fulfillment error involving quickcheck `Testable` trait on `fn` types (and tuples?) #34503
This comment has been minimized.
This comment has been minimized.
|
While writing up #34503 and looking more carefully at the actual reported error, it seems like the problem here is that the compiler is erroneously requiring that the struct in question implement the
To be clear: There is no proper reason for the compiler to be requiring both of those traits in the case in question. But, I tried adding the following (completely fake) impl ::std::cmp::PartialOrd for PackedNode {
fn partial_cmp(&self, _: &Self) -> Option<::std::cmp::Ordering> {
unimplemented!()
}
}@zetok I am hoping we will fix the compiler bug in the meantime (and I will make sure #34503 stays open until it is fixed), but you may want to put a work-around like the above into your code in the meantime. |
This comment has been minimized.
This comment has been minimized.
I would prefer to not work around compiler bugs. As @michaelwoerister stated above, if it can't be fixed in time for release, it can be turned off. |
This comment has been minimized.
This comment has been minimized.
|
cc @pnkfelix @rust-lang/compiler There's a release next week. Is there any hope of fixing this? |
zetok commentedMay 18, 2016
https://travis-ci.org/zetok/tox/jobs/131140755#L843 ← fails on 1.10.0-nightly (0667ae9 2016-05-17)
https://travis-ci.org/zetok/tox/jobs/131120373 ← worked on the previous build(s) – 1.10.0-nightly (cd6a400 2016-05-16)
Newest nightly fails to compile something that compiled just fine for ~weeks across all Rust channels.
Fails also on osx builds.