Skip to content

Missing Hint for Lifetime annotations #9

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

Open
Lotterleben opened this issue Sep 24, 2020 · 2 comments
Open

Missing Hint for Lifetime annotations #9

Lotterleben opened this issue Sep 24, 2020 · 2 comments

Comments

@Lotterleben
Copy link

What I expected

It would be super awesome to have a hint for ' lifetime annotations, since they're non-trivial to google for when you don't know what they're called.

Source code

I hope I'm getting the terminology right here. For the example code, I used an example from https://doc.rust-lang.org/1.9.0/book/lifetimes.html

0 | struct Foo<'a> {
  |         /* ↑ lifetime annotation */
1 |   x: &'a i32,
  |    /* ↑ lifetime annotation */
2 | }
@jrvidal
Copy link
Owner

jrvidal commented Dec 11, 2020

FYI I've deployed half a fix for this. We now highlight some lifetime generic parameters e.g. https://jrvidal.github.io/explaine.rs/?code=struct+Foo%3C%27a%3E+%7B%0A++x%3A+%26%27a+i32%0A%7D&line=0&ch=12

@Lotterleben
Copy link
Author

ooooh nice! That's already a huge help, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants