NLL: "explicit lifetime required" error fails to highlight usage that introduces constraint #51175
Labels
A-NLL
Area: Non-lexical lifetimes (NLL)
NLL-diagnostics
Working towards the "diagnostic parity" goal
Milestone
There are a collection of tests where NLL is failing to highlight the expression relevant to debugging some lifetime error.
Here is the list of tests that pnkfelix believes falls into that category:
Here's an explanation of the kind of (mis)behavior being described here:
In the following test ( ex1-return-one-existing-name-if-else-3.rs ):
here is the error output from AST borrowck ( ex1-return-one-existing-name-if-else-3.stderr )
while this is the error output from NLL: ( ex1-return-one-existing-name-if-else-3.nll.stderr ):
Note in particular that the error is failing to report the expression (namely the occurrence of
y
in an expression context that is expecting a&'a i32
) that is injecting the lifetime constraint that lead it to suggest the change to the parameter type.(It seems likely that the span of interest is probably immediately available, given that the warning we emit about not reporting a region error does highlight the span in which we are interested.)
The text was updated successfully, but these errors were encountered: