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

error promoting type-tests from closures part 2 #108639

Closed
aliemjay opened this issue Mar 2, 2023 · 0 comments · Fixed by #108691
Closed

error promoting type-tests from closures part 2 #108639

aliemjay opened this issue Mar 2, 2023 · 0 comments · Fixed by #108691
Labels
A-borrow-checker Area: The borrow checker A-NLL Area: Non-lexical lifetimes (NLL) C-bug Category: This is a bug. NLL-complete Working towards the "valid code works" goal T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@aliemjay
Copy link
Member

aliemjay commented Mar 2, 2023

A variant of #108635 with a different etiology:

trait Trait {
    type Item<'a>: 'a;
}

fn assert_static<T: 'static>(_: T) {}
fn relate<T>(_: T, _: T) {}

fn test_args<I: Trait>() {
    let closure = |a, b| {
        relate(&a, b);
        assert_static(a);
        //~^ ERROR the associated type may not live long enough
    };
    closure(None::<I::Item::<'_>>, &None::<I::Item::<'_>>);
}

In the same context as #108635, we fail to find an equal universal region although there is a one.

let upper_bound = self.non_local_universal_upper_bound(region_vid);

@rustbot label C-bug T-types A-NLL NLL-complete A-borrow-checker

@rustbot rustbot added A-borrow-checker Area: The borrow checker A-NLL Area: Non-lexical lifetimes (NLL) C-bug Category: This is a bug. NLL-complete Working towards the "valid code works" goal T-types Relevant to the types team, which will review and decide on the PR/issue. labels Mar 2, 2023
@bors bors closed this as completed in 8824994 Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-borrow-checker Area: The borrow checker A-NLL Area: Non-lexical lifetimes (NLL) C-bug Category: This is a bug. NLL-complete Working towards the "valid code works" goal T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants