about summary refs log tree commit diff
path: root/src/libsyntax_pos/symbol.rs
AgeCommit message (Collapse)AuthorLines
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-14Rollup merge of #56699 - nnethercote:SymbolIndex, r=oli-obkkennytm-22/+39
Use a `newtype_index!` within `Symbol`. This shrinks `Option<Symbol>` from 8 bytes to 4 bytes, which shrinks `Token` from 24 bytes to 16 bytes. This reduces instruction counts by up to 1% across a range of benchmarks. r? @oli-obk
2018-12-12Bump to 1.33.0Alex Crichton-1/+1
* Update bootstrap compiler * Update version to 1.33.0 * Remove some `#[cfg(stage0)]` annotations Actually updating the version number is blocked on updating Cargo
2018-12-12Use a `newtype_index!` within `Symbol`.Nicholas Nethercote-22/+39
This shrinks `Option<Symbol>` from 8 bytes to 4 bytes, which shrinks `Token` from 24 bytes to 16 bytes. This reduces instruction counts by up to 1% across a range of benchmarks.
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-21/+24
2018-12-06Auto merge of #56392 - petrochenkov:regensym, r=oli-obkbors-1/+5
Delay gensym creation for "underscore items" (`use foo as _`/`const _`) until name resolution So they cannot be cloned by macros. See https://github.com/rust-lang/rust/pull/56303 for the discussion. Mostly fix cross-crate use of underscore items by inverting the "gensyms are lost in metadata" bug as described in https://github.com/rust-lang/rust/pull/56303#issuecomment-442464695. Fix unused import warnings for single-segment imports (first commit) and `use crate_name as _` imports (as specified in https://github.com/rust-lang/rust/pull/56303#issuecomment-442274118). Prohibit accidentally implemented `static _: TYPE = EXPR;` (cc https://github.com/rust-lang/rust/pull/55983). Add more tests for `use foo as _` imports.
2018-12-04Address review commentsVadim Petrochenkov-4/+4
2018-12-04syntax: Rename some keywordsVadim Petrochenkov-6/+6
`CrateRoot` -> `PathRoot`, `::` doesn't necessarily mean crate root now `SelfValue` -> `SelfLower`, `SelfType` -> `SelfUpper`, both `self` and `Self` can be used in type and value namespaces now
2018-12-04syntax: `dyn` is a used keyword nowVadim Petrochenkov-5/+13
2018-12-02Delay gensym creation for "underscore items" until name resolutionVadim Petrochenkov-1/+5
Prohibit `static _` Fis unused import warnings for `use foo as _` Add more tests for `use foo as _`
2018-12-01Rollup merge of #56336 - nnethercote:clean-up-pp, r=nikomatsakiskennytm-0/+4
Clean up and streamline the pretty-printer Some minor improvements.
2018-11-29Use `Cow` in `Token::String`.Nicholas Nethercote-0/+4
`Printer::word` takes a `&str` and converts it into a `String`, which causes an allocation. But that allocation is rarely necessary, because `&str` is almost always a `&'static str` or a `String` that won't be used again. This commit changes `Token::String` so it holds a `Cow<'static, str>` instead of a `String`, which avoids a lot of allocations.
2018-11-27resolve: Implement edition hygiene for imports and absolute pathsVadim Petrochenkov-2/+1
Use per-span hygiene in a few other places in resolve Prefer `rust_2015`/`rust_2018` helpers to comparing editions
2018-10-19Prefer `Default::default` over `FxHash*::default` in struct constructorsOliver Scherer-11/+3
2018-09-16Treat `dyn` as a keyword in the 2018 editionvarkor-10/+9
2018-08-23Auto merge of #52602 - scottmcm:tryblock-expr, r=nikomatsakisbors-9/+11
Implement try block expressions I noticed that `try` wasn't a keyword yet in Rust 2018, so... ~~Fix​es https://github.com/rust-lang/rust/issues/52604~~ That was fixed by PR https://github.com/rust-lang/rust/pull/53135 cc https://github.com/rust-lang/rust/issues/31436 https://github.com/rust-lang/rust/issues/50412
2018-08-19Put `try` in the reserved list, not the in-use listScott McMurray-12/+5
2018-08-19Add `try` to syntax_pos as an edition-2018-only keywordScott McMurray-10/+19
2018-08-19Fix typos found by codespell.Matthias Krüger-1/+1
2018-07-18Implement existential typesOliver Schneider-0/+1
2018-06-30Address commentsVadim Petrochenkov-5/+5
2018-06-30hygiene: Implement transparent marksVadim Petrochenkov-0/+9
2018-06-28Fix rebaseVadim Petrochenkov-0/+5
2018-06-28Use `Ident`s for lifetimes in HIRVadim Petrochenkov-0/+4
2018-06-09Implement RFC 2421, 'Keyword unreservations (pure, sizeof, alignof, offsetof)'Havvy-22/+18
2018-06-04Add doc keyword supportGuillaume Gomez-0/+11
2018-05-26Add `Ident::as_str` helperVadim Petrochenkov-3/+7
2018-05-17Remove the `proc` keyword againVadim Petrochenkov-13/+7
2018-05-17Turn some functions from `token.rs` into methods on `Ident`Vadim Petrochenkov-1/+56
2018-05-17Add two keywords specific to editions 2015 and 2018 respectivelyVadim Petrochenkov-7/+11
2018-05-13Fix impl PartialOrd for InternedStringJohn Kåre Alsaker-1/+1
2018-05-10Allocate Symbol strings from an arenaJohn Kåre Alsaker-8/+32
2018-04-27Rename InternedString to LocalInternedString and introduce a new thread-safe ↵John Kåre Alsaker-28/+164
InternedString
2018-04-25Auto merge of #49986 - zofrex:better-derived-argument-names, r=Manishearthbors-0/+4
Provide better names for builtin deriving-generated attributes First attempt at fixing #49967 Not in love with any choices here, don't be shy if you aren't happy with anything :) I've tested that this produces nicer names in documentation, and that it no longer has issues conflicting with constants with the same name. (I guess we _could_ make a test for that... unsure if that would be valuable) In all cases I took the names from the methods as declared in the relevant trait. In some cases I had to prepend the names with _ otherwise there were errors about un-used variables. I'm uneasy with the inconsistency... do they all need to be like that? Is there a way to generate an alternate impl or use a different name (`_`?) in the cases where the arguments are not used? Lastly the gensym addition to Ident I implemented largely as suggested, but I want to point out it's a little circuitous (at least, as far as I understand it). `cx.ident_of(name)` is just `Ident::from_str`, so we create an Ident then another Ident from it. `Ident::with_empty_ctxt(Symbol::gensym(string))` may or may not be equivalent, I don't know if it's important to intern it _then_ gensym it. It seems like either we could use that, or if we do want a new method to make this convenient, it could be on Ident instead (`from_str_gensymed`?)
2018-04-23Use FxHashMap in syntax_pos::symbol::Interner::intern.Nicholas Nethercote-2/+2
Because it's faster than HashMap. This change reduces the time taken for a few of the rustc-perf benchmarks, mostly the small ones, by up to 5%.
2018-04-17Rollup merge of #49699 - zesterer:master, r=joshtriplettGuillaume Gomez-14/+13
Removed 'proc' from the reserved keywords list Remove 'proc' from the reserved keywords list. 'proc' is a very useful identifier name for a lot of things. It's especially useful when dealing with processes, operating system internals, and kernel development.
2018-04-15Provide better names for builtin deriving-generated attributesJames Sanderson-0/+4
2018-04-11Reenumerated symbolsJoshua Barretto-13/+13
2018-04-06Use `Ident` instead of `Name` in `MetaItem`Vadim Petrochenkov-7/+1
2018-04-06Get rid of `SpannedIdent`Vadim Petrochenkov-1/+6
2018-04-06Use `Span` instead of `SyntaxContext` in `Ident`Vadim Petrochenkov-8/+27
2018-04-05Merge pull request #1 from rust-lang/masterJoshua Barretto-1/+5
Merge upstream changes
2018-04-05Removed 'proc' from the reserved keywords listJoshua Barretto-1/+0
2018-03-23Rollup merge of #49030 - Zoxc:misc, r=michaelwoeristerAlex Crichton-1/+5
Misc changes from my parallel rustc branch r? @michaelwoerister
2018-03-17Make Span and Symbol implement Send and SyncJohn Kåre Alsaker-1/+5
2018-03-17syntax: Make `_` an identifierVadim Petrochenkov-61/+65
2018-03-14Remove syntax and syntax_pos thread localsJohn Kåre Alsaker-9/+10
2017-12-07Auto merge of #46497 - AgustinCB:issue-46311, r=petrochenkovbors-0/+10
Modify message for keyword as identifier name This is a temporary solution to #46311. The message is generic enough to cover both cases and is probably a fine enough solution to the specific problem described in the task. However, the underlying reason for this to be wrong is that `next_token_inner` returns `Lifetime` even if the token is a label. That's not simple, as the syntax for both can be quite similar and it may need to take a look to the next token to make a decision. I'm not sure I have enough knowledge about the project to be able to solve that (yet!), so I thought I'll fix the immediate problem first.
2017-12-07don't print self symbol's internal index unless gensymedNiko Matsakis-1/+10
It's just not useful. It also makes it hard to have tests that probe internal state, since the interning number is very sensitive. Dumping the number in the case of gensym is not ideal but will do for now.
2017-12-07remove unused testAgustin Chiappe Berrini-20/+0