The reason is that there is a mismatch between the inferred and the expected type, as the inferred type includes explicit lifetime annotations.
This PR aims to provide a best-effort workaround, by comparing types with lifetime annotations erased.
The soundness of this comparison will be left to the Rust borrow-checker, in particular, incorrect cases where there would truly be a mismatch (e.g., because of different lifetimes in t and t_ret, or because of multiple lifetimes) will be extracted by karamel with this patch, but will fail Rust compilation.
As part of the Rust extraction of HACL*, several functions are not extracted with messages such as the following:
The reason is that there is a mismatch between the inferred and the expected type, as the inferred type includes explicit lifetime annotations. This PR aims to provide a best-effort workaround, by comparing types with lifetime annotations erased. The soundness of this comparison will be left to the Rust borrow-checker, in particular, incorrect cases where there would truly be a mismatch (e.g., because of different lifetimes in
t
andt_ret
, or because of multiple lifetimes) will be extracted by karamel with this patch, but will fail Rust compilation.