Skip to content
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

rustc panicked at 'assertion failed: !substs.has_erasable_regions()' #48890

Closed
darkwater opened this issue Mar 9, 2018 · 4 comments
Closed
Labels
A-codegen Area: Code generation 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

@darkwater
Copy link

thread 'rustc' panicked at 'assertion failed: !substs.has_erasable_regions()', librustc_trans_utils/symbol_names.rs:192:9

I tried this code:

#![feature(termination_trait)]

extern crate metaflac     as m_flac;
extern crate mp3_metadata as m_mp3;

use std::env;
use std::error::Error;

fn main() -> Result<(), Box<Error>> {
    let path = env::args().skip(1).next().unwrap();
    let meta = m_mp3::read_from_file(path)?;
    println!("{:?}", meta);

    Ok(())
}

Meta

rustc --version --verbose:

rustc 1.26.0-nightly (2789b067d 2018-03-06)
binary: rustc
commit-hash: 2789b067da2ac921b86199bde21dd231ace1da39
commit-date: 2018-03-06
host: x86_64-unknown-linux-gnu
release: 1.26.0-nightly
LLVM version: 6.0

Backtrace:

stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at libstd/sys_common/backtrace.rs:59
             at libstd/panicking.rs:207
   3: std::panicking::default_hook
             at libstd/panicking.rs:223
   4: core::ops::function::Fn::call
   5: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:403
   6: std::panicking::begin_panic
   7: rustc_trans_utils::symbol_names::symbol_name
   8: rustc::dep_graph::graph::DepGraph::with_task_impl
   9: rustc::ty::maps::<impl rustc::ty::maps::queries::symbol_name<'tcx>>::force
  10: rustc::ty::maps::<impl rustc::ty::maps::queries::symbol_name<'tcx>>::try_get
  11: rustc::ty::maps::TyCtxtAt::symbol_name
  12: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::symbol_name
  13: rustc_mir::monomorphize::item::MonoItemExt::symbol_name
  14: rustc_mir::monomorphize::assert_symbols_are_distinct
  15: rustc_trans::base::collect_and_partition_translation_items
  16: rustc::dep_graph::graph::DepGraph::with_task_impl
  17: rustc::ty::maps::<impl rustc::ty::maps::queries::collect_and_partition_translation_items<'
tcx>>::force
  18: rustc::ty::maps::<impl rustc::ty::maps::queries::collect_and_partition_translation_items<'
tcx>>::try_get
  19: rustc::ty::maps::TyCtxtAt::collect_and_partition_translation_items
  20: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::collect_and_partition_
translation_items
  21: rustc_trans::base::trans_crate
  22: <rustc_trans::LlvmTransCrate as rustc_trans_utils::trans_crate::TransCrate>::trans_crate
  23: rustc_driver::driver::phase_4_translate_to_llvm
  24: rustc_driver::driver::compile_input::{{closure}}
  25: rustc::ty::context::TyCtxt::create_and_enter
  26: rustc_driver::driver::compile_input
  27: rustc_driver::run_compiler
@cuviper cuviper added A-codegen Area: Code generation T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Mar 10, 2018
@KamilaBorowska
Copy link
Contributor

KamilaBorowska commented Mar 25, 2018

This can be reproduced with simpler code, not involving external crates (or even std for that matter).

fn main() -> Result<(), &'static str> {
    Err("An error message for you")
}

@3442853561
Copy link
Contributor

There is a similar issue
#49474

@frewsxcv
Copy link
Member

frewsxcv commented Apr 5, 2018

Nominating because fn main() -> Result<(), Box<Error>> and fn main() -> Result<(), &str> seem like they'll be very common use cases and it's not great if we ICE for those, so we may want to look into destabilizing?

@shepmaster
Copy link
Member

See also #48389

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation 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