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

test: failure in infer #18909

Closed
wants to merge 1 commit into from
Closed

test: failure in infer #18909

wants to merge 1 commit into from

Conversation

richo
Copy link
Contributor

@richo richo commented Nov 12, 2014

Regression test for an ICE. This is the smallest test case I could repro with.

(It still panics without the match, but the run-pass test wouldn't pass when it's fixed)

task 'rustc' panicked at 'assertion failed: !ty::type_needs_infer(ty)', /Users/richo/code/ext/rust/src/librustc/middle/typeck/mod.rs:287

stack backtrace:
   1:        0x112381a2f - rt::backtrace::imp::write::h3cada5b84f89fbe66mt
   2:        0x112384bb7 - failure::on_fail::hefa905209ce455fcVDt
   3:        0x112602cb5 - unwind::begin_unwind_inner::hd39f16915ccee7d1j1c
   4:        0x10f07ad7c - unwind::begin_unwind::h8713304023686688726
   5:        0x10f534b12 - middle::typeck::write_ty_to_tcx::hee84591aa553710dV8o
   6:        0x10f532003 - middle::typeck::check::writeback::WritebackCx<'cx, 'tcx>::visit_node_id::hdc27417171fe85120LO
   7:        0x10f52f6bd - middle::typeck::check::writeback::WritebackCx<'cx, 'tcx>.Visitor<'v>::visit_expr::h4ede99bcea8c72220AO
   8:        0x10f52f90b - middle::typeck::check::writeback::WritebackCx<'cx, 'tcx>.Visitor<'v>::visit_expr::h4ede99bcea8c72220AO
   9:        0x10f534057 - visit::walk_block::h15487588812085133261
  10:        0x10f530eb9 - middle::typeck::check::writeback::resolve_type_vars_in_fn::he9911200a7aceb616vO
  11:        0x10f584e3a - middle::typeck::check::check_bare_fn::h8f531b6690a1add9p5V
  12:        0x10f580f7d - middle::typeck::check::check_item::h7a25d3594f0d3906ypW
  13:        0x10f584c50 - middle::typeck::check::check_item_types::h7ccfbf35ece3b808z4V
  14:        0x10f096566 - util::common::time::h6828651919031589828
  15:        0x10f88f97e - middle::typeck::check_crate::hb629f897f68c14d7rrp
  16:        0x10f8f66e1 - driver::driver::phase_3_run_analysis_passes::h6ad8a93237fb4f5ctaC
  17:        0x10f8f1538 - driver::driver::compile_input::h8bb423d5b9daff3aeRB
  18:        0x10f96ea1d - driver::run_compiler::hc37ae4f2706fc942vHF
  19:        0x10f96cf5e - driver::run::closure.146204
  20:        0x10f0ae81b - task::TaskBuilder<S>::try_future::closure.104764
  21:        0x10f0ae713 - task::TaskBuilder<S>::spawn_internal::closure.104735
  22:        0x10f06f7dd - task::NativeSpawner.Spawner::spawn::closure.2551
  23:        0x112663bac - rust_try_inner
  24:        0x112663b96 - rust_try
  25:        0x112600487 - unwind::try::h7139a84d1900eb6d1Pc
  26:        0x11260031c - task::Task::run::h9971b53b16560a2b61b
  27:        0x10f06f603 - task::NativeSpawner.Spawner::spawn::closure.2475
  28:        0x112601b47 - thread::thread_start::h8caac61a203a88313mc
  29:     0x7fff90f5c2fc - _pthread_body
  30:     0x7fff90f5c279 - _pthread_body

@richo
Copy link
Contributor Author

richo commented Nov 12, 2014

This appears to expose a deeper bug, that the borrow checker behaves differently in the case of the Option closure than not. Do I assume this is fallout from unboxed closures?

@alexcrichton
Copy link
Member

I'm somewhat confused, how can we check in this test if it generates an ICE today?

@richo
Copy link
Contributor Author

richo commented Nov 13, 2014

Oh, apologies. The idea was that this was a tracking issue while I (or someone else if they beat me to it) chase down the bug. It's defnitely related to whether or not the closure has expressions in it's body, so I believe it's quite shallow.

(This isn't mergable, maybe I should have been clearer about this)

@alexcrichton
Copy link
Member

Ah ok, could you open an issue instead of making a PR in that case? Just trying to keep the queue clean!

@ghost
Copy link

ghost commented Nov 18, 2014

If you don't mind @richo I'll close this in favour of #18919, which seems to me to be a dupe. Thanks!

@ghost ghost closed this Nov 18, 2014
lnicola pushed a commit to lnicola/rust that referenced this pull request Jan 27, 2025
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants