about summary refs log tree commit diff
path: root/src/libsyntax/lib.rs
AgeCommit message (Collapse)AuthorLines
2019-01-02make `panictry!` private to libsyntaxAndy Russell-2/+0
This commit completely removes usage of the `panictry!` macro from outside libsyntax. The macro causes parse errors to be fatal, so using it in libsyntax_ext caused parse failures *within* a syntax extension to be fatal, which is probably not intended. Furthermore, this commit adds spans to diagnostics emitted by empty extensions if they were missing, à la #56491.
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-12Remove `RcVec` and `RcSlice`.Nicholas Nethercote-6/+0
They're both unused now.
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-12-04Use iterator and pattern APIs instead of `char_at`Shotaro Yamada-1/+0
2018-11-27remove uses of feature gateMark Mansi-1/+0
2018-11-12Make `NodeId` a `newtype_index` to enable niche optimizationsOliver Scherer-1/+2
2018-11-02implement existing parser fns in terms of fallible fnsQuietMisdreavus-0/+17
2018-09-27Bump to 1.31.0 and bootstrap from 1.30 betaJosh Stone-1/+1
2018-09-26Remove OneVectorljedrz-1/+0
2018-09-18Merge indexed_set.rs into bitvec.rs, and rename it bit_set.rs.Nicholas Nethercote-5/+5
Currently we have two files implementing bitsets (and 2D bit matrices). This commit combines them into one, taking the best features from each. This involves renaming a lot of things. The high level changes are as follows. - bitvec.rs --> bit_set.rs - indexed_set.rs --> (removed) - BitArray + IdxSet --> BitSet (merged, see below) - BitVector --> GrowableBitSet - {,Sparse,Hybrid}IdxSet --> {,Sparse,Hybrid}BitSet - BitMatrix --> BitMatrix - SparseBitMatrix --> SparseBitMatrix The changes within the bitset types themselves are as follows. ``` OLD OLD NEW BitArray<C> IdxSet<T> BitSet<T> -------- ------ ------ grow - grow new - (remove) new_empty new_empty new_empty new_filled new_filled new_filled - to_hybrid to_hybrid clear clear clear set_up_to set_up_to set_up_to clear_above - clear_above count - count contains(T) contains(&T) contains(T) contains_all - superset is_empty - is_empty insert(T) add(&T) insert(T) insert_all - insert_all() remove(T) remove(&T) remove(T) words words words words_mut words_mut words_mut - overwrite overwrite merge union union - subtract subtract - intersect intersect iter iter iter ``` In general, when choosing names I went with: - names that are more obvious (e.g. `BitSet` over `IdxSet`). - names that are more like the Rust libraries (e.g. `T` over `C`, `insert` over `add`); - names that are more set-like (e.g. `union` over `merge`, `superset` over `contains_all`, `domain_size` over `num_bits`). Also, using `T` for index arguments seems more sensible than `&T` -- even though the latter is standard in Rust collection types -- because indices are always copyable. It also results in fewer `&` and `*` sigils in practice.
2018-09-11stabalize infer outlives requirements (RFC 2093).toidiu-1/+0
Co-authored-by: nikomatsakis
2018-08-24check that adding infer-outlives requirement to all crates worksNiko Matsakis-0/+1
2018-08-23Auto merge of #53384 - gootorov:use-servo-smallvec, r=michaelwoeristerbors-0/+2
Use optimized SmallVec implementation This PR replaces current SmallVec implementation with the one from the Servo project. Closes https://github.com/rust-lang/rust/issues/51640 r? @Mark-Simulacrum
2018-08-23Auto merge of #52602 - scottmcm:tryblock-expr, r=nikomatsakisbors-1/+1
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-23Use optimized SmallVec implementationIgor Gutorov-0/+2
2018-08-19Switch out another use of `do catch`Scott McMurray-1/+1
2018-08-19mv (mod) codemap source_mapDonato Sciarra-1/+1
2018-08-16Auto merge of #53304 - dtolnay:extend, r=dtolnaybors-0/+3
TokenStream::extend Two new insta-stable impls in libproc_macro: ```rust impl Extend<TokenTree> for TokenStream impl Extend<TokenStream> for TokenStream ``` `proc_macro::TokenStream` already implements `FromIterator<TokenTree>` and `FromIterator<TokenStream>` so I elected to support the same input types for `Extend`. **This commit reduces compile time of Serde derives by 60% (takes less than half as long to compile)** as measured by building our test suite: ```console $ git clone https://github.com/serde-rs/serde $ cd serde/test_suite $ cargo check --tests --features proc-macro2/nightly $ rm -f ../target/debug/deps/libtest_*.rmeta $ time cargo check --tests --features proc-macro2/nightly Before: 20.8 seconds After: 8.6 seconds ``` r? @alexcrichton
2018-08-13Move SmallVec and ThinVec out of libsyntaxljedrz-4/+2
2018-08-12TokenStream::extendDavid Tolnay-0/+3
2018-08-13Auto merge of #53051 - varkor:trait-method-pattern-arguments-error, ↵bors-0/+1
r=petrochenkov Emit error for pattern arguments in trait methods The error and check for this already existed, but the parser didn't try to parse trait method arguments as patterns, so the error was never emitted. This surfaces the error, so we get better errors than simple parse errors. This improves the error message described in https://github.com/rust-lang/rust/issues/53046. r? @petrochenkov
2018-08-11Emit error for pattern arguments in trait methodsvarkor-0/+1
The error and check for this already existed, but the parser didn't try to parse trait method arguments as patterns, so the error was never emitted. This surfaces the error, so we get better errors than simple parse errors.
2018-08-09[nll] libsyntax: enable feature(nll) for bootstrapmemoryruins-0/+1
2018-08-05Remove unnecessary or invalid feature attributesvarkor-1/+0
2018-08-01Split out growth functionality into BitVector typeMark Rousskov-2/+2
2018-08-01Switch syntax attribute tracking to BitVectorMark Rousskov-4/+8
2018-07-25Deny bare_trait_objects globallyTatsuyuki Ishi-2/+0
2018-07-23Extend ParseSess to support buffering lintsmark-0/+2
2018-07-10Deny bare trait objects in in src/libsyntaxljedrz-0/+2
2018-06-23expansion: Improve searchability for `AstFragments` methodsVadim Petrochenkov-4/+5
2018-06-09Crate-ify and delete unused code in syntax::parseMark Simulacrum-0/+1
2018-05-17Move definition of `Edition` from libsyntax to libsyntax_posVadim Petrochenkov-2/+1
2018-05-13Add a Rayon thread poolJohn Kåre Alsaker-2/+2
2018-05-03Use escape_default() for strings in LitKind::token().Nicholas Nethercote-0/+1
This avoids converting every char to \u{...} form, which bloats the resulting strings unnecessarily. It also provides consistency with the existing escape_default() calls in LitKind::token() used for raw string literals, char literals, and raw byte char literals. There are two benefits from this change. - Compilation is faster. Most of the rustc-perf benchmarks see a non-trivial speedup, particularly for incremental rebuilds, with the best speedup over 13%, and multiple others over 10%. - Generated rlibs are smaller. An extreme example is libfutures.rlib, which shrinks from 2073306 bytes to 1765927 bytes, a 15% reduction.
2018-04-26rustc_target: move in syntax::abi and flip dependency.Irina Popa-5/+1
2018-04-12Auto merge of #49698 - SimonSapin:unicode-for-everyone, r=alexcrichtonbors-2/+2
Merge the std_unicode crate into the core crate [The standard library facade](https://github.com/rust-lang/rust/issues/27783) has historically contained a number of crates with different roles, but that number has decreased over time. `rand` and `libc` have moved to crates.io, and [`collections` was merged into `alloc`](https://github.com/rust-lang/rust/pull/42648). Today we have `core` that applies everywhere, `std` that expects a full operating system, and `alloc` in-between that only requires a memory allocator (which can be provided by users)… and `std_unicode`, which doesn’t really have a reason to be separate anymore. It contains functionality based on Unicode data tables that can be large, but as long as relevant functions are not called the tables should be removed from binaries by linkers. This deprecates the unstable `std_unicode` crate and moves all of its contents into `core`, replacing them with `pub use` reexports. The crate can be removed later. This also removes the `CharExt` trait (replaced with inherent methods in libcore) and `UnicodeStr` trait (merged into `StrExt`). There traits were both unstable and not intended to be used or named directly. A number of new items are newly-available in libcore and instantly stable there, but only if they were already stable in libstd. Fixes #49319.
2018-04-12Mark the rest of the `unicode` feature flag as perma-unstable.Simon Sapin-1/+1
2018-04-12Deprecate the std_unicode crateSimon Sapin-1/+1
2018-04-11Rollup merge of #49525 - varkor:sort_by_cached_key-conversion, r=scottmcmkennytm-0/+1
Use sort_by_cached_key where appropriate A follow-up to https://github.com/rust-lang/rust/pull/48639, converting various slice sorting calls to `sort_by_cached_key` when the key functions are more expensive.
2018-04-11Auto merge of #49715 - Mark-Simulacrum:deny-warnings, r=alexcrichtonbors-1/+0
Move deny(warnings) into rustbuild This permits easier iteration without having to worry about warnings being denied. Fixes #49517
2018-04-10Auto merge of #49390 - Zoxc:sync-syntax, r=michaelwoeristerbors-0/+2
More thread-safety changes r? @michaelwoerister
2018-04-09Convert sort_by to sort_by_cached_keyvarkor-0/+1
2018-04-08Move deny(warnings) into rustbuildMark Simulacrum-1/+0
This permits easier iteration without having to worry about warnings being denied. Fixes #49517
2018-04-05Bump the bootstrap compiler to 1.26.0 betaAlex Crichton-2/+0
Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language features!
2018-03-28Stabilize match_default_bindingsTaylor Cramer-1/+1
This includes a submodule update to rustfmt in order to allow a stable feature declaration.
2018-03-28Make SyntaxExtension thread-safeJohn Kåre Alsaker-0/+2
2018-03-26Stabilize i128_typeMark Mansi-1/+1
2018-03-20rename epoch to editionKurtis Nusbaum-1/+1
2018-03-14Remove syntax and syntax_pos thread localsJohn Kåre Alsaker-0/+30