-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
refactor lexer to use idiomatic borrowing #62124
Conversation
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
One thing I find confusing is fn name_from(&self, start: BytePos) -> ast::Name {
debug!("taking an ident from {:?} to {:?}", start, self.pos);
Symbol::intern(self.str_from(start))
} It's not obvious that fn intern_from(&self, start: BytePos) -> Symbol {
debug!("taking an ident from {:?} to {:?}", start, self.pos);
Symbol::intern(self.str_from(start))
} would be better? If so, it makes sense to do this in this PR as well |
@matklad In this case the symbols are not necessarily identifiers, so they shouldn't use |
Makes sense, added the second commit with rename |
... and replaced the few remaning usages of |
Lexer uses Symbols for a lot of stuff, not only for identifiers, so the "name" terminology is just confusing.
@bors r+ |
📌 Commit 57db25e has been approved by |
refactor lexer to use idiomatic borrowing
refactor lexer to use idiomatic borrowing
Rollup of 8 pull requests Successful merges: - #60340 (Rename .cap() methods to .capacity()) - #61767 (Update new_debug_unreachable) - #62043 (Remove `FnBox`) - #62076 (Updated RELEASES.md for 1.36.0) - #62102 (call out explicitly that general read needs to be called with an initialized buffer) - #62104 (Inform the query system about properties of queries at compile time) - #62106 (Add more tests for async/await) - #62124 (refactor lexer to use idiomatic borrowing) Failed merges: r? @ghost
refactor lexer to use idiomatic borrowing
refactor lexer to use idiomatic borrowing
refactor lexer to use idiomatic borrowing
refactor lexer to use idiomatic borrowing
Rollup of 16 pull requests Successful merges: - #61878 (improve pinning projection docs) - #62043 (Remove `FnBox`) - #62067 (Add suggestion for missing `.await` keyword) - #62076 (Updated RELEASES.md for 1.36.0) - #62102 (call out explicitly that general read needs to be called with an initialized buffer) - #62106 (Add more tests for async/await) - #62124 (refactor lexer to use idiomatic borrowing) - #62131 (libsyntax: Fix some Clippy warnings) - #62152 (Don't ICE on item in `.await` expression) - #62154 (Remove old fixme) - #62155 (Add regression test for MIR drop generation in async loops) - #62156 (Update books) - #62160 (Remove outdated question_mark_macro_sep lint) - #62164 (save-analysis: use buffered writes) - #62171 (rustc: Retry SIGILL linker invocations) - #62176 (Update RLS) Failed merges: r? @ghost
No description provided.