Skip to content

Disallow (most) reserved/keywords as lifetime names #10565

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

Closed
huonw opened this issue Nov 19, 2013 · 4 comments · Fixed by #10675
Closed

Disallow (most) reserved/keywords as lifetime names #10565

huonw opened this issue Nov 19, 2013 · 4 comments · Fixed by #10675
Labels
A-lifetimes Area: Lifetimes / regions E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@huonw
Copy link
Member

huonw commented Nov 19, 2013

e.g.

fn a<'type, 'struct, 'fn>() {}

is currently valid, but shouldn't be. (Note that 'static is, and should remain, a valid lifetime.)

@huonw
Copy link
Member Author

huonw commented Nov 19, 2013

Note that this will only be possible after a snapshot, since the snapshot compiler currently requires lifetimes called 'self.

(Tagged easy although asking for some guidance in IRC may be useful since the parser isn't exactly easy to navigate.)

@thestinger
Copy link
Contributor

Why do we need to disallow this?

@huonw
Copy link
Member Author

huonw commented Nov 24, 2013

Consistency, maybe? (@nikomatsakis suggested it.)

@nikomatsakis
Copy link
Contributor

@thestinger motivation was both consistency and to allow for possible future special uses. In particular I think 'self could possibly be put to better use in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lifetimes Area: Lifetimes / regions E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants