Closed
Description
Code (playground):
#![feature(existential_type)]
existential type Debuggable: core::fmt::Debug;
static mut TEST: Option<Debuggable> = None;
fn main() {
unsafe { TEST = Some(foo()) }
}
fn foo() -> Debuggable {
0u32
}
The core::fmt::Debug
trait is just an example, the error occurs with every trait I tried.
Error:
error: internal compiler error: broken MIR in DefId(0/0:4 ~ playground[be34]::TEST[0]) (bb0[0]): equate_inputs_and_outputs: `std::option::Option<Debuggable>==std::option::Option<Debuggable>` failed with `NoSolution`
--> src/main.rs:5:1
|
5 | static mut TEST: Option<Debuggable> = None;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:355:17
Backtrace
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
1: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:71
2: std::panicking::default_hook::{{closure}}
at src/libstd/sys_common/backtrace.rs:59
at src/libstd/panicking.rs:197
3: std::panicking::default_hook
at src/libstd/panicking.rs:211
4: rustc::util::common::panic_hook
5: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:478
6: std::panicking::begin_panic
7: <rustc_errors::Handler as core::ops::drop::Drop>::drop
8: core::ptr::real_drop_in_place
9: <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop
10: core::ptr::real_drop_in_place
11: rustc_interface::interface::run_compiler_in_existing_thread_pool
12: std::thread::local::LocalKey<T>::with
13: scoped_tls::ScopedKey<T>::set
14: syntax::with_globals
query stack during panic:
end of query stack
Possibly related to #54899, #53678, and #60371 (comment). Feel free to close this if this is a duplicate. I thought this might be useful for debugging because it (unlike the two other issues) does not use generators or futures.
cc @oli-obk (assigned to the two other issues)
Metadata
Metadata
Assignees
Labels
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.`#[feature(type_alias_impl_trait)]`Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Medium priorityRelevant to the compiler team, which will review and decide on the PR/issue.This issue requires a nightly compiler in some way.
Type
Projects
Status
Done
Activity
Centril commentedon Apr 30, 2019
Proposed prio: P-Low.
oli-obk commentedon Apr 30, 2019
heh. I don't think using
existential type
s for anything but functions counts as a defining use. You can work around this ICE by placingfoo
andDebuggable
into their own module: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=f244de8aa281ac5960be54980e5ba03fDutchGhost commentedon Apr 30, 2019
I guess you hit the same as this: #60371 (comment) .
At least the panic message is the same
phil-opp commentedon May 1, 2019
@oli-obk
Interesting! I'm glad to see that my approach works in principle.
phil-opp commentedon May 1, 2019
@DutchGhost This seems quite similar indeed. I added the link to the issue description. Since I'm not sure if this is really the same I will keep this issue open for now.
pnkfelix commentedon May 2, 2019
triage: P-high due to ICE; removing nomination.
pnkfelix commentedon May 16, 2019
this should block stabilization of #34511 (and #44685, but latter is closed as dupe of former)
2 remaining items
init
rtic-rs/rtic#217Aaron1011 commentedon Jul 28, 2019
This no longer ICEs on the latest nightly.
existential_type
ICEs #63096Add test for rust-lang#60407.
Rollup merge of rust-lang#63096 - Centril:existential-type-add-tests,…
Rollup merge of rust-lang#63096 - Centril:existential-type-add-tests,…
Rollup merge of rust-lang#63096 - Centril:existential-type-add-tests,…