You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This test is compile-fail/never_transmute_humans.rs from miri
// This should fail even without validation// compile-flags: -Zmir-emit-validate=0#![feature(never_type)]#![allow(unreachable_code)]#![allow(unused_variables)]structHuman;fnmain(){let x: ! = unsafe{
std::mem::transmute::<Human, !>(Human)//~ ERROR entered unreachable code};f(x)}fnf(x: !) -> ! { x }
backtrace
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', libcore/option.rs:335:21
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
1: std::sys_common::backtrace::print
2: std::panicking::default_hook::{{closure}}
3: std::panicking::default_hook
4: rustc::util::common::panic_hook
5: std::panicking::rust_panic_with_hook
6: std::panicking::begin_panic_fmt
7: rust_begin_unwind
8: core::panicking::panic_fmt
9: core::panicking::panic
10: rustc_trans::mir::block::<impl rustc_trans::mir::FunctionCx<'a, 'tcx>>::trans_terminator
11: rustc_trans::mir::trans_mir
12: rustc_trans::base::trans_instance
13: rustc_trans::trans_item::MonoItemExt::define
14: rustc_trans::base::compile_codegen_unit
15: rustc::ty::maps::<impl rustc::ty::maps::config::QueryConfig<'tcx> for rustc::ty::maps::queries::compile_codegen_unit<'tcx>>::compute
16: rustc::dep_graph::graph::DepGraph::with_task_impl
17: rustc::ty::context::tls::with_related_context
18: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
19: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
20: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::compile_codegen_unit
21: rustc_trans::base::trans_crate
22: <rustc_trans::LlvmTransCrate as rustc_trans_utils::trans_crate::TransCrate>::trans_crate
23: rustc::util::common::time
24: rustc_driver::driver::phase_4_translate_to_llvm
25: rustc_driver::driver::compile_input::{{closure}}
26: rustc::ty::context::tls::enter_context
27: <std::thread::local::LocalKey<T>>::with
28: rustc::ty::context::TyCtxt::create_and_enter
29: rustc_driver::driver::compile_input
30: rustc_driver::run_compiler_impl
31: <scoped_tls::ScopedKey<T>>::set
32: syntax::with_globals
33: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
34: __rust_maybe_catch_panic
35: rustc_driver::run
36: rustc_driver::main
37: std::rt::lang_start::{{closure}}
38: std::panicking::try::do_call
39: __rust_maybe_catch_panic
40: std::rt::lang_start_internal
41: main
query stack during panic:
#0 [compile_codegen_unit] compile_codegen_unit
end of query stack
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.27.0-nightly (8ff4b4206 2018-05-08) running on x86_64-apple-darwin
The text was updated successfully, but these errors were encountered:
There's some discussion of mem::transmute with ! here: rust-lang/rfcs#1892. However, it doesn't look like anything was decided in terms of forbidding it since rust-lang/rfcs#1891 was closed.
pietroalbini
added
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
C-bug
Category: This is a bug.
labels
May 9, 2018
This test is compile-fail/never_transmute_humans.rs from miri
backtrace
The text was updated successfully, but these errors were encountered: