Repository navigation
missing specialization: <encoder::EncodeContext as SpecializedEncoder<rustc::hir::def_id::LocalDefId>>::specialized_encode not overriden #47422
Copy link
Copy link
Closed
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
#![feature(conservative_impl_trait)]
#![feature(const_fn)]
pub struct S;
pub const fn f(t: S) -> impl Fn() {
move || {
&t;
}
}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.25.0-nightly (97520ccb1 2018-01-21) running on x86_64-pc-windows-msvc
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'missing specialization: `<encoder::EncodeContext as SpecializedEncoder<rustc::hir::def_id::LocalDefId>>::specialized_encode` not overridden', libseriali
ze\serialize.rs:788:9
stack backtrace:
0: <std::sync::condvar::Condvar as core::fmt::Debug>::fmt
1: std::panicking::Location::column
2: std::panicking::Location::column
3: std::panicking::rust_panic_with_hook
4: std::panicking::begin_panic_fmt
5: std::panicking::begin_panic_fmt
6: rustc_metadata::decoder::__ty_decoder_impl::<impl serialize::serialize::Decoder for rustc_metadata::decoder::DecodeContext<'a, 'tcx>>::read_nil
7: <unknown>
8: <unknown>
9: rustc_metadata::decoder::__ty_decoder_impl::<impl serialize::serialize::Decoder for rustc_metadata::decoder::DecodeContext<'a, 'tcx>>::read_str
10: rustc_metadata::encoder::EncodeContext::emit_lazy_distance
11: <(&'a rustc_metadata::cstore::CrateMetadata, &'a rustc::session::Session) as rustc_metadata::decoder::Metadata<'a, 'tcx>>::cdata
12: <(&'a rustc_metadata::cstore::CrateMetadata, &'a rustc::session::Session) as rustc_metadata::decoder::Metadata<'a, 'tcx>>::cdata
13: <rustc_metadata::encoder::EncodeVisitor<'a, 'b, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
14: <rustc_metadata::schema::LazyState as core::fmt::Debug>::fmt
15: <rustc_metadata::encoder::ImplVisitor<'a, 'tcx> as rustc::hir::itemlikevisit::ItemLikeVisitor<'v>>::visit_item
16: rustc_metadata::cstore_impl::<impl rustc::middle::cstore::CrateStore for rustc_metadata::cstore::CStore>::encode_metadata
17: rustc::ty::context::TyCtxt::encode_metadata
18: rustc_trans::base::trans_instance
19: <rustc_trans::back::lto::ThinBuffer as core::ops::drop::Drop>::drop
20: <rustc_trans::base::ValueIter as core::iter::iterator::Iterator>::next
21: <rustc_trans::LlvmTransCrate as rustc_trans_utils::trans_crate::TransCrate>::trans_crate
22: <rustc_driver::pretty::UserIdentifiedItem as core::fmt::Debug>::fmt
23: rustc_driver::driver::phase_4_translate_to_llvm
24: rustc_driver::target_features::add_configuration
25: rustc_driver::target_features::add_configuration
26: rustc_driver::target_features::add_configuration
27: rustc_driver::driver::compile_input
28: rustc_driver::run_compiler
29: <rustc_driver::derive_registrar::Finder as rustc::hir::itemlikevisit::ItemLikeVisitor<'v>>::visit_impl_item
30: _rust_maybe_catch_panic
31: <rustc_driver::derive_registrar::Finder as rustc::hir::itemlikevisit::ItemLikeVisitor<'v>>::visit_impl_item
32: <std::sync::condvar::Condvar as core::fmt::Debug>::fmt
33: std::sys::windows::thread::Thread::new
34: BaseThreadInitThunk
(EDIT: I don't think that's the right backtrace)
For context, a few modifications and the resulting compile:
- Remove
const=> clean compile - Remove
move=>error[E0373]: closure may outlive the current function, but it borrows `t`, which is owned by the current function - Remove
&in closure =>error[E0507]: cannot move out of captured outer variable in an `Fn` closure
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Activity
CAD97 commentedon Jan 24, 2018
Stack trace for stage2 4e3901d with
debuginfo-lines = trueRUST_BACKTRACE=full
emilyalbini commentedon Apr 3, 2018
This doesn't ICE anymore on the stable nightly. Closing.