Closed
Description
#![feature(fn_traits)]
fn transform_mut<F>(f: F) where F: for<'b> FnOnce(&'b mut u8) {
<F as FnOnce(&mut u8)>::call_once(f, 1)
}
(playpen)
Yes, this code is broken, but I'm surprised to get an ICE 😄
error[E0229]: associated type bindings are not allowed here
--> src/lib.rs:4:11
|
4 | <F as FnOnce(&mut u8)>::call_once(f, 1)
| ^^^^^^^^^^^^^^^ associated type not allowed here
thread 'rustc' panicked at 'assertion failed: !substs.has_escaping_bound_vars()', compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs:1477:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.53.0-nightly (478a07df0 2021-04-29) running on x86_64-unknown-linux-gnu
note: compiler flags: -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2 --crate-type lib
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [typeck] type-checking `transform_mut`
#1 [typeck_item_bodies] type-checking all item bodies
end of query stack