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

New 2024-edition impl Trait lifetime capture rules means opaques now capture higher-ranked lifetimes #117647

Closed
compiler-errors opened this issue Nov 6, 2023 · 1 comment
Labels
A-edition-2024 Area: The 2024 edition A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@compiler-errors
Copy link
Member

Under the new 2024-edition lifetime capture rules (#117587), any impl Traits that are defined inside the scope of a for<'a> binder now implicitly capture the lifetimes of that binder. This is intended behavior, and we'd like for that to work.

However, currently the type system doesn't support opaque type inference when the opaque captures one of these late-bound vars. This is blocked on #100503.

Opening this issue for a known-bug test.

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 6, 2023
@compiler-errors compiler-errors added A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. A-edition-2024 Area: The 2024 edition T-types Relevant to the types team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Nov 6, 2023
@compiler-errors
Copy link
Member Author

This can be mitigated now that we are stabilizing + use<> syntax to opt-out of higher-ranked implicit captures

@jackh726 jackh726 added the S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. label Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-edition-2024 Area: The 2024 edition A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants