member constraints involving external regions are scuffed
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
struct Inv<'a>(Option<*mut &'a ()>);
fn foo() -> impl Sized {
let _: fn() -> Inv<'static> = || {
foo()
};
loop {}
}
When borrow checking the closure with signature fn() -> Inv<'external> we've got a defining use of the opaque with the hidden type Inv<'external>.
The member constraint 'external member ['static] does not choose 'static here as it fails the upper bound check. This should work, properly supporting it is hard :>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by compiling the provided Rust reproducer and tracing the borrow-checking handling of the closure signature fn() -> Inv<'external> and its member constraint 'external member ['static]. Done means the reproducer compiles with the opaque hidden type Inv<'external> and the member constraint can select 'static without failing its upper-bound check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100