Overflow evaluating requirement for an unusued type when function has generic lifetime parameters #113496
Labels
A-type-system
Area: Type system
C-bug
Category: This is a bug.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
I tried this code:
I would expect this compile.
Instead, I get this error:
I reduced the recursion limit to make the output smaller, but this still happens with default recursion.
The function
test
doesn't involve the typeWrap
at all. If everything involvingWrap
is removed then the code compiles.If the function
test
is removed or the (unused) generic parameters are removed, then the code compiles.In order for the bug to occur, the function
test
needs to have a lifetime parameter and another parameter which depends on that lifetime parameter (the signaturefn test<'a, 'b: 'a>()
also causes the bug). I couldn't get this to happen without using lifetimes.Several closely related issues have been mentioned in this thread: #39959. Some of the specific behavior here seems unique to this example as far as I can tell.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: