Skip to content

ICE using explicit lifetime with unboxed closures #17545

Closed
@pythonesque

Description

@pythonesque

Also fails with FnOnce / &mut instead of Fn / &

(Seems like it's similar to issue #16549).

#![feature(unboxed_closures)]
pub fn foo<F: <'a> Fn<(&'a (),), ()>>(bar: F) {
    bar.call((&(),));
}
fn main() {}

<anon>:3:15: 3:18 error: internal compiler error: cannot relate bound region: ReLateBound(11, BrNamed(syntax::ast::DefId{krate: 0u32, node: 17u32}, 'a)) <= ReInfer(55)
<anon>:3     bar.call((&(),));
                       ^~~
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box<Any>', /build/rust-git/src/rust/src/libsyntax/diagnostic.rs:113

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions