Skip to content

ICE: 'rustc' panicked at 'assertion failed: concrete_substs.is_normalized_for_trans()' #36381

Closed
@Marwes

Description

@Marwes

The ICE goes away if &str is changed to () so it might have something to do with lifetimes.

pub trait StreamOnce {
    type Position;
}

impl<'a> StreamOnce for &'a str {
    type Position = usize;
}

pub fn parser<F>(_: F) {
    panic!()
}

fn follow(_: &str) -> <&str as StreamOnce>::Position {
    panic!()
}

fn main() {
    parser(follow);
}
thread 'rustc' panicked at 'assertion failed: concrete_substs.is_normalized_for_trans()', ../src/librustc_trans\collector.rs:1038
stack backtrace:
   0:     0x7ff943c76fda - <std::rand::OsRng as rand::Rng>::fill_bytes::h076068e3d5c70638
   1:     0x7ff943c74d40 - std::panicking::Location::line::h1d71b2da86bcc037
   2:     0x7ff943c757cd - std::panicking::rust_panic_with_hook::hb1322e5f2588b4db
   3:     0x7ff943057be3 - <unknown>
   4:     0x7ff94310ac65 - <rustc_trans::collector::MirNeighborCollector<'a, 'tcx> as rustc::mir::visit::Visitor<'tcx>>::visit_terminator_kind::h6eab751b04fbd7ab
   5:     0x7ff943109f08 - <rustc_trans::collector::MirNeighborCollector<'a, 'tcx> as rustc::mir::visit::Visitor<'tcx>>::visit_operand::h33e5e243ea282334
   6:     0x7ff94310a4fb - <rustc_trans::collector::MirNeighborCollector<'a, 'tcx> as rustc::mir::visit::Visitor<'tcx>>::visit_terminator_kind::h6eab751b04fbd7ab
   7:     0x7ff94307927b - <unknown>
   8:     0x7ff943106ef3 - <rustc_trans::collector::TransItemCollectionMode as core::fmt::Debug>::fmt::h6c44aead55c9bfdb
   9:     0x7ff94318ec35 - <rustc_trans::ModuleSource as core::clone::Clone>::clone::h3d702b4981d13b3c
  10:     0x7ff9430e85a8 - rustc_trans::base::trans_crate::hf067cf9d0a8bcbf2
  11:     0x7ff9430e1847 - rustc_trans::base::trans_crate::hf067cf9d0a8bcbf2
  12:     0x7ff94422e7ba - rustc_driver::driver::phase_4_translate_to_llvm::he9d5d0022988d46e
  13:     0x7ff94427f893 - rustc_driver::main::h5a1049f207c7c577
  14:     0x7ff9442616d6 - rustc_driver::main::h5a1049f207c7c577
  15:     0x7ff94419e5c2 - <unknown>
  16:     0x7ff94421db6a - rustc_driver::driver::compile_input::h7dacd98cd2fd7d2b
  17:     0x7ff94424b789 - rustc_driver::run_compiler::h37c4294ab73436f7
  18:     0x7ff94416b051 - <unknown>
  19:     0x7ff943c7fa31 - _rust_maybe_catch_panic
  20:     0x7ff9441884e4 - <unknown>
  21:     0x7ff943c729ce - std::sys::thread::Thread::new::h117e066ad5633902
  22:     0x7ff978638101 - BaseThreadInitThunk
rustc 1.13.0-nightly (a7b2232d2 2016-09-07)
binary: rustc
commit-hash: a7b2232d20320dc3b4044a2aec1d51a129e7e17d
commit-date: 2016-09-07
host: x86_64-pc-windows-msvc
release: 1.13.0-nightly

Metadata

Metadata

Assignees

Labels

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