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 returning an unknown type with impl FnMut #54966

Closed
SephVelut opened this issue Oct 10, 2018 · 1 comment
Closed

ICE returning an unknown type with impl FnMut #54966

SephVelut opened this issue Oct 10, 2018 · 1 comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@SephVelut
Copy link

SephVelut commented Oct 10, 2018

fn generate_duration() -> Oper<impl FnMut()> {
        
}

I expected just a compiler error cannot find type Oper. Compiler panicked:

error[E0412]: cannot find type `Oper` in this scope
 --> src/lib.rs:1:27
  |
1 | fn generate_duration() -> Oper<impl FnMut()> {
  |                           ^^^^ not found in this scope

thread 'main' panicked at 'no entry found for key', libcore/option.rs:989:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::continue_panic_fmt
   7: rust_begin_unwind
   8: core::panicking::panic_fmt
   9: core::option::expect_failed
  10: rustc_typeck::collect::type_of
  11: rustc::ty::query::__query_compute::type_of
  12: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::type_of<'tcx>>::compute
  13: rustc::ty::context::tls::with_context
  14: rustc::dep_graph::graph::DepGraph::with_task_impl
  15: rustc::ty::context::tls::with_related_context
  16: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  17: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  18: rustc::ty::query::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::type_of
  19: rustc_typeck::check::check_item_type
  20: rustc::hir::Crate::visit_all_item_likes
  21: rustc_typeck::check::check_item_types
  22: rustc::util::common::time
  23: rustc_typeck::check_crate
  24: rustc::ty::context::tls::enter_context
  25: <std::thread::local::LocalKey<T>>::with
  26: rustc::ty::context::TyCtxt::create_and_enter
  27: rustc_driver::driver::compile_input
  28: rustc_driver::run_compiler_with_pool
  29: <scoped_tls::ScopedKey<T>>::set
  30: <scoped_tls::ScopedKey<T>>::set
  31: syntax::with_globals
  32: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  33: __rust_maybe_catch_panic
  34: rustc_driver::run
  35: rustc_driver::main
  36: std::rt::lang_start::{{closure}}
  37: std::panicking::try::do_call
  38: __rust_maybe_catch_panic
  39: std::rt::lang_start_internal
  40: main
query stack during panic:
#0 [type_of] processing `generate_duration::{{impl-Trait}}`
end of query stack
error: aborting due to previous error

For more information about this error, try `rustc --explain E0412`.

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

note: rustc 1.29.1 (b801ae664 2018-09-20) running on x86_64-apple-darwin

note: compiler flags: -C debuginfo=2 -C incremental --crate-type lib

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `syn`.

Meta

rustc 1.29.1 (b801ae664 2018-09-20)
binary: rustc
commit-hash: b801ae66425cf7c3c71052b19ef8f145b0d0513d
commit-date: 2018-09-20
host: x86_64-apple-darwin
release: 1.29.1
LLVM version: 7.0
@SephVelut SephVelut changed the title ICE returning an impl Clone + FnMut ICE returning an unknown type with impl FnMut Oct 10, 2018
@varkor
Copy link
Member

varkor commented Oct 10, 2018

This is fixed in the beta version (1.30).

@estebank estebank added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. labels Oct 10, 2018
memoryruins added a commit to memoryruins/rust that referenced this issue Oct 12, 2018
bors added a commit that referenced this issue Oct 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants