Skip to content
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

[ICE] with mir-opt-level=2 in traits\codegen\mod.rs #77911

Closed
leonardo-m opened this issue Oct 13, 2020 · 3 comments · Fixed by #78133
Closed

[ICE] with mir-opt-level=2 in traits\codegen\mod.rs #77911

leonardo-m opened this issue Oct 13, 2020 · 3 comments · Fixed by #78133
Labels
A-mir-opt Area: MIR optimizations C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@leonardo-m
Copy link

use std::io::{BufRead, BufReader};
use std::fs::File;
fn file_lines() -> impl Iterator<Item=String> {
    BufReader::new(File::open("data.txt").unwrap()).lines().map(Result::unwrap)
}
fn main() {
    for _ in file_lines() {}
}

Compiling with rustc -Z mir-opt-level=2 test.rs I get since two nightlies:

error: internal compiler error: Encountered error `Unimplemented` selecting `Binder(<impl std::iter::Iterator as std::iter::Iterator>)` during codegen
  |
  = note: delayed at compiler\rustc_trait_selection\src\traits\codegen\mod.rs:65:32

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler\rustc_errors\src\lib.rs:961:13
stack backtrace:
   0: rust_begin_unwind
             at /rustc/c71248b70870960af9993de4f31d3cba9bbce7e8\/library\std\src/panicking.rs:483:5
   1: std::panicking::begin_panic_fmt
             at /rustc/c71248b70870960af9993de4f31d3cba9bbce7e8\/library\std\src/panicking.rs:437:5
   2: rustc_errors::HandlerInner::flush_delayed
   3: <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop
   4: core::ptr::drop_in_place
   5: <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop
   6: core::ptr::drop_in_place
   7: rustc_span::with_source_map
   8: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.49.0-nightly (c71248b70 2020-10-11) running on x86_64-pc-windows-gnu

note: compiler flags: -Z mir-opt-level=2

query stack during panic:
end of query stack
@leonardo-m leonardo-m added the C-bug Category: This is a bug. label Oct 13, 2020
@jonas-schievink jonas-schievink added A-mir-opt Area: MIR optimizations I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 13, 2020
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Oct 14, 2020
@JohnTitor
Copy link
Member

Triage: It's now compiled fine with the latest nightly, I think it's fixed by #77306.

@JohnTitor JohnTitor added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Oct 19, 2020
@leonardo-m
Copy link
Author

It works now, thank you.

@JohnTitor
Copy link
Member

This should be open until the test is added.

@JohnTitor JohnTitor reopened this Oct 19, 2020
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Oct 20, 2020
Add some MIR-related regression tests

Closes rust-lang#68841
Closes rust-lang#75053
Closes rust-lang#76375
Closes rust-lang#77911

I think they're fixed by rust-lang#77306.
@bors bors closed this as completed in a8a424f Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mir-opt Area: MIR optimizations C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants