Skip to content

ICE assertion failed: self.is_collecting_in_band_lifetimes' #52184

Closed
@withkittens

Description

@withkittens

I tried the code on Rust Playground (link). The issue should be here:

impl<'_> TryFrom<&'_ str> for Subject<'_> {
    type Error = SubjectError;
    
    fn try_from(s: &str) -> Subject {
        Subject { inner: Cow::Borrowed(s) }
    }
}

More specifically, seems like the compiler doesn't like impl<'_>.

Expected

Errors reported (wrong return type, maybe something about lifetimes).

Actual Result

Instead, the compiler ICE'd:

   Compiling playground v0.0.1 (file:///playground)
thread 'main' panicked at 'assertion failed: self.is_collecting_in_band_lifetimes', librustc/hir/lowering.rs:738:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.

...

note: rustc 1.29.0-nightly (960f6046c 2018-07-08) running on x86_64-unknown-linux-gnu

note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type bin

Backtrace

Gathered on Windows (rustc 1.29.0-nightly (9fd3d78 2018-07-07) x86_64-pc-windows-msvc):

thread 'main' panicked at 'assertion failed: self.is_collecting_in_band_lifetimes', librustc\hir\lowering.rs:738:9
stack backtrace:
   0: <std::sys::windows::args::Args as core::ops::drop::Drop>::drop
   1: <std::sys::windows::dynamic_lib::DynamicLibrary as core::ops::drop::Drop>::drop
   2: std::panicking::take_hook
   3: std::panicking::take_hook
   4: <rustc::ty::SymbolName as core::fmt::Display>::fmt
   5: std::panicking::rust_panic_with_hook
   6: <rustc::hir::intravisit::IdRange as core::fmt::Debug>::fmt
   7: <rustc::hir::lowering::LoweringContext::lower_async_fn_ret_ty::AsyncFnLifetimeCollector<'r, 'a> as rustc::hir::intravisit::Visitor<'v>>::visit_lifetime
   8: rustc::ty::context::TypeckTables::expr_ty
   9: <unknown>
  10: <rustc::hir::lowering::LoweringContext::lower_async_fn_ret_ty::AsyncFnLifetimeCollector<'r, 'a> as rustc::hir::intravisit::Visitor<'v>>::visit_lifetime
  11: rustc::hir::lowering::LoweringContext::lower_item
  12: <rustc::hir::lowering::LoweringContext::lower_crate::ItemLowerer<'lcx, 'interner> as syntax::visit::Visitor<'lcx>>::visit_item
  13: rustc::hir::lowering::lower_crate
  14: <rustc_driver::derive_registrar::Finder as rustc::hir::itemlikevisit::ItemLikeVisitor<'v>>::visit_item
  15: rustc_driver::driver::count_nodes
  16: rustc_driver::driver::compile_input
  17: rustc_driver::run_compiler
  18: rustc_driver::target_features::add_configuration
  19: <unknown>
  20: _rust_maybe_catch_panic
  21: rustc_driver::profile::dump
  22: rustc_driver::main
  23: <unknown>
  24: std::panicking::update_panic_count
  25: _rust_maybe_catch_panic
  26: std::rt::lang_start_internal
  27: <unknown>
  28: <unknown>
  29: BaseThreadInitThunk
  30: RtlUserThreadStart
query stack during panic:
end of query stack

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions