Closed spernsteiner closed 11 months ago
@spernsteiner i'm happy to take this one once i'm done with other tasks, if you want to re-assign to me
I self-assigned this first because it's the most immediate blocker for being able to filter exactly what gets rewritten (currently lifetimes are always added) and I plan to start on it immediately, and second because I'd like to get a better understanding of how exactly lifetime parameters are handled at the moment, since we'll need to extend that sometime soon to work with functions and possibly lifetime bounds (as in 'a: 'b
).
Sounds good, and as an FYI I've been working on lifetimes in functions
Sometimes, we add hypothetical regions to a type, but the rewriting we choose for the field types results in those region parameters going unused:
Rewritten output:
Here, we add a hypothetical region param
'h0
toS
for it to use in the type ofptr
, but we end up leavingptr
as a raw pointer type, which doesn't need a region. This causes rustc to report an error: "parameter'h0
is never used". We would have similar issues if we chose to rewriteptr
intoBox
orRc
.We need a postprocessing pass that can examine the rewrites (
TypeDesc
s) for ADT field types and decide which of the hypothetical regions params should actually be emitted during rewriting.