Skip to content

ICE on ?Sized handling #48728

Closed
Closed
@HyeonuPark

Description

@HyeonuPark

This code reproduce it.
https://play.rust-lang.org/?gist=e6f3aa15d3399c3300dd38b0a627cbf4&version=stable

I tried this code:

#[derive(Clone)]
struct Node<T: ?Sized>(Box<T>);

impl<T: Clone + ?Sized> Clone for Node<[T]> {
    fn clone(&self) -> Self {
        Node(Box::clone(&self.0))
    }
}

fn main() {}

Meta

rustc --version --verbose:

rustc 1.24.1 (d3ae9a9e0 2018-02-27)
binary: rustc
commit-hash: d3ae9a9e08edf12de0ed82af57ba2a56c26496ea
commit-date: 2018-02-27
host: x86_64-unknown-linux-gnu
release: 1.24.1
LLVM version: 4.0
Backtrace: 
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at /checkout/src/libstd/sys_common/backtrace.rs:68
             at /checkout/src/libstd/sys_common/backtrace.rs:57
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/panicking.rs:381
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:391
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:577
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:538
   6: std::panicking::begin_panic_fmt
             at /checkout/src/libstd/panicking.rs:522
   7: rust_begin_unwind
             at /checkout/src/libstd/panicking.rs:498
   8: core::panicking::panic_fmt
             at /checkout/src/libcore/panicking.rs:71
   9: core::panicking::panic
             at /checkout/src/libcore/panicking.rs:51
  10: <std::thread::local::LocalKey<T>>::with
  11: rustc::ty::context::GlobalCtxt::enter_local
  12: rustc::traits::specialize::specialization_graph::Graph::insert
  13: rustc::traits::specialize::specialization_graph_provider
  14: rustc::dep_graph::graph::DepGraph::with_task_impl
  15: rustc_errors::Handler::track_diagnostics
  16: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
  17: rustc::ty::maps::<impl rustc::ty::maps::queries::specialization_graph_of<'tcx>>::force
  18: rustc::ty::maps::<impl rustc::ty::maps::queries::specialization_graph_of<'tcx>>::try_get
  19: rustc::ty::maps::TyCtxtAt::specialization_graph_of
  20: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::specialization_graph_of
  21: rustc_typeck::coherence::overlap::check_impl
  22: rustc_typeck::coherence::coherent_trait
  23: rustc::dep_graph::graph::DepGraph::with_task_impl
  24: rustc_errors::Handler::track_diagnostics
  25: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
  26: rustc::ty::maps::<impl rustc::ty::maps::queries::coherent_trait<'tcx>>::force
  27: rustc::ty::maps::<impl rustc::ty::maps::queries::coherent_trait<'tcx>>::try_get
  28: rustc::ty::maps::TyCtxtAt::coherent_trait
  29: rustc::ty::maps::<impl rustc::ty::maps::queries::coherent_trait<'tcx>>::ensure
  30: rustc_typeck::coherence::check_coherence
  31: rustc_typeck::check_crate
  32: <std::thread::local::LocalKey<T>>::with
  33: <std::thread::local::LocalKey<T>>::with
  34: rustc::ty::context::TyCtxt::create_and_enter
  35: rustc_driver::driver::compile_input
  36: rustc_driver::run_compiler

And an angry imp there! 👿

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions