Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore Lifetimes #147

Open
yannbolliger opened this issue Apr 22, 2021 · 0 comments
Open

Ignore Lifetimes #147

yannbolliger opened this issue Apr 22, 2021 · 0 comments
Labels
extraction Feature or bug with the extraction phase low prio

Comments

@yannbolliger
Copy link
Collaborator

yannbolliger commented Apr 22, 2021

We assume that rustc has done a good job at borrow checking and lifetime inference before the extraction phase.
Therefore it is safe to ignore/erase lifetimes when extraction Rust to Stainless.

The failure: Unsupported tree: Cannot extract generic parameter '_ of kind: Lifetime only happens when using methods on generic types containing references like Option<&T>.copied(). As these methods are not understood by Stainless at the moment anyway, the issue is of very low priority.

Example:

pub fn main() {
  let opt = Some(&123).copied();
  assert!(matches!(opt, Some(123)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extraction Feature or bug with the extraction phase low prio
Projects
None yet
Development

No branches or pull requests

1 participant