about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-03-06Always emit mismatched delim errors, never panicEsteban Küber-3/+2
2019-03-06Collect unclosed delimiters in parent parserEsteban Küber-4/+13
2019-03-06Emit missing unclosed delimiter errorsEsteban Küber-11/+15
2019-03-06Panic when unmatched delimiters aren't emittedEsteban Küber-1/+8
2019-03-06Emit unclosed delimiters during recoveryEsteban Küber-0/+1
2019-03-06Bail when encountering a second unexpected token in the same spanEsteban Küber-4/+10
2019-03-06Do not panic on missing close parenEsteban Küber-1/+3
Fix #58856.
2019-03-06Surround found token with `Esteban Küber-1/+1
2019-03-05On incorrect cfg literal/identifier, point at the right spanEsteban Küber-1/+1
2019-03-02Fix C-variadic function printingDan Robertson-3/+0
There is no longer a need to append the string `", ..."` to a functions args as `...` is parsed as an argument and will appear in the functions arguments.
2019-03-01Expand where negative supertrait specific error is shownEsteban Küber-24/+28
Fix #58857.
2019-02-28Auto merge of #57760 - dlrobertson:varargs1, r=alexregbors-67/+95
Support defining C compatible variadic functions ## Summary Add support for defining C compatible variadic functions in unsafe rust with `extern "C"` according to [RFC 2137]. ## Details ### Parsing When parsing a user defined function that is `unsafe` and `extern "C"` allow variadic signatures and inject a "spoofed" `VaList` in the new functions signature. This allows the user to interact with the variadic arguments via a `VaList` instead of manually using `va_start` and `va_end` (See [RFC 2137] for details). ### Codegen When running codegen for a variadic function, remove the "spoofed" `VaList` from the function signature and inject `va_start` when the arg local references are created for the function and `va_end` on return. ## TODO - [x] Get feedback on injecting `va_start/va_end` in MIR vs codegen - [x] Properly inject `va_end` - It seems like it should be possible to inject `va_end` on the `TerminatorKind::Return`. I just need to figure out how to get the `LocalRef` here. - [x] Properly call Rust defined C variadic functions in Rust - The spoofed `VaList` causes problems here. Related to: #44930 r? @ghost [RFC 2137]: https://github.com/rust-lang/rfcs/blob/master/text/2137-variadic.md
2019-02-27Rename variadic to c_variadicDan Robertson-29/+29
Function signatures with the `variadic` member set are actually C-variadic functions. Make this a little more explicit by renaming the `variadic` boolean value, `c_variadic`.
2019-02-27Add c_variadic language feature itemDan Robertson-0/+12
2019-02-27Support defining C compatible variadic functionsDan Robertson-50/+66
Add support for defining C compatible variadic functions in unsafe rust with extern "C".
2019-02-27Rollup merge of #58761 - Mark-Simulacrum:add-feature-gate-unwind, r=CentrilMazdak Farrokhzad-2/+2
Add tracking issue for the unwind attribute cc https://github.com/rust-lang/rust/issues/58760
2019-02-27Rollup merge of #58748 - hellow554:scoped_tls, r=estebankMazdak Farrokhzad-1/+1
update scoped_tls to 1.0 scoped_tls has been updated to version 1.0 This PR will hopefully merge flawlessly :) This fixes, among others, https://github.com/alexcrichton/scoped-tls/issues/9 Note, that the nightly feature has been removed in https://github.com/alexcrichton/scoped-tls/commit/64bd7b84a1765fb72a32caed3c17c970bdc6ad57
2019-02-27Rollup merge of #58678 - doctorn:refuse-async-fn-2015-edition, r=varkorMazdak Farrokhzad-22/+46
Deny `async fn` in 2015 edition This commit prevents code using `async fn` from being compiled in Rust 2015 edition. Compiling code of the form: ```rust async fn foo() {} ``` Will now result in the error: ``` error[E0670]: `async fn` is not permitted in the 2015 edition --> async.rs:1:1 | 1 | async fn foo() {} | ^^^^^ error: aborting due to error For more information about an error, try `rustc --explain E0670`. ``` This resolves #58652 and also resolves #53714. r? @varkor
2019-02-27Rollup merge of #58630 - nnethercote:fix-fold_clobber, r=petrochenkovMazdak Farrokhzad-2/+10
Make `visit_clobber` panic-safe. Local measurements indicate the performance effect is negligible. r? @petrochenkov
2019-02-27Rollup merge of #58075 - asettouf:master, r=varkorMazdak Farrokhzad-6/+12
Fix for issue #58050 Hi, a quick PR to mention in the compiler error message that `?` is a macro operator, as according to issue #58050 It passed `python x.py test src/tools/tidy` locally, as well as the recommendation to run `/x.py test src/test/ui --stage 1 --bless`. Let me know if anything else is needed.
2019-02-27Mention `unwind(aborts)` in diagnostics for `#[unwind]`Vadim Petrochenkov-32/+18
Simplify input validation for `#[unwind]`, add tests
2019-02-26Add tracking issue for the unwind attribute.Mark Rousskov-2/+2
2019-02-26Changing error message to reflect changes with the 2018 editionAdonis-6/+12
Signed-off-by: Adonis <adonis.settouf@gmail.com> Update src/libsyntax/ext/tt/quoted.rs Co-Authored-By: asettouf <adonis.settouf@gmail.com> Update src/libsyntax/ext/tt/quoted.rs Co-Authored-By: asettouf <adonis.settouf@gmail.com> Update src/libsyntax/ext/tt/quoted.rs Co-Authored-By: asettouf <adonis.settouf@gmail.com> Update src/libsyntax/ext/tt/quoted.rs Co-Authored-By: asettouf <adonis.settouf@gmail.com> Update src/libsyntax/ext/tt/quoted.rs Co-Authored-By: asettouf <adonis.settouf@gmail.com> Update src/libsyntax/ext/tt/quoted.rs Co-Authored-By: asettouf <adonis.settouf@gmail.com> Update src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep.stderr Co-Authored-By: asettouf <adonis.settouf@gmail.com> Update src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep.stderr Co-Authored-By: asettouf <adonis.settouf@gmail.com> Stabilize split_ascii_whitespace Tracking issue FCP to merge: https://github.com/rust-lang/rust/issues/48656#issuecomment-442372750 fix stabilization order of uniform_paths. hir: add HirId to main Hir nodes Fix `std::os::fortanix_sgx::usercalls::raw::UsercallNrs` Fixes https://github.com/fortanix/rust-sgx/issues/88 Update src/libsyntax/ext/tt/quoted.rs Co-Authored-By: asettouf <adonis.settouf@gmail.com> Revert "Merge remote-tracking branch 'upstream/master'" This reverts commit 751f05bd155e2c55d4177fe8211df634faf3a644, reversing changes made to 545a3e62b0cb473108869a61b271bc589afb49da.
2019-02-26update scoped_tls to 1.0Marcel Hellwig-1/+1
2019-02-26Make `visit_clobber` panic-safe.Nicholas Nethercote-2/+10
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-24Deny `async fn` in 2015 editionNathan Corbyn-22/+46
Fix style issues and update diagnostic messages Update src/librustc_passes/diagnostics.rs Co-Authored-By: doctorn <me@nathancorbyn.com> Deny nested `async fn` in Rust 2015 edition Deny nested `async fn` in Rust 2015 edition Deny nested `async fn` in Rust 2015 edition
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