Skip to content

Function pointer types never display higher-ranked region when they are used as argument types #44887

Closed
@tirr-c

Description

@tirr-c
fn f<F>(_: F) where F: for<'a> Fn(&'a u8, for<'b> fn(&'b u8)) {}

fn main() {
    f(|_: (), _: ()| {});
}
error[E0631]: type mismatch in closure arguments
 --> src/main.rs:4:5
  |
4 |     f(|_: (), _: ()| {});
  |     ^ ----------------- found signature of `fn((), ()) -> _`
  |     |
  |     expected signature of `for<'a> fn(&'a u8, fn(&'b u8)) -> _`
  |
  = note: required by `f`

Here, only for<'b> is omitted.

Meta

$ rustc --version --verbose
rustc 1.22.0-nightly (930d3b17d 2017-09-26)
binary: rustc
commit-hash: 930d3b17dd91b6564cf535ac717c688db757be5d
commit-date: 2017-09-26
host: x86_64-unknown-linux-gnu
release: 1.22.0-nightly
LLVM version: 4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-lifetimesArea: Lifetimes / regionsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions