rust-lang / rust

Empowering everyone to build reliable and efficient software.

Home Page:https://www.rust-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ICE: panicked at 'unexpected unresolved segments'

jruderman opened this issue · comments

Found by fuzzing (modified fuzz-rustc)

Code

This code ices the compiler (playground):

struct S {}

impl S {
    fn f(self: &S::x) { }
}

Meta

rustc --version --verbose:

rustc 1.66.0-nightly (b8b5caee0 2022-10-16)
binary: rustc
commit-hash: b8b5caee04116c7383eb1c6470fcf15c437a60d4
commit-date: 2022-10-16
host: x86_64-apple-darwin
release: 1.66.0-nightly
LLVM version: 15.0.2

Error output

thread 'rustc' panicked at 'unexpected unresolved segments', /rustc/b8b5caee04116c7383eb1c6470fcf15c437a60d4/compiler/rustc_hir/src/def.rs:475:9

error: internal compiler error: unexpected panic
Backtrace

stack backtrace:
   0:        0x107a84b22 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hfb61a9741044014f
   1:        0x107adc80a - core::fmt::write::h80b5546452104194
   2:        0x107a76aec - std::io::Write::write_fmt::h33256fdd62339d0b
   3:        0x107a848ea - std::sys_common::backtrace::print::hb694518e4c96c392
   4:        0x107a87cf6 - std::panicking::default_hook::{{closure}}::he01b6bfd46306056
   5:        0x107a87a47 - std::panicking::default_hook::h55443c55d7fa056c
   6:        0x11526f5bd - rustc_driver[286c39cdc83f68da]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x107a884f1 - std::panicking::rust_panic_with_hook::h8cb1f94537802594
   8:        0x107a88283 - std::panicking::begin_panic_handler::{{closure}}::h187d949fd8e20977
   9:        0x107a84fb8 - std::sys_common::backtrace::__rust_end_short_backtrace::hd86e521fe315a48c
  10:        0x107a87f4d - _rust_begin_unwind
  11:        0x107b09283 - core::panicking::panic_fmt::h6de50ce229c1517b
  12:        0x107ad938b - core::panicking::panic_display::hb124ac4bd0ec4893
  13:        0x107ad933c - core::panicking::panic_str::h30604079030d18c2
  14:        0x107b09249 - core::option::expect_failed::h4137e6bbba0e02e8
  15:        0x118186efa - <<rustc_resolve[69925bdf25ec34b8]::late::LateResolutionVisitor>::find_lifetime_for_self::SelfVisitor as rustc_ast[9f69a5d1c43c2806]::visit::Visitor>::visit_ty
  16:        0x118186aa6 - <rustc_resolve[69925bdf25ec34b8]::late::LateResolutionVisitor>::find_lifetime_for_self
  17:        0x11817f436 - <rustc_resolve[69925bdf25ec34b8]::late::LateResolutionVisitor as rustc_ast[9f69a5d1c43c2806]::visit::Visitor>::visit_fn
  18:        0x11824a8ee - rustc_ast[9f69a5d1c43c2806]::visit::walk_assoc_item::<rustc_resolve[69925bdf25ec34b8]::late::LateResolutionVisitor>
  19:        0x11819b0dd - <rustc_resolve[69925bdf25ec34b8]::late::LateResolutionVisitor>::resolve_impl_item
  20:        0x118191f84 - <rustc_resolve[69925bdf25ec34b8]::late::LateResolutionVisitor>::resolve_item
  21:        0x118175cbc - <rustc_resolve[69925bdf25ec34b8]::late::LateResolutionVisitor as rustc_ast[9f69a5d1c43c2806]::visit::Visitor>::visit_item
  22:        0x11822a2bd - <rustc_resolve[69925bdf25ec34b8]::Resolver>::late_resolve_crate
  23:        0x1181bf6f1 - <rustc_session[45de8744ec08d70e]::session::Session>::time::<(), <rustc_resolve[69925bdf25ec34b8]::Resolver>::resolve_crate::{closure#0}>
  24:        0x11533bb27 - rustc_interface[4efa6836bf109096]::passes::configure_and_expand
  25:        0x11530b26a - <rustc_interface[4efa6836bf109096]::queries::Queries>::expansion
  26:        0x1151e67f6 - <rustc_interface[4efa6836bf109096]::interface::Compiler>::enter::<rustc_driver[286c39cdc83f68da]::run_compiler::{closure#1}::{closure#2}, core[c142ee26a724308]::result::Result<core[c142ee26a724308]::option::Option<rustc_interface[4efa6836bf109096]::queries::Linker>, rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>
  27:        0x11525aec5 - rustc_span[625c954c368e5f39]::with_source_map::<core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>, rustc_interface[4efa6836bf109096]::interface::create_compiler_and_run<core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>, rustc_driver[286c39cdc83f68da]::run_compiler::{closure#1}>::{closure#1}>
  28:        0x115201ad0 - rustc_interface[4efa6836bf109096]::interface::create_compiler_and_run::<core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>, rustc_driver[286c39cdc83f68da]::run_compiler::{closure#1}>
  29:        0x11524d395 - <scoped_tls[253ff75064fd0c2b]::ScopedKey<rustc_span[625c954c368e5f39]::SessionGlobals>>::set::<rustc_interface[4efa6836bf109096]::interface::run_compiler<core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>, rustc_driver[286c39cdc83f68da]::run_compiler::{closure#1}>::{closure#0}, core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>
  30:        0x11521cc1a - std[20409a7cc1741f85]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[4efa6836bf109096]::util::run_in_thread_pool_with_globals<rustc_interface[4efa6836bf109096]::interface::run_compiler<core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>, rustc_driver[286c39cdc83f68da]::run_compiler::{closure#1}>::{closure#0}, core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>::{closure#0}, core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>
  31:        0x11520308b - <<std[20409a7cc1741f85]::thread::Builder>::spawn_unchecked_<rustc_interface[4efa6836bf109096]::util::run_in_thread_pool_with_globals<rustc_interface[4efa6836bf109096]::interface::run_compiler<core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>, rustc_driver[286c39cdc83f68da]::run_compiler::{closure#1}>::{closure#0}, core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>::{closure#0}, core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>::{closure#1} as core[c142ee26a724308]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  32:        0x107a91607 - std::sys::unix::thread::Thread::new::thread_start::h8c17323206c3f1d4
  33:     0x7ff813a244e1 - __pthread_start