Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ice: Should not be resolving bound region. #117808

@matthiaskrgr

Description

@matthiaskrgr

code was reduced from a diagnostic issue: #97680
Unfortunately I can't bisect this since we don't have nightly debug assertion builds

use std::future::Future;

fn hrc<R, F: for<'a> AsyncClosure<'a, (), R>>(f: F) -> F {
    f
}

fn main() {
    hrc(|x| async {});
}

trait AsyncClosure<'a, I, R>
where
    I: 'a,
{
}

impl<'a, I, R, Fut, F> AsyncClosure<'a, I, R> for F
where
    I: 'a,
    F: Fn(&'a I) -> Fut,
    Fut: Future<Output = R> + Send + 'a,
{
}

Version information

rustc 1.75.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.75.0-dev
LLVM version: 17.0.4

rustc @ d4c86cf

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lifetimesArea: Lifetimes / regionsC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.requires-debug-assertionsThis issue requires a build of rustc or tooling with debug-assertions in some way

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions