Skip to content

/checkout/src/librustc/traits/specialize/mod.rs:201: failed to fully normalize #44022

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

Closed
zhendongsu opened this issue Aug 21, 2017 · 3 comments
Closed
Labels
A-specialization Area: Trait impl specialization C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@zhendongsu
Copy link

zhendongsu commented Aug 21, 2017

#![crate_type = "lib"] 
#![feature(specialization)] 

trait X {} 
trait Y : X {} 
trait Z { type Assoc : Y; }

struct A < T > (T);

impl < T : X > Z for A < T > { type Assoc = T; } 
impl < T > From << A < T > as Z > :: Assoc > for T {}
$ RUST_BACKTRACE=full rustc-nightly tmp.rs
error: internal compiler error: /checkout/src/librustc/traits/specialize/mod.rs:201: failed to fully normalize <T as std::convert::From<<A<T> as Z>::Assoc>>: [FulfillmentError(Obligation(predicate=Binder(TraitPredicate(<T as X>)),depth=1),Unimplemented)]

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.21.0-nightly (8c303ed87 2017-08-20) running on i686-unknown-linux-gnu

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'Box<Any>', /checkout/src/librustc_errors/lib.rs:486:8
stack backtrace:
   0: 0xf756ae9a - std::sys::imp::backtrace::tracing::imp::unwind_backtrace::h80d78ba3b40687b5
                       at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: 0xf7565c22 - std::sys_common::backtrace::_print::h47b9b32fe06dd6eb
                       at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: 0xf7576c7e - std::panicking::default_hook::{{closure}}::h006dcf643a2d1ee4
                       at /checkout/src/libstd/sys_common/backtrace.rs:60
                       at /checkout/src/libstd/panicking.rs:381
   3: 0xf75769ad - std::panicking::default_hook::h1e56c296d63316e2
                       at /checkout/src/libstd/panicking.rs:391
   4: 0xf757719b - std::panicking::rust_panic_with_hook::h218401524ff20a29
                       at /checkout/src/libstd/panicking.rs:611
   5: 0xf5ce3361 - std::panicking::begin_panic::h4938377ed080c909
   6: 0xf5d0103f - rustc_errors::Handler::bug::h4d89c75d22c1017a
   7: 0xf642e3d9 - rustc::session::opt_span_bug_fmt::{{closure}}::h381ad37ab7e154b0
   8: 0xf642e0f6 - rustc::session::opt_span_bug_fmt::h528b45e685201abd
   9: 0xf642dddc - rustc::session::bug_fmt::h1dc99310f401e1e0
  10: 0xf63b3ddc - rustc::infer::InferCtxtBuilder::enter::{{closure}}::h82e8f134f0254b28
  11: 0xf6464abe - rustc::traits::specialize::specializes::h7794bdf6e1e8f332
  12: 0xf646233a - rustc::traits::specialize::specialization_graph::Graph::insert::he7ff6d711ea6fcd9
  13: 0xf6467d55 - rustc::traits::specialize::specialization_graph_provider::ha5176b7326253e05
  14: 0xf6301c7f - rustc::dep_graph::graph::DepGraph::with_task::h0b47e6edc22573aa
  15: 0xf6568418 - rustc::ty::maps::<impl rustc::ty::maps::queries::specialization_graph_of<'tcx>>::try_get::h8fd63e3116cfd952
  16: 0xf6580786 - rustc::ty::maps::TyCtxtAt::specialization_graph_of::he681c442a59e5f1e
  17: 0xf657b36c - rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::specialization_graph_of::h548cfa1b93c36d1b
  18: 0xf6eb10af - rustc_typeck::coherence::coherent_trait::he9b367dd38388e4d
  19: 0xf6304088 - rustc::dep_graph::graph::DepGraph::with_task::h52ef919fdecc85b3
  20: 0xf6546422 - rustc::ty::maps::<impl rustc::ty::maps::queries::coherent_trait<'tcx>>::try_get::h2545313871596278
  21: 0xf657a28f - rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::coherent_trait::haf1a556d9bf16dd4
  22: 0xf6ebb412 - rustc_typeck::check_crate::{{closure}}::{{closure}}::h556e9f4e5e30732c
  23: 0xf6eb946d - rustc_typeck::check_crate::he7e69726bde9082c
  24: 0xf7692706 - rustc::ty::context::TyCtxt::create_and_enter::h54fe8ddc7b2f2638
  25: 0xf76f8e43 - rustc_driver::driver::compile_input::h36c200773836acf5
  26: 0xf7712575 - rustc_driver::run_compiler::hdf3c0b5b5e4bbadc
  27: 0xf7651caf - std::sys_common::backtrace::__rust_begin_short_backtrace::h9143dfc110593bba
  28: 0xf75b3f82 - __rust_maybe_catch_panic
                       at /checkout/src/libpanic_unwind/lib.rs:98
  29: 0xf7683ae1 - <F as alloc::boxed::FnBox<A>>::call_box::h7d6c81c9ff90eab5
  30: 0xf7575cbb - std::sys::imp::thread::Thread::new::thread_start::h505201887c39140f
                       at /checkout/src/liballoc/boxed.rs:692
                       at /checkout/src/libstd/sys_common/thread.rs:21
                       at /checkout/src/libstd/sys/unix/thread.rs:84
  31: 0xf5c65294 - start_thread
  32: 0xf73fa05d - __clone
  33:        0x0 - <unknown>
