Closed
Description
rustc version:
$ rustc --version --verbose
rustc 1.27.0-nightly (fb44b4c0e 2018-04-04)
binary: rustc
commit-hash: fb44b4c0eb1d344f84f7bb2c90f28e31a8a180be
commit-date: 2018-04-04
host: x86_64-unknown-linux-gnu
release: 1.27.0-nightly
LLVM version: 6.0
code:
fn main() {
let _ =
Some(())
.into_iter()
.flat_map(|_| {
Some(())
.into_iter()
.flat_map(func)
});
}
fn func(_: ()) -> impl Iterator<Item=()> {
Some(()).into_iter().flat_map(|_| vec![])
}
error message:
~/rust/ice $ RUST_BACKTRACE=1 rustc test.rs
error: internal compiler error: librustc_traits/normalize_erasing_regions.rs:46: could not fully normalize `std::iter::FlattenCompat<std::iter::Map<std::option::IntoIter<()>, [[email protected]:5:19: 9:10]>, <std::iter::FlatMap<std::option::IntoIter<()>, std::iter::FlatMap<std::option::IntoIter<()>, std::vec::Vec<()>, [[email protected]:13:35: 13:45]>, fn(()) -> impl std::iter::Iterator {func}> as std::iter::IntoIterator>::IntoIter>`
thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:543:9
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::print
at libstd/sys_common/backtrace.rs:71
at libstd/sys_common/backtrace.rs:59
2: std::panicking::default_hook::{{closure}}
at libstd/panicking.rs:207
3: std::panicking::default_hook
at libstd/panicking.rs:223
4: core::ops::function::Fn::call
5: std::panicking::rust_panic_with_hook
at libstd/panicking.rs:403
6: std::panicking::begin_panic
7: rustc_errors::Handler::bug
8: rustc::session::opt_span_bug_fmt::{{closure}}
9: rustc::ty::context::tls::with_opt::{{closure}}
10: <std::thread::local::LocalKey<T>>::try_with
11: <std::thread::local::LocalKey<T>>::with
12: rustc::ty::context::tls::with
13: rustc::ty::context::tls::with_opt
14: rustc::session::opt_span_bug_fmt
15: rustc::session::bug_fmt
16: rustc::ty::context::tls::enter
17: rustc_traits::normalize_erasing_regions::normalize_ty_after_erasing_regions
18: rustc::ty::maps::<impl rustc::ty::maps::queries::normalize_ty_after_erasing_regions<'tcx>>::compute_result
19: rustc::dep_graph::graph::DepGraph::with_task_impl
20: rustc_errors::Handler::track_diagnostics
21: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
22: rustc::ty::maps::<impl rustc::ty::maps::queries::normalize_ty_after_erasing_regions<'tcx>>::force
23: rustc::ty::maps::<impl rustc::ty::maps::queries::normalize_ty_after_erasing_regions<'tcx>>::try_get
24: rustc::ty::maps::TyCtxtAt::normalize_ty_after_erasing_regions
25: <rustc::traits::query::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder<'cx, 'tcx> as rustc::ty::fold::TypeFolder<'tcx, 'tcx>>::fold_ty
26: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &'a mut F>::call_once
27: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter
28: <rustc_mir::util::elaborate_drops::DropCtxt<'l, 'b, 'tcx, D>>::elaborate_drop
29: rustc_mir::shim::make_shim
30: rustc::ty::maps::<impl rustc::ty::maps::queries::mir_shims<'tcx>>::compute_result
31: rustc::dep_graph::graph::DepGraph::with_task_impl
32: rustc_errors::Handler::track_diagnostics
33: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
34: rustc::ty::maps::<impl rustc::ty::maps::queries::mir_shims<'tcx>>::force
35: rustc::ty::maps::<impl rustc::ty::maps::queries::mir_shims<'tcx>>::try_get
36: rustc::ty::maps::TyCtxtAt::mir_shims
37: rustc::ty::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::instance_mir
38: rustc_mir::monomorphize::collector::collect_items_rec
39: rustc_mir::monomorphize::collector::collect_items_rec
40: rustc_mir::monomorphize::collector::collect_crate_mono_items
41: rustc::util::common::time
42: rustc_trans::base::collect_and_partition_translation_items
43: rustc::dep_graph::graph::DepGraph::with_task_impl
44: rustc_errors::Handler::track_diagnostics
45: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
46: rustc::ty::maps::<impl rustc::ty::maps::queries::collect_and_partition_translation_items<'tcx>>::force
47: rustc::ty::maps::<impl rustc::ty::maps::queries::collect_and_partition_translation_items<'tcx>>::try_get
48: rustc::ty::maps::TyCtxtAt::collect_and_partition_translation_items
49: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::collect_and_partition_translation_items
50: rustc_trans::base::trans_crate
51: <rustc_trans::LlvmTransCrate as rustc_trans_utils::trans_crate::TransCrate>::trans_crate
52: rustc::util::common::time
53: rustc_driver::driver::phase_4_translate_to_llvm
54: rustc_driver::driver::compile_input::{{closure}}
55: <std::thread::local::LocalKey<T>>::with
56: <std::thread::local::LocalKey<T>>::with
57: rustc::ty::context::TyCtxt::create_and_enter
58: rustc_driver::driver::compile_input
59: rustc_driver::run_compiler_impl
60: syntax::with_globals
61: rustc_driver::run
62: rustc_driver::main
63: std::rt::lang_start::{{closure}}
64: std::panicking::try::do_call
at libstd/rt.rs:59
at libstd/panicking.rs:306
65: __rust_maybe_catch_panic
at libpanic_unwind/lib.rs:102
66: std::rt::lang_start_internal
at libstd/panicking.rs:285
at libstd/panic.rs:361
at libstd/rt.rs:58
67: main
68: __libc_start_main
69: <unknown>
error: aborting due to previous error
Metadata
Metadata
Assignees
Labels
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Category: This is a bug.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️High priorityRelevant to the compiler team, which will review and decide on the PR/issue.Performance or correctness regression from stable to beta.