Skip to content

Forbid keywords as lifetime parameters names. #10675

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

Merged
merged 1 commit into from
Dec 6, 2013

Conversation

LeoTestard
Copy link
Contributor

Fixes #10565.

'self is still allowed for the moment, as it is used everywhere in the codebase. And I'm not sure if it still has a special meaning currently or not.

&& !token::is_keyword(token::keywords::Static, tok)
&& !token::is_keyword(token::keywords::Self, tok) {
fatal_span(rdr, start, rdr.last_pos,
~"Invalid lifetime name");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: error messages start with a lowercase letter

@thestinger
Copy link
Contributor

@LeoTestard: 'self isn't special anymore, I'm not sure if the snapshot has landed for that. I'm not very enthusiastic about reserving a bunch more names though :).

@brson
Copy link
Contributor

brson commented Dec 5, 2013

Needs rebase.

@LeoTestard
Copy link
Contributor Author

@brson : done :)

bors added a commit that referenced this pull request Dec 6, 2013
Fixes #10565.

`'self` is still allowed for the moment, as it is used everywhere in the codebase. And I'm not sure if it still has a special meaning currently or not.
@bors bors closed this Dec 6, 2013
@bors bors merged commit 74757af into rust-lang:master Dec 6, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 23, 2023
[arithmetic_side_effects] Cache symbols

An internal-only modification to speed up the processing of symbols because "intern" isn't very cheap, even more when you are doing the same thing for every method expression.

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

Successfully merging this pull request may close these issues.

Disallow (most) reserved/keywords as lifetime names
5 participants