Skip to content

Conversation

messense
Copy link
Contributor

@messense messense commented Apr 30, 2017

Addresses #171

Edit: Solved the rustc panic below.

rustc panicked while I try this. :-(

   Compiling sozu-lib v0.2.0 (file:///Users/messense/Projects/sozu/lib)
error: no method named `deserialize` found for type `D` in the current scope
   --> lib/src/messages.rs:208:18
    |
208 |     deserializer.deserialize(OrderFieldVisitor)
    |                  ^^^^^^^^^^^
    |
    = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
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: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'byte index 4 is out of bounds of ``', src/libcore/str/mod.rs:2162
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
   1: std::panicking::default_hook::{{closure}}
   2: std::panicking::default_hook
   3: std::panicking::rust_panic_with_hook
   4: std::panicking::begin_panic
   5: std::panicking::begin_panic_fmt
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::str::slice_error_fail
   9: rustc_errors::emitter::EmitterWriter::emit_message_default
  10: <rustc_errors::emitter::EmitterWriter as rustc_errors::emitter::Emitter>::emit
  11: rustc_errors::diagnostic_builder::DiagnosticBuilder::emit
  12: rustc_typeck::check::method::suggest::<impl rustc_typeck::check::FnCtxt<'a, 'gcx, 'tcx>>::report_method_error
  13: rustc_typeck::check::FnCtxt::check_expr_kind
  14: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_lvalue_pref
  15: rustc_typeck::check::FnCtxt::check_block_with_expected::{{closure}}
  16: rustc_typeck::check::FnCtxt::check_block_with_expected
  17: rustc_typeck::check::FnCtxt::check_expr_kind
  18: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_lvalue_pref
  19: rustc_typeck::check::FnCtxt::check_return_expr
  20: rustc_typeck::check::check_fn
  21: rustc_typeck::check::typeck_tables_of
  22: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::try_get
  23: rustc::ty::maps::TyCtxtAt::typeck_tables_of
  24: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_tables_of
  25: rustc_typeck::check::typeck_item_bodies
  26: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_item_bodies<'tcx>>::try_get
  27: rustc::ty::maps::TyCtxtAt::typeck_item_bodies
  28: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_item_bodies
  29: rustc_typeck::check_crate
  30: rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}
  31: rustc_driver::driver::phase_3_run_analysis_passes
  32: rustc_driver::driver::compile_input
  33: rustc_driver::run_compiler
  34: std::panicking::try::do_call
  35: __rust_maybe_catch_panic
  36: <F as alloc::boxed::FnBox<A>>::call_box
  37: std::sys::imp::thread::Thread::new::thread_start
  38: _pthread_body
  39: _pthread_start

error: Could not compile `sozu-lib`.

To learn more, run the command again with --verbose.

@CLAassistant
Copy link

CLAassistant commented Apr 30, 2017

CLA assistant check
All committers have signed the CLA.

@messense
Copy link
Contributor Author

Opened a issue in rust-lang/rust#41652

@messense messense mentioned this pull request May 1, 2017
@messense
Copy link
Contributor Author

messense commented May 3, 2017

@Geal Ping. This PR is done, please take some time to review.

@Geal
Copy link
Member

Geal commented May 3, 2017 via email

@skade skade mentioned this pull request May 3, 2017
@Geal
Copy link
Member

Geal commented May 3, 2017

Could you take a look at https://serde.rs/enum-representations.html ?
There are a lot of enums in sozu's messages, and this feature could reduce the code size a bit

@messense
Copy link
Contributor Author

messense commented May 4, 2017

@Geal I think maybe we should do that in a separated PR.

@Geal Geal merged commit e2ebdab into sozu-proxy:master May 4, 2017
@Geal
Copy link
Member

Geal commented May 4, 2017

Thanks! You're right, it should be in another PR. I opened #176 to track this

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.

3 participants