Closed
Description
#![feature(impl_trait_in_bindings)]
fn bug<'a, 'b, T>()
where
'a: 'b,
{
let f: &impl Fn(&'a T) -> &'b T = &|x| x;
}
fn main() {}
Backtrace:
error: internal compiler error: broken MIR in DefId(0/0:3 ~ playground[1f65]::bug[0]) (_1 = &(*_2)): bad assignment (&impl std::ops::Fn<(&T,)> = &[closure@src/main.rs:7:40: 7:45]): NoSolution
--> src/main.rs:7:39
|
7 | let f: &impl Fn(&'a T) -> &'b T = &|x| x;
| ^^^^^^
thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:324:17
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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:70
2: std::panicking::default_hook::{{closure}}
at src/libstd/sys_common/backtrace.rs:58
at src/libstd/panicking.rs:200
3: std::panicking::default_hook
at src/libstd/panicking.rs:215
4: rustc::util::common::panic_hook
5: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:482
6: std::panicking::begin_panic
7: <rustc_errors::Handler as core::ops::drop::Drop>::drop
8: core::ptr::real_drop_in_place
9: core::ptr::real_drop_in_place
10: core::ptr::real_drop_in_place
11: <scoped_tls::ScopedKey<T>>::set
query stack during panic:
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.33.0-nightly (60e825389 2018-12-28) running on x86_64-unknown-linux-gnu
note: compiler flags: -C opt-level=3 -C codegen-units=1 --crate-type bin
note: some of the compiler flags provided by cargo are hidden
ICE's on both 2015 and 2018.
This is verry similar to #57200, (notice the &
in front of the type and closure here), yet a verry different ICE message.
Metadata
Metadata
Assignees
Labels
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Category: This is a bug.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.`#![feature(impl_trait_in_bindings)]`Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Relevant to the compiler team, which will review and decide on the PR/issue.ICE tracked in rust-lang/glacier.This issue requires a nightly compiler in some way.