Skip to content

Nightly regression around HRTBs, likely connected to wf changes #28934

Closed
@aturon

Description

@aturon

The following code:

struct Parser<'i: 't, 't>(&'i u8, &'t u8);

impl<'i, 't> Parser<'i, 't> {
    fn parse_nested_block<F, T>(&mut self, parse: F) -> Result<T, ()>
        where for<'tt> F: FnOnce(&mut Parser<'i, 'tt>) -> T { panic!() }

    fn expect_exhausted(&mut self) -> Result<(), ()> { Ok(()) }
}

fn main() {
    let x = 0u8;
    Parser(&x, &x).parse_nested_block(|input| input.expect_exhausted()).unwrap();
}

compiles on 1.3 stable and 1.4 beta, but not on nightly. This seems likely related to wf changes.

Metadata

Metadata

Assignees

Labels

A-lifetimesArea: Lifetimes / regionsP-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions