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 when using an unconstrained typaram in a typaram constraint #16623

Closed
erickt opened this issue Aug 20, 2014 · 1 comment
Closed

ICE when using an unconstrained typaram in a typaram constraint #16623

erickt opened this issue Aug 20, 2014 · 1 comment
Labels
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

@erickt
Copy link
Contributor

erickt commented Aug 20, 2014

(I accidentally submitted this incomplete)

I just just ran across this bug that may actually be #16562, but I had a different stack trace so I wasn't completely positive.

trait Serialize<S> { }

impl<S> Serialize<S> for () { }

struct State<W> {
    writer: W,
}

pub fn to_format_vec<W, T: Serialize<State<W>>>(_value: T) { }

fn main() {
    let _ = to_format_vec(());
}

produces:

baz2.rs:13:13: 13:26 error: cannot determine a type for this bounded type parameter: unconstrained type
baz2.rs:13     let _ = to_format_vec(());
                       ^~~~~~~~~~~~~
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 't_f should be a trait', /Users/erickt/rust/rust-master/src/librustc/middle/typeck/check/vtable.rs:572

stack backtrace:
   1:        0x107abfdf5 - rt::backtrace::imp::write::he623acc81864f201rGr
   2:        0x107ac2fc3 - failure::on_fail::h8f9f19a91c24052dkXr
   3:        0x107d8d695 - unwind::begin_unwind_inner::h5d3cfad59626c9bcufe
   4:        0x104578108 - unwind::begin_unwind::h12330958406929428788
   5:        0x104adad74 - middle::typeck::check::vtable::search_for_vtable::haef69332461a5688NyM
   6:        0x104ad75aa - middle::typeck::check::vtable::lookup_vtables_for_param::closure.122062
   7:        0x104a9d27d - middle::ty::each_bound_trait_and_supertraits::h1394aaa7b3715888YlJ
   8:        0x104ad65ec - middle::typeck::check::vtable::lookup_vtables_for_param::hda7e4f654a5b55a101L
   9:        0x104ad445b - middle::typeck::check::vtable::lookup_vtables::h215a3cc54c6aa8822VL
  10:        0x104ae3a24 - middle::typeck::check::vtable::early_resolve_expr::closure.122212
  11:        0x104ae3442 - middle::typeck::check::FnCtxt<'a>::opt_node_ty_substs::h322d50051e130cb7twV
  12:        0x104ae1474 - middle::typeck::check::vtable::early_resolve_expr::hc1a86dd775e028b5PUM
  13:        0x104ae6bdb - visit::walk_expr::h2228446824831897429
  14:        0x104ae7d3b - visit::walk_local::h15217184139303618153
  15:        0x104ae848a - middle::typeck::check::vtable::resolve_in_block::h512c693e91bd056eZEN
  16:        0x104b42774 - middle::typeck::check::check_bare_fn::hea96be15969fc08bWBT
  17:        0x104b3badb - middle::typeck::check::check_item::h03dd381d5ee24cf84aU
  18:        0x104b424fd - middle::typeck::check::check_item_types::h66154ed2b2471f75dBT
  19:        0x10456afe6 - util::common::time::h8593819081890839475
  20:        0x104d3faac - middle::typeck::check_crate::h01f2334d92065f26Fel
  21:        0x104e0be60 - driver::driver::phase_3_run_analysis_passes::h875833fb36cd3ebdMPz
  22:        0x104e06e53 - driver::driver::compile_input::h6f91988ab025da07SBz
  23:        0x104eaeb82 - driver::run_compiler::h7fbb31eb141b1300M9C
  24:        0x104ead266 - driver::main_args::closure.137573
  25:        0x104ebf3bb - task::TaskBuilder<S>::try_future::closure.138734
  26:        0x104ebf2c5 - task::TaskBuilder<S>::spawn_internal::closure.138711
  27:        0x1059ae86c - task::spawn_opts::closure.8427
  28:        0x107df45cc - rust_try_inner
  29:        0x107df45b6 - rust_try
  30:        0x107d8aa6b - unwind::try::hb02e6a03665b7aa7K3d
  31:        0x107d8a80b - task::Task::run::hbb7219e7e81ccdc1Bad
  32:        0x1059ae6ca - task::spawn_opts::closure.8372
  33:        0x107d8c626 - thread::thread_start::h41227a904179836dnzd
  34:     0x7fff82db2899 - _pthread_body
  35:     0x7fff82db272a - _pthread_struct_init

cc @nikomatsakis

@erickt erickt changed the title ICE when ICE when using an unconstrained typaram in a typaram constraint Aug 20, 2014
@erickt erickt added the I-ICE label Aug 20, 2014
@ghost ghost 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 3, 2014
@ghost
Copy link

ghost commented Oct 16, 2014

Closing as a dupe of #16562.

@ghost ghost closed this as completed Oct 16, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

1 participant