-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eliding lifetimes in impl trait leads to a compiler panic #39553
Comments
frewsxcv
added
the
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
label
Feb 6, 2017
No longer ICEs today. E-needstest. |
Mark-Simulacrum
added
the
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
label
May 20, 2017
@Mark-Simulacrum, the example attached in duplicate issue #39929 is stilling ICEing. https://is.gd/yWRQML |
I'll reopen that one then since it apparently was not a duplicate. |
It still ICEs on nightly. $ git diff
diff --git a/src/memory.rs b/src/memory.rs
index 09529ab..0eb0aa2 100644
--- a/src/memory.rs
+++ b/src/memory.rs
@@ -558,7 +558,7 @@ impl Dictionary {
prototype.get_key(freq_range, detectors)
}
- pub fn iter<'b>(&'b self) -> impl Iterator<Item=(&'b FragmentKey, &'b Box<Fragment>)> {
+ pub fn iter(&self) -> impl Iterator<Item=(&FragmentKey, &Box<Fragment>)> {
self.map.iter()
}
$ cargo +nightly build
Compiling cortex v0.1.0 (file:///tmp/cortex)
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
thread 'rustc' panicked at 'assertion failed: match *region { ty::ReLateBound(..) => false, _ => true, }', /checkout/src/librustc/infer/higher_ranked/mod.rs:493
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: Could not compile `cortex`.
To learn more, run the command again with --verbose.
$ rustup run nightly rustc --version --verbose
rustc 1.19.0-nightly (5b13bff52 2017-05-23)
binary: rustc
commit-hash: 5b13bff5203c1bdc6ac6dc87f69b5359a9503078
commit-date: 2017-05-23
host: x86_64-unknown-linux-gnu
release: 1.19.0-nightly
LLVM version: 4.0 |
Mark-Simulacrum
removed
the
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
label
Jun 18, 2017
Minimal test case (possibly also above, but I found it hard to find last time I triaged..) #![feature(conservative_impl_trait)]
pub fn iter(x: &usize) -> impl Iterator<Item=(&i32, &Box<i32>)> {
unimplemented!()
}
fn main() {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My code contained the following method:
Clippy suggested me that lifetime specifiers are redundant here and they may be elided completely. So I simplified the code like this:
But when it tried to rebuild the project, compiler crashed:
The text was updated successfully, but these errors were encountered: