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 nightly when return type for trait method doesn't match return type for implementation #35995

Closed
jdm opened this issue Aug 25, 2016 · 2 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly.

Comments

@jdm
Copy link
Contributor

jdm commented Aug 25, 2016

trait T {
    fn something(&self) -> i32;
}

struct S;
impl T for S {
    fn something(&self) -> i64 {
        panic!()
    }
}

fn main() {
}

yields

$ rustc /tmp/foo.rs
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 'called `Option::unwrap()` on a `None` value', ../src/libcore/option.rs:326
stack backtrace:
   1:        0x10e5e24aa - std::sys::backtrace::tracing::imp::write::h482d45d91246faa2
   2:        0x10e5f2260 - std::panicking::default_hook::_{{closure}}::h89158f66286b674e
   3:        0x10e5f057f - std::panicking::default_hook::h9e30d428ee3b0c43
   4:        0x10e5f0c86 - std::panicking::rust_panic_with_hook::h2224f33fb7bf2f4c
   5:        0x10e5f0b24 - std::panicking::begin_panic::hcb11a4dc6d779ae5
   6:        0x10e5f0a32 - std::panicking::begin_panic_fmt::h310416c62f3935b3
   7:        0x10e5f0997 - rust_begin_unwind
   8:        0x10e650c60 - core::panicking::panic_fmt::hc5789f4e80194729
   9:        0x10e650b64 - core::panicking::panic::h1953378f4b37b561
  10:        0x109c3809c - rustc_typeck::check::compare_method::compare_impl_method::_{{closure}}::h08bef90d287aed42
  11:        0x109b968f9 - rustc_typeck::check::compare_method::compare_impl_method::he3538453c2efe177
  12:        0x109bab72e - rustc_typeck::check::check_impl_items_against_trait::hb105ca8bb42a0b3d
  13:        0x109ba8d9b - rustc_typeck::check::check_item_type::hba3733559d49be1e
  14:        0x109ba156e - _<rustc_typeck..check..CheckItemTypesVisitor<'a, 'tcx> as rustc..hir..intravisit..Visitor<'tcx>>::visit_item::h369cacffbaa18923
  15:        0x109ba348c - rustc_typeck::check::check_item_types::h81e44a5d40f450fd
  16:        0x109c18ea8 - rustc_typeck::check_crate::h8ec8b2f490f5dc28
  17:        0x109917d8a - rustc_driver::driver::phase_3_run_analysis_passes::_{{closure}}::h45e03cee16dcf298
  18:        0x1098e578b - rustc_driver::driver::phase_3_run_analysis_passes::hc0de40cea97d81a1
  19:        0x1098d3231 - rustc_driver::driver::compile_input::hd9ecc57abd3cba85
  20:        0x109904239 - rustc_driver::run_compiler::h184264500271cc39
  21:        0x109844b74 - std::panicking::try::do_call::h17a7a17ad7240c5c
  22:        0x10e5f8f9a - __rust_maybe_catch_panic
  23:        0x10985ec67 - _<F as alloc..boxed..FnBox<A>>::call_box::h93f9128277b2964a
  24:        0x10e5ef345 - std::sys::thread::Thread::new::thread_start::he0bf102845911132
  25:     0x7fff945f2898 - _pthread_body
  26:     0x7fff945f2729 - _pthread_start

This exists at least as far back as the 8/22 nightly.

@jdm jdm added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. labels Aug 25, 2016
@TimNN
Copy link
Contributor

TimNN commented Aug 25, 2016

Probably a duplicate of #35869.

@jdm
Copy link
Contributor Author

jdm commented Aug 25, 2016

Yep.

@jdm jdm closed this as completed Aug 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly.
Projects
None yet
Development

No branches or pull requests

2 participants