rustc 1.21.0-nightly (8c303ed87 2017-08-20)
@Mark-Simulacrum Mark-Simulacrum added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 22, 2017
@mattico
Copy link
Contributor

mattico commented Aug 25, 2017

Had a full debuginfo build lying around so I decided to get a backtrace with line info.

Full Backtrace
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.21.0-dev (d69e9cb15 2017-08-22) running on x86_64-pc-windows-msvc

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'byte index 41 is not a char boundary; it is inside 'ი' (bytes 40..43) of `fn საჭმელად_გემრიელი_სადილი ( ) -> isize {
`', src\libcore\str\mod.rs:2188:4
stack backtrace:
   0:     0x7ff9a5e7a507 - std::sys::imp::backtrace::unwind_backtrace
                               at C:\Users\matth\Code\Rust\rust\src\libstd\sys\windows\backtrace\mod.rs:65
   1:     0x7ff9a5e665a5 - std::sys_common::backtrace::_print
                               at C:\Users\matth\Code\Rust\rust\src\libstd\sys_common\backtrace.rs:71
   2:     0x7ff9a5e65b25 - std::sys_common::backtrace::print
                               at C:\Users\matth\Code\Rust\rust\src\libstd\sys_common\backtrace.rs:60
   3:     0x7ff9a5e9cad5 - std::panicking::default_hook::{{closure}}
                               at C:\Users\matth\Code\Rust\rust\src\libstd\panicking.rs:381
   4:     0x7ff9a5e9c42c - std::panicking::default_hook
                               at C:\Users\matth\Code\Rust\rust\src\libstd\panicking.rs:391
   5:     0x7ff9a5e9d610 - std::panicking::rust_panic_with_hook
                               at C:\Users\matth\Code\Rust\rust\src\libstd\panicking.rs:611
   6:     0x7ff9a5e9d472 - std::panicking::begin_panic<alloc::string::String>
                               at C:\Users\matth\Code\Rust\rust\src\libstd\panicking.rs:572
   7:     0x7ff9a5e9d22e - std::panicking::begin_panic_fmt
                               at C:\Users\matth\Code\Rust\rust\src\libstd\panicking.rs:522
   8:     0x7ff9a5e9d18a - std::panicking::rust_begin_panic
                               at C:\Users\matth\Code\Rust\rust\src\libstd\panicking.rs:498
   9:     0x7ff9a5efe917 - core::panicking::panic_fmt
                               at C:\Users\matth\Code\Rust\rust\src\libcore\panicking.rs:71
  10:     0x7ff9a5f0d4f4 - core::str::slice_error_fail
                               at C:\Users\matth\Code\Rust\rust\src\libcore\str\mod.rs:2188
  11:     0x7ff9bcef5ca4 - core::str::traits::{{impl}}::index::{{closure}}
                               at C:\Users\matth\Code\Rust\rust\src\libcore\str\mod.rs:1846
  12:     0x7ff9bcec0bce - core::option::Option<&str>::unwrap_or_else<&str,closure>
                               at C:\Users\matth\Code\Rust\rust\src\libcore\option.rs:370
  13:     0x7ff9bcef5c38 - core::str::traits::{{impl}}::index
                               at C:\Users\matth\Code\Rust\rust\src\libcore\str\mod.rs:1846
  14:     0x7ff9bcef5960 - core::str::traits::{{impl}}::index
                               at C:\Users\matth\Code\Rust\rust\src\libcore\str\mod.rs:1620
  15:     0x7ff9bcf4f4d5 - rustc_errors::emitter::EmitterWriter::render_source_line
                               at C:\Users\matth\Code\Rust\rust\src\librustc_errors\emitter.rs:314
  16:     0x7ff9bcf56d11 - rustc_errors::emitter::EmitterWriter::emit_message_default
                               at C:\Users\matth\Code\Rust\rust\src\librustc_errors\emitter.rs:987
  17:     0x7ff9bcf5ad98 - rustc_errors::emitter::EmitterWriter::emit_messages_default
                               at C:\Users\matth\Code\Rust\rust\src\librustc_errors\emitter.rs:1155
  18:     0x7ff9bcf4ba91 - rustc_errors::emitter::{{impl}}::emit
                               at C:\Users\matth\Code\Rust\rust\src\librustc_errors\emitter.rs:75
  19:     0x7ff9bcf4adda - rustc_errors::diagnostic_builder::DiagnosticBuilder::emit
                               at C:\Users\matth\Code\Rust\rust\src\librustc_errors\diagnostic_builder.rs:101
  20:     0x7ff99daebfed - rustc_typeck::check::coercion::CoerceMany<syntax::ptr::P<rustc::hir::Expr>>::coerce_inner<syntax::ptr::P<rustc::hir::Expr>>
                               at C:\Users\matth\Code\Rust\rust\src\librustc_typeck\check\coercion.rs:1211
  21:     0x7ff99dae9ee9 - rustc_typeck::check::coercion::CoerceMany<syntax::ptr::P<rustc::hir::Expr>>::coerce_forced_unit<syntax::ptr::P<rustc::hir::Expr>>
                               at C:\Users\matth\Code\Rust\rust\src\librustc_typeck\check\coercion.rs:1066
  22:     0x7ff99dba0bc4 - rustc_typeck::check::{{impl}}::check_block_with_expected::{{closure}}
                               at C:\Users\matth\Code\Rust\rust\src\librustc_typeck\check\mod.rs:4251
  23:     0x7ff99dba95d7 - rustc_typeck::check::FnCtxt::with_breakable_ctxt<closure,()>
                               at C:\Users\matth\Code\Rust\rust\src\librustc_typeck\check\mod.rs:4887
  24:     0x7ff99dba0216 - rustc_typeck::check::FnCtxt::check_block_with_expected
                               at C:\Users\matth\Code\Rust\rust\src\librustc_typeck\check\mod.rs:4218
  25:     0x7ff99db991f8 - rustc_typeck::check::FnCtxt::check_expr_kind
                               at C:\Users\matth\Code\Rust\rust\src\librustc_typeck\check\mod.rs:3813
  26:     0x7ff99db97d27 - rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_lvalue_pref
                               at C:\Users\matth\Code\Rust\rust\src\librustc_typeck\check\mod.rs:3436
  27:     0x7ff99db8a9b3 - rustc_typeck::check::FnCtxt::check_expr_with_expectation
                               at C:\Users\matth\Code\Rust\rust\src\librustc_typeck\check\mod.rs:2717
  28:     0x7ff99db8a931 - rustc_typeck::check::FnCtxt::check_expr_with_hint
                               at C:\Users\matth\Code\Rust\rust\src\librustc_typeck\check\mod.rs:2711
  29:     0x7ff99db8c81b - rustc_typeck::check::FnCtxt::check_return_expr
                               at C:\Users\matth\Code\Rust\rust\src\librustc_typeck\check\mod.rs:2851
  30:     0x7ff99db6d87e - rustc_typeck::check::check_fn
                               at C:\Users\matth\Code\Rust\rust\src\librustc_typeck\check\mod.rs:1034
  31:     0x7ff99db6b841 - rustc_typeck::check::typeck_tables_of::{{closure}}
                               at C:\Users\matth\Code\Rust\rust\src\librustc_typeck\check\mod.rs:868
  32:     0x7ff99db63a30 - rustc_typeck::check::{{impl}}::enter::{{closure}}<closure,&rustc::ty::context::TypeckTables>
                               at C:\Users\matth\Code\Rust\rust\src\librustc_typeck\check\mod.rs:595
  33:     0x7ff99d93bebc - rustc::infer::{{impl}}::enter::{{closure}}<closure,&rustc::ty::context::TypeckTables>
                               at C:\Users\matth\Code\Rust\rust\src\librustc\infer\mod.rs:375
  34:     0x7ff99d8fb9a8 - rustc::ty::context::tls::enter::{{closure}}<closure,&rustc::ty::context::TypeckTables>
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\context.rs:1262
  35:     0x7ff99d7caca6 - std::thread::local::LocalKey<core::cell::Cell<core::option::Option<(*const rustc::ty::context::tls::ThreadLocalGlobalCtxt, *const rustc::ty::context::tls::ThreadLocalInterners)>>>::try_with<core::cell::Cell<core::option::Option<(*const rustc::ty::context::tls::ThreadLocalGlobalCtxt, *const rustc::ty::context::tls::ThreadLocalInterners)>>,closure,&rustc::ty::context::TypeckTables>
                               at C:\Users\matth\Code\Rust\rust\src\libstd\thread\local.rs:365
  36:     0x7ff99d7c77de - std::thread::local::LocalKey<core::cell::Cell<core::option::Option<(*const rustc::ty::context::tls::ThreadLocalGlobalCtxt, *const rustc::ty::context::tls::ThreadLocalInterners)>>>::with<core::cell::Cell<core::option::Option<(*const rustc::ty::context::tls::ThreadLocalGlobalCtxt, *const rustc::ty::context::tls::ThreadLocalInterners)>>,closure,&rustc::ty::context::TypeckTables>
                               at C:\Users\matth\Code\Rust\rust\src\libstd\thread\local.rs:279
  37:     0x7ff99d8fa93b - rustc::ty::context::tls::enter<closure,&rustc::ty::context::TypeckTables>
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\context.rs:1259
  38:     0x7ff99d8f8b54 - rustc::ty::context::GlobalCtxt::enter_local<closure,&rustc::ty::context::TypeckTables>
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\context.rs:1073
  39:     0x7ff99d93b581 - rustc::infer::InferCtxtBuilder::enter<closure,&rustc::ty::context::TypeckTables>
                               at C:\Users\matth\Code\Rust\rust\src\librustc\infer\mod.rs:375
  40:     0x7ff99db62d19 - rustc_typeck::check::InheritedBuilder::enter<closure,&rustc::ty::context::TypeckTables>
                               at C:\Users\matth\Code\Rust\rust\src\librustc_typeck\check\mod.rs:595
  41:     0x7ff99db6b1a0 - rustc_typeck::check::typeck_tables_of
                               at C:\Users\matth\Code\Rust\rust\src\librustc_typeck\check\mod.rs:852
  42:     0x7ff99af98c21 - rustc::ty::maps::{{impl}}::try_get_with::{{closure}}::run_provider
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\maps.rs:609
  43:     0x7ff99aa3b87f - rustc::dep_graph::graph::DepGraph::with_task<rustc::ty::context::TyCtxt,rustc::hir::def_id::DefId,&rustc::ty::context::TypeckTables>
                               at C:\Users\matth\Code\Rust\rust\src\librustc\dep_graph\graph.rs:125
  44:     0x7ff99af98f0e - rustc::ty::maps::{{impl}}::try_get_with::{{closure}}<fn(&&rustc::ty::context::TypeckTables) -> &rustc::ty::context::TypeckTables,&rustc::ty::context::TypeckTables>
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\maps.rs:612
  45:     0x7ff99adf8d5a - rustc::ty::context::TyCtxt::cycle_check<closure,(&rustc::ty::context::TypeckTables, rustc::dep_graph::edges::DepNodeIndex)>
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\maps.rs:257
  46:     0x7ff99af9826f - rustc::ty::maps::queries::typeck_tables_of::try_get_with<fn(&&rustc::ty::context::TypeckTables) -> &rustc::ty::context::TypeckTables,&rustc::ty::context::TypeckTables>
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\maps.rs:596
  47:     0x7ff99af98fc4 - rustc::ty::maps::queries::typeck_tables_of::try_get
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\maps.rs:629
  48:     0x7ff99aff9df9 - rustc::ty::maps::TyCtxtAt::typeck_tables_of
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\maps.rs:675
  49:     0x7ff99aff2ce4 - rustc::ty::context::TyCtxt::typeck_tables_of
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\maps.rs:668
  50:     0x7ff99db6a104 - rustc_typeck::check::typeck_item_bodies::{{closure}}
                               at C:\Users\matth\Code\Rust\rust\src\librustc_typeck\check\mod.rs:726
  51:     0x7ff99d964a0f - rustc::session::Session::track_errors<closure,()>
                               at C:\Users\matth\Code\Rust\rust\src\librustc\session\mod.rs:270
  52:     0x7ff99db69fa6 - rustc_typeck::check::typeck_item_bodies
                               at C:\Users\matth\Code\Rust\rust\src\librustc_typeck\check\mod.rs:724
  53:     0x7ff99af96969 - rustc::ty::maps::{{impl}}::try_get_with::{{closure}}::run_provider
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\maps.rs:609
  54:     0x7ff99aa48b6d - rustc::dep_graph::graph::DepGraph::with_task<rustc::ty::context::TyCtxt,rustc::hir::def_id::CrateNum,core::result::Result<(), rustc::session::CompileIncomplete>>
                               at C:\Users\matth\Code\Rust\rust\src\librustc\dep_graph\graph.rs:125
  55:     0x7ff99af96aca - rustc::ty::maps::{{impl}}::try_get_with::{{closure}}<fn(&core::result::Result<(), rustc::session::CompileIncomplete>) -> core::result::Result<(), rustc::session::CompileIncomplete>,core::result::Result<(), rustc::session::CompileIncomplete>>
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\maps.rs:612
  56:     0x7ff99add8ceb - rustc::ty::context::TyCtxt::cycle_check<closure,(core::result::Result<(), rustc::session::CompileIncomplete>, rustc::dep_graph::edges::DepNodeIndex)>
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\maps.rs:257
  57:     0x7ff99af952e7 - rustc::ty::maps::queries::typeck_item_bodies::try_get_with<fn(&core::result::Result<(), rustc::session::CompileIncomplete>) -> core::result::Result<(), rustc::session::CompileIncomplete>,core::result::Result<(), rustc::session::CompileIncomplete>>
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\maps.rs:596
  58:     0x7ff99af96cf8 - rustc::ty::maps::queries::typeck_item_bodies::try_get
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\maps.rs:629
  59:     0x7ff99aff9b05 - rustc::ty::maps::TyCtxtAt::typeck_item_bodies
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\maps.rs:675
  60:     0x7ff99aff2c3c - rustc::ty::context::TyCtxt::typeck_item_bodies
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\maps.rs:668
  61:     0x7ff99db69eda - rustc_typeck::check::check_item_bodies
                               at C:\Users\matth\Code\Rust\rust\src\librustc_typeck\check\mod.rs:717
  62:     0x7ff99dbf2b8c - rustc_typeck::check_crate::{{closure}}
                               at C:\Users\matth\Code\Rust\rust\src\librustc_typeck\lib.rs:326
  63:     0x7ff99d9375ca - rustc::util::common::time<core::result::Result<(), rustc::session::CompileIncomplete>,closure>
                               at C:\Users\matth\Code\Rust\rust\src\librustc\util\common.rs:48
  64:     0x7ff99dbf2698 - rustc_typeck::check_crate
                               at C:\Users\matth\Code\Rust\rust\src\librustc_typeck\lib.rs:326
  65:     0x7ff9a51deb66 - rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}<closure,core::result::Result<(rustc::session::config::OutputFilenames, rustc_trans::back::write::OngoingCrateTranslation), rustc::session::CompileIncomplete>>
                               at C:\Users\matth\Code\Rust\rust\src\librustc_driver\driver.rs:1041
  66:     0x7ff9a4f362c4 - rustc::ty::context::tls::enter::{{closure}}<closure,core::result::Result<core::result::Result<(rustc::session::config::OutputFilenames, rustc_trans::back::write::OngoingCrateTranslation), rustc::session::CompileIncomplete>, rustc::session::CompileIncomplete>>
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\context.rs:1262
  67:     0x7ff9a4e15066 - std::thread::local::LocalKey<core::cell::Cell<core::option::Option<(*const rustc::ty::context::tls::ThreadLocalGlobalCtxt, *const rustc::ty::context::tls::ThreadLocalInterners)>>>::try_with<core::cell::Cell<core::option::Option<(*const rustc::ty::context::tls::ThreadLocalGlobalCtxt, *const rustc::ty::context::tls::ThreadLocalInterners)>>,closure,core::result::Result<core::result::Result<(rustc::session::config::OutputFilenames, rustc_trans::back::write::OngoingCrateTranslation), rustc::session::CompileIncomplete>, rustc::session::CompileIncomplete>>
                               at C:\Users\matth\Code\Rust\rust\src\libstd\thread\local.rs:365
  68:     0x7ff9a4df5866 - std::thread::local::LocalKey<core::cell::Cell<core::option::Option<(*const rustc::ty::context::tls::ThreadLocalGlobalCtxt, *const rustc::ty::context::tls::ThreadLocalInterners)>>>::with<core::cell::Cell<core::option::Option<(*const rustc::ty::context::tls::ThreadLocalGlobalCtxt, *const rustc::ty::context::tls::ThreadLocalInterners)>>,closure,core::result::Result<core::result::Result<(rustc::session::config::OutputFilenames, rustc_trans::back::write::OngoingCrateTranslation), rustc::session::CompileIncomplete>, rustc::session::CompileIncomplete>>
                               at C:\Users\matth\Code\Rust\rust\src\libstd\thread\local.rs:279
  69:     0x7ff9a4f35a39 - rustc::ty::context::tls::enter<closure,core::result::Result<core::result::Result<(rustc::session::config::OutputFilenames, rustc_trans::back::write::OngoingCrateTranslation), rustc::session::CompileIncomplete>, rustc::session::CompileIncomplete>>
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\context.rs:1259
  70:     0x7ff9a4f34fa0 - rustc::ty::context::tls::enter_global::{{closure}}<closure,core::result::Result<core::result::Result<(rustc::session::config::OutputFilenames, rustc_trans::back::write::OngoingCrateTranslation), rustc::session::CompileIncomplete>, rustc::session::CompileIncomplete>>
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\context.rs:1246
  71:     0x7ff9a4e04ac2 - std::thread::local::LocalKey<core::cell::Cell<fn(syntax_pos::Span, &mut core::fmt::Formatter) -> core::result::Result<(), core::fmt::Error>>>::try_with<core::cell::Cell<fn(syntax_pos::Span, &mut core::fmt::Formatter) -> core::result::Result<(), core::fmt::Error>>,closure,core::result::Result<core::result::Result<(rustc::session::config::OutputFilenames, rustc_trans::back::write::OngoingCrateTranslation), rustc::session::CompileIncomplete>, rustc::session::CompileIncomplete>>
                               at C:\Users\matth\Code\Rust\rust\src\libstd\thread\local.rs:365
  72:     0x7ff9a4dee4b5 - std::thread::local::LocalKey<core::cell::Cell<fn(syntax_pos::Span, &mut core::fmt::Formatter) -> core::result::Result<(), core::fmt::Error>>>::with<core::cell::Cell<fn(syntax_pos::Span, &mut core::fmt::Formatter) -> core::result::Result<(), core::fmt::Error>>,closure,core::result::Result<core::result::Result<(rustc::session::config::OutputFilenames, rustc_trans::back::write::OngoingCrateTranslation), rustc::session::CompileIncomplete>, rustc::session::CompileIncomplete>>
                               at C:\Users\matth\Code\Rust\rust\src\libstd\thread\local.rs:279
  73:     0x7ff9a4f346d0 - rustc::ty::context::tls::enter_global<closure,core::result::Result<core::result::Result<(rustc::session::config::OutputFilenames, rustc_trans::back::write::OngoingCrateTranslation), rustc::session::CompileIncomplete>, rustc::session::CompileIncomplete>>
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\context.rs:1243
  74:     0x7ff9a4f3c417 - rustc::ty::context::TyCtxt::create_and_enter<closure,core::result::Result<core::result::Result<(rustc::session::config::OutputFilenames, rustc_trans::back::write::OngoingCrateTranslation), rustc::session::CompileIncomplete>, rustc::session::CompileIncomplete>>
                               at C:\Users\matth\Code\Rust\rust\src\librustc\ty\context.rs:1024
  75:     0x7ff9a51d83b3 - rustc_driver::driver::phase_3_run_analysis_passes<closure,core::result::Result<(rustc::session::config::OutputFilenames, rustc_trans::back::write::OngoingCrateTranslation), rustc::session::CompileIncomplete>>
                               at C:\Users\matth\Code\Rust\rust\src\librustc_driver\driver.rs:1010
  76:     0x7ff9a51c627d - rustc_driver::driver::compile_input
                               at C:\Users\matth\Code\Rust\rust\src\librustc_driver\driver.rs:196
  77:     0x7ff9a51f6151 - rustc_driver::run_compiler
                               at C:\Users\matth\Code\Rust\rust\src\librustc_driver\lib.rs:316
  78:     0x7ff9a5205d27 - rustc_driver::main::{{closure}}
                               at C:\Users\matth\Code\Rust\rust\src\librustc_driver\lib.rs:1338
  79:     0x7ff9a51f4f12 - rustc_driver::run::{{closure}}<closure>
                               at C:\Users\matth\Code\Rust\rust\src\librustc_driver\lib.rs:132
  80:     0x7ff9a52053d8 - rustc_driver::monitor::{{closure}}<closure>
                               at C:\Users\matth\Code\Rust\rust\src\librustc_driver\lib.rs:1255
  81:     0x7ff9a4dd8b1e - std::sys_common::backtrace::__rust_begin_short_backtrace<closure,()>
                               at C:\Users\matth\Code\Rust\rust\src\libstd\sys_common\backtrace.rs:136
  82:     0x7ff9a4ddf57e - std::thread::{{impl}}::spawn::{{closure}}::{{closure}}<closure,()>
                               at C:\Users\matth\Code\Rust\rust\src\libstd\thread\mod.rs:394
  83:     0x7ff9a4d6338e - std::panic::{{impl}}::call_once<(),closure>
                               at C:\Users\matth\Code\Rust\rust\src\libstd\panic.rs:296
  84:     0x7ff9a4ddfb6b - std::panicking::try::do_call<std::panic::AssertUnwindSafe<closure>,()>
                               at C:\Users\matth\Code\Rust\rust\src\libstd\panicking.rs:480
  85:     0x7ff9a5ea6272 - panic_unwind::__rust_start_panic
  86:     0x7ff9a5ea614f - panic_unwind::__rust_maybe_catch_panic
                               at C:\Users\matth\Code\Rust\rust\src\libpanic_unwind\lib.rs:98
  87:     0x7ff9a4ddf9da - std::panicking::try<(),std::panic::AssertUnwindSafe<closure>>
                               at C:\Users\matth\Code\Rust\rust\src\libstd\panicking.rs:459
  88:     0x7ff9a4ddebe5 - std::panic::catch_unwind<std::panic::AssertUnwindSafe<closure>,()>
                               at C:\Users\matth\Code\Rust\rust\src\libstd\panic.rs:361
  89:     0x7ff9a4ddf38e - std::thread::{{impl}}::spawn::{{closure}}<closure,()>
                               at C:\Users\matth\Code\Rust\rust\src\libstd\thread\mod.rs:393
  90:     0x7ff9a4ee49d9 - alloc::boxed::{{impl}}::call_box<(),closure>
                               at C:\Users\matth\Code\Rust\rust\src\liballoc\boxed.rs:682
  91:     0x7ff9a5dc3d6f - alloc::boxed::{{impl}}::call_once<(),()>
                               at C:\Users\matth\Code\Rust\rust\src\liballoc\boxed.rs:692
  92:     0x7ff9a5e6e6ef - std::sys_common::thread::start_thread
                               at C:\Users\matth\Code\Rust\rust\src\libstd\sys_common\thread.rs:21
  93:     0x7ff9a5e9592e - std::sys::imp::thread::{{impl}}::new::thread_start
                               at C:\Users\matth\Code\Rust\rust\src\libstd\sys\windows\thread.rs:51
  94:     0x7ff9ff7e2773 - BaseThreadInitThunk

@arielb1 arielb1 changed the title nightly ICE: panicked at 'Box<Any>', /checkout/src/librustc_errors/lib.rs:486:8 /checkout/src/librustc/traits/specialize/mod.rs:201: failed to fully normalize Aug 28, 2017
@arielb1 arielb1 added the A-specialization Area: Trait impl specialization label Aug 28, 2017
@tirr-c
Copy link
Contributor

tirr-c commented Sep 4, 2017

If I add a trait bound T: X to the latter impl so that A<T> implements Z, the compiler give me a proper error message:

#![crate_type="lib"] 
#![feature(specialization)] 

trait X {} 
trait Y: X {} 
trait Z { type Assoc: Y; }

struct A<T>(T);

impl<T: X> Z for A<T> { type Assoc = T; }
impl<T: X> From<<A<T> as Z>::Assoc> for T {}
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g. `MyStruct<T>`); only traits defined in the current crate can be implemented for a type parameter
  --> src/lib.rs:11:1
   |
11 | impl<T: X> From<<A<T> as Z>::Assoc> for T {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@Alexendoo
Copy link
Member

Same ICE as #43037

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-specialization Area: Trait impl specialization C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants