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

ICE: 'assertion failed: !substs.has_escaping_bound_vars()', compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs:1477:9 #84768

Closed
Manishearth opened this issue Apr 30, 2021 · 1 comment · Fixed by #86438
Labels
A-trait-system Area: Trait system C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. 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

@Manishearth
Copy link
Member

#![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
@Manishearth Manishearth added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Apr 30, 2021
@JohnTitor JohnTitor added A-trait-system Area: Trait system C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 13, 2021
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label May 13, 2021
@FabianWolff
Copy link
Contributor

Probably a duplicate of #83693.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-trait-system Area: Trait system C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. 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

Successfully merging a pull request may close this issue.

4 participants