summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-04-06Fix fallout from #57667ishitatsuyuki-33/+6
2019-03-17Restore APIs used by clippyVadim Petrochenkov-0/+28
2019-03-17Do not accidentally treat multi-segment meta-items as single-segmentVadim Petrochenkov-113/+111
2019-03-16Rely on drop to emit unclosed delimsEsteban Küber-1/+0
2019-03-16Simplify codeEsteban Küber-24/+14
2019-03-16Always emit mismatched delim errors, never panicEsteban Küber-3/+2
2019-03-16Collect unclosed delimiters in parent parserEsteban Küber-4/+13
2019-03-16Emit missing unclosed delimiter errorsEsteban Küber-11/+15
2019-03-16Panic when unmatched delimiters aren't emittedEsteban Küber-1/+8
2019-03-16Emit unclosed delimiters during recoveryEsteban Küber-0/+1
2019-03-16Bail when encountering a second unexpected token in the same spanEsteban Küber-4/+10
2019-03-16Do not panic on missing close parenEsteban Küber-1/+3
Fix #58856.
2019-03-16Expand where negative supertrait specific error is shownEsteban Küber-24/+28
Fix #58857.
2019-02-25Stabilize `unrestricted_attribute_tokens`Vadim Petrochenkov-11/+7
2019-02-25Restrict value in key-value attributes to literalsVadim Petrochenkov-5/+15
2019-02-24Auto merge of #58315 - gnzlbg:returns_twice, r=alexcrichtonbors-0/+8
Implement unstable ffi_return_twice attribute This PR implements [RFC2633](https://github.com/rust-lang/rfcs/pull/2633) r? @eddyb
2019-02-24Rollup merge of #57364 - hdhoang:33418_negative_bounds, r=estebankMazdak Farrokhzad-21/+59
Improve parsing diagnostic for negative supertrait bounds closes #33418 r? @estebank
2019-02-23Correct error messagegnzlbg-1/+1
2019-02-23Implement ffi_returns_twice attributegnzlbg-0/+8
2019-02-23Rollup merge of #58654 - estebank:underflow, r=nikomatsakisMazdak Farrokhzad-4/+8
Do not underflow after resetting unmatched braces count Fix #58638. r? @oli-obk
2019-02-23Rollup merge of #58526 - pmccarter:master, r=estebankMazdak Farrokhzad-9/+44
Special suggestion for illegal unicode curly quote pairs Fixes #58436 Did not end up expanding the error message span to include the full string literal since I figured the start of the token was the issue, while the help suggestion span would include up to the closing quotation mark. The look ahead logic does not affect the reader position, not sure if that is an issue (if eg it should still continue to parse after the closing quote without erroring out).
2019-02-23Rollup merge of #58476 - nnethercote:rm-LazyTokenStream, r=petrochenkovMazdak Farrokhzad-215/+156
Remove `LazyTokenStream`. `LazyTokenStream` was added in #40939. Perhaps it was an effective optimization then, but no longer. This PR removes it, making the code both simpler and faster. r? @alexcrichton
2019-02-23Improve parsing diagnostic for negative supertrait boundsHoàng Đức Hiếu-21/+59
2019-02-22Do not underflow after resetting unmatched braces countEsteban Küber-4/+8
Fix #58638.
2019-02-22Rollup merge of #58589 - matklad:remove-hack, r=petrochenkovMazdak Farrokhzad-4/+2
cleanup macro after 2018 transition We can now use `?`
2019-02-22Rollup merge of #58588 - matklad:dead-code, r=petrochenkovMazdak Farrokhzad-6/+0
remove a bit of dead code [Six years](https://github.com/rust-lang/rust/commit/5dc5efefd47527067ab5b7862d89a99da4824f49) seem to be a long enough transition period :rofl:
2019-02-22Rollup merge of #58198 - ↵Mazdak Farrokhzad-2/+15
igorsdv:suggest-removing-parentheses-surrounding-lifetimes, r=estebank Suggest removing parentheses surrounding lifetimes Fixes #57386. r? @estebank
2019-02-20cleanup macro after 2018 transitionAleksey Kladov-4/+2
We can now use `?`
2019-02-20remove a bit of dead codeAleksey Kladov-6/+0
2019-02-18Fix style nitsDan Robertson-2/+10
Fix style nits discovered in reading code.
2019-02-18Make `interpolated_to_tokenstream` a method on `Nonterminal`.Nicholas Nethercote-84/+83
2019-02-18Avoid a `clone()` in `transcribe()`.Nicholas Nethercote-11/+11
The current code (expensively) clones the value within an `Rc`. This commit changes things so that the `Rc` itself is (cheaply) cloned instead, avoid some allocations. This requires converting a few `Rc` instances to `Lrc`.
2019-02-18Remove `LazyTokenStream`.Nicholas Nethercote-110/+54
It's present within `Token::Interpolated` as an optimization, so that if a nonterminal is converted to a `TokenStream` multiple times, the first-computed value is saved and reused. But in practice it's not needed. `interpolated_to_tokenstream()` is a cold function: it's only called a few dozen times while compiling rustc itself, and a few hundred times across the entire `rustc-perf` suite. Furthermore, when it is called, it is almost always the first conversion, so no benefit is gained from it. So this commit removes `LazyTokenStream`, along with the now-unnecessary `Token::interpolated()`. As well as a significant simplification, the removal speeds things up slightly, mostly due to not having to `drop` the `LazyTokenStream` instances.
2019-02-18Change `Token::interpolated_to_tokenstream()`.Nicholas Nethercote-33/+31
It is currently a method of `Token`, but it only is valid to call if `self` is a `Token::Interpolated`. This commit eliminates the possibility of misuse by changing it to an associated function that takes a `Nonterminal`, which also simplifies the call sites. This requires splitting out a new function, `nonterminal_to_string`.
2019-02-16help suggestion when trying to delimit string literals with directed unicode ↵Patrick McCarter-9/+44
quotes #58436
2019-02-16Rollup merge of #58074 - scottmcm:stabilize-sort_by_cached_key, r=SimonSapinkennytm-1/+0
Stabilize slice_sort_by_cached_key I was going to ask on the tracking issue (https://github.com/rust-lang/rust/issues/34447), but decided to just send this and hope for an FCP here. The method was added last March by https://github.com/rust-lang/rust/pull/48639. Signature: https://doc.rust-lang.org/std/primitive.slice.html#method.sort_by_cached_key ```rust impl [T] { pub fn sort_by_cached_key<K, F>(&mut self, f: F) where F: FnMut(&T) -> K, K: Ord; } ``` That's an identical signature to the existing `sort_by_key`, so I think the questions are just naming, implementation, and the usual "do we want this?". The implementation seems to have proven its use in rustc at least, which many uses: https://github.com/rust-lang/rust/search?l=Rust&q=sort_by_cached_key (I'm asking because it's exactly what I just needed the other day: ```rust all_positions.sort_by_cached_key(|&n| data::CITIES.iter() .map(|x| *metric_closure.get_edge(n, x.pos).unwrap()) .sum::<usize>() ); ``` since caching that key is a pretty obviously good idea.) Closes #34447
2019-02-12Stabilize slice_sort_by_cached_keyScott McMurray-1/+0
2019-02-13Rollup merge of #58387 - alexreg:fix-trait-alias-2, r=centrilMazdak Farrokhzad-1/+7
Disallow `auto` trait alias syntax See https://github.com/rust-lang/rust/issues/41517#issuecomment-462567679. r? @Centril CC @topecongiro @nikomatsakis
2019-02-13Rollup merge of #58273 - taiki-e:rename-dependency, r=matthewjasperMazdak Farrokhzad-32/+31
Rename rustc_errors dependency in rust 2018 crates I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules. Related: rust-lang/cargo#5653 cc #58099 r? @Centril
2019-02-13Rollup merge of #58166 - euclio:deprecation-shorthand, r=petrochenkovMazdak Farrokhzad-63/+78
allow shorthand syntax for deprecation reason Fixes #48271. Created based on discussion in #56896.
2019-02-12Auto merge of #58051 - SimonSapin:str_escape, r=alexcrichtonbors-3/+2
Stabilize str::escape_* methods with new return types… … that implement `Display` and `Iterator<Item=char>`, as proposed in FCP: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-289/+300
Cosmetic improvements to doc comments This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-13Cleanup importsTaiki Endo-17/+18
2019-02-13Rename rustc_errors dependency in rust 2018 cratesTaiki Endo-27/+25
2019-02-12Auto merge of #58098 - oli-obk:maybe_allow_internal_unstable, r=petrochenkovbors-34/+75
Require a list of features in `#[allow_internal_unstable]` The blanket-permission slip is not great and will likely give us trouble some point down the road.
2019-02-12Stabilize str::escape_* methodsSimon Sapin-1/+0
FCP: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727
2019-02-12New return types for str::escape_* that impl Display and Iterator<char>Simon Sapin-2/+2
As FCP’ed in the tracking issue: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727
2019-02-12Disallow `auto` trait alias syntax.Alexander Regueiro-1/+7
2019-02-11Parallel rustc needs synchronizing smart pointer cloningOliver Scherer-3/+3
2019-02-11Use `Rc<[Symbol]>` instead of `Vec<Symbol>` to reduce # of allocsOliver Scherer-17/+17