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 upType inference ICE: `assertion failed: !self.obligations_in_snapshot.get()` #36053
Comments
apasel422
added
the
I-ICE
label
Aug 27, 2016
This comment has been minimized.
This comment has been minimized.
|
What Rust version is that? Can't reproduce on the Playpen |
This comment has been minimized.
This comment has been minimized.
|
linux, x86_64, rustc 1.13.0-nightly (e9bc1ba 2016-08-24) |
This comment has been minimized.
This comment has been minimized.
|
Same on 1.13.0-nightly (1987131 2016-08-26) |
This comment has been minimized.
This comment has been minimized.
|
Also happens on http://play.integer32.com/ |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Note: This was is probably related to specialization. It's definitely not at all related to #35656, I don't even know why you would suggest that. Any suggestion that uncommenting the commented line below is at all related to this problem will be met with derision: #![feature(fused)]
use std::iter::FusedIterator;
struct Thing<'a>(&'a str);
impl<'a> Iterator for Thing<'a> {
type Item = &'a str;
fn next(&mut self) -> Option<&'a str> {
None
}
}
//impl<'a> FusedIterator for Thing<'a> {}
fn main() {
Thing("test").fuse().filter(|_| true).count();
}/cc @alexcrichton @aturon |
This comment has been minimized.
This comment has been minimized.
|
triage: P-high Regression, seems bad. @arielb1 says he'll take a look at it. |
rust-highfive
added
P-high
and removed
I-nominated
labels
Sep 1, 2016
nikomatsakis
assigned
arielb1
Sep 1, 2016
This comment has been minimized.
This comment has been minimized.
|
The problem is that |
nikomatsakis
self-assigned this
Sep 13, 2016
This comment has been minimized.
This comment has been minimized.
|
I'll try to gin up a patch, since I think @arielb1 is busy. |
This comment has been minimized.
This comment has been minimized.
|
@arielb1 do you agree that this is basically a "false positive" of the problem that this check was designed to prevent? |
This comment has been minimized.
This comment has been minimized.
|
(and hence an ok fix is just to save/restore the flag?) |
This comment has been minimized.
This comment has been minimized.
|
maybe a better fix is to have fulfillment cx be parameterized by whether to set the flag |
Stebalien commentedAug 27, 2016
•
edited
Type inference is barfing on:
This only happens to iterators over
types with lifetime parameters and only happens when fused, mapped or filtered, than "operated" on (e.g., counted).&strsThe following works:
Trace: