about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2018-08-19fix tidy errorsDonato Sciarra-10/+13
2018-08-19mv codemap source_mapDonato Sciarra-11/+11
2018-08-19mv codemap() source_map()Donato Sciarra-41/+41
2018-08-19mv (mod) codemap source_mapDonato Sciarra-47/+47
2018-08-19mv filemap source_fileDonato Sciarra-91/+91
2018-08-19mv FileMap SourceFileDonato Sciarra-40/+40
2018-08-19mv CodeMap SourceMapDonato Sciarra-72/+72
2018-08-19Auto merge of #51131 - qnighy:unsized-locals, r=eddybbors-0/+3
Implement Unsized Rvalues This PR is the first step to implement RFC1909: unsized rvalues (#48055). ## Implemented - `Sized` is removed for arguments and local bindings. (under `#![feature(unsized_locals)]`) - Unsized locations are allowed in MIR - Unsized places and operands are correctly translated at codegen ## Not implemented in this PR - Additional `Sized` checks: - tuple struct constructor (accidentally compiles now) - closure arguments at closure generation (accidentally compiles now) - upvars (ICEs now) - Generating vtable for `fn method(self)` (ICEs now) - VLAs: `[e; n]` where `n` isn't const - Reduce unnecessary allocations ## Current status - [x] Fix `__rust_probestack` (rust-lang-nursery/compiler-builtins#244) - [x] Get the fix merged - [x] `#![feature(unsized_locals)]` - [x] Give it a tracking issue number - [x] Lift sized checks in typeck and MIR-borrowck - [ ] <del>Forbid `A(unsized-expr)`</del> will be another PR - [x] Minimum working codegen - [x] Add more examples and fill in unimplemented codegen paths - [ ] <del>Loosen object-safety rules (will be another PR)</del> - [ ] <del>Implement `Box<FnOnce>` (will be another PR)</del> - [ ] <del>Reduce temporaries (will be another PR)</del>
2018-08-19Add #![feature(unsized_locals)].Masaki Hara-0/+3
2018-08-18Auto merge of #52592 - eddyb:or-default, r=Mark-Simulacrumbors-4/+3
Use the new Entry::or_default method where possible.
2018-08-18Auto merge of #53324 - alexreg:self_in_typedefs, r=eddybbors-15/+21
`Self` in type definitions (self_in_typedefs) This implements the [`self_in_typedefs` feature](https://github.com/rust-lang/rfcs/blob/master/text/2300-self-in-typedefs.md) ([tracking issue 49303](https://github.com/rust-lang/rust/issues/49303)). r? @eddyb CC @Centril
2018-08-18Added feature gate.Alexander Regueiro-15/+21
2018-08-18Use the new Entry::or_default method where possible.Eduard-Mihai Burtescu-4/+3
2018-08-17Auto merge of #50911 - petrochenkov:macuse, r=alexcrichtonbors-24/+6
Stabilize `use_extern_macros` Closes https://github.com/rust-lang/rust/issues/35896
2018-08-17Rollup merge of #53413 - eddyb:featured-in-the-latest-edition, r=varkorCorey Farwell-23/+56
Warn that `#![feature(rust_2018_preview)]` is implied when the edition is set to Rust 2018. cc @varkor @petrochenkov @joshtriplett
2018-08-17Stabilize `use_extern_macros`Vadim Petrochenkov-24/+6
2018-08-16Auto merge of #53433 - kennytm:rollup, r=kennytmbors-12/+43
Rollup of 10 pull requests Successful merges: - #52946 (Documented impl From on line 367 of libserialize/json.rs) - #53234 (Remove Travis shutdown debug scripts, and remove CI-specific DNS settings) - #53313 (Two small improvements) - #53360 (Addressed #51602) - #53364 (Warn if the user tries to use GATs) - #53373 (Tweak unclosed delimiter parser error) - #53377 (std: Use target_pointer_width for BACKTRACE_ELF_SIZE) - #53395 (Use #[non_exhaustive] on internal enums) - #53399 (Tidy: ignore non-Markdown files when linting for the Unstable Book) - #53412 (syntax_ext: remove leftover span_err_if_not_stage0 macro.)
2018-08-17Rollup merge of #53373 - estebank:unclosed, r=petrochenkovkennytm-11/+21
Tweak unclosed delimiter parser error
2018-08-17Rollup merge of #53364 - varkor:gat-warn-broken, r=pnkfelixkennytm-0/+15
Warn if the user tries to use GATs GATs are currently broken, but still accessible behind a feature gate. This leads to people attempting to use them and then immediately encountering ICEs (or other broken behaviour). Here, we emit a warning if the user tries to use any feature associated with GATs, hopefully making it obvious that ICEs and the like are expected. For the meantime, this seems better than continually getting reported errors (for example: [here](https://github.com/rust-lang/rust/issues?q=is%3Aissue+gat+is%3Aclosed) and [here](https://github.com/rust-lang/rust/issues?utf8=%E2%9C%93&q=is%3Aissue+generic_associated_types+is%3Aclosed)).
2018-08-17Rollup merge of #53360 - PramodBisht:issue/51602, r=estebankkennytm-1/+7
Addressed #51602 Fixed #51602 r? @estebank here I have addressed the case where `in` was not expected right after `if` block. Speaking of `type ascription` I am not sure if this the best approach which I have implemented. Plus I think one more test case can be added to test `type-ascription` case, though I don't have any at this point of time. I will ping you again if all existing testcases pass.
2018-08-16Auto merge of #53304 - dtolnay:extend, r=dtolnaybors-16/+265
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-16syntax: also warn about edition "umbrella" features being implied by --edition.Eduard-Mihai Burtescu-13/+22
2018-08-16Auto merge of #53293 - petrochenkov:gramattr2, r=alexcrichtonbors-27/+53
syntax: Enforce attribute grammar in the parser Also fix feature-gating for `unrestricted_attribute_tokens` that was introduced in https://github.com/rust-lang/rust/pull/53270, but was actually broken. cc https://github.com/rust-lang/rust/pull/50911
2018-08-16Auto merge of #53289 - ljedrz:improve_lexer, r=michaelwoeristerbors-74/+134
A few cleanups and minor improvements for the lexer - improve readability by adjusting the formatting of some function signatures and adding some newlines - reorder some functions for easier reading - remove redundant `'static` in `const`s - remove some explicit `return`s - read directly to a `String` in `gather_comments_and_literals` - change `unwrap_or!` (macro) to `unwrap_or` (function) - move an `assert!`ion from `try_next_token` (called in a loop) to `try_real_token` after all calls to `try_next_token` - `#[inline]` some one-liner functions - assign directly from an `if-else` expression - refactor a `match` to `map_or` - add a `token::is_irrelevant` function to detect tokens that are not "`real`"
2018-08-16syntax: process all edition features before other features.Eduard-Mihai Burtescu-10/+34
2018-08-15Do not emit "incorrect close delimiter" twice in the same placeEsteban Küber-11/+19
2018-08-15Tweak unclosed delimiter parser errorEsteban Küber-2/+4
2018-08-15Warn when `generic_associated_types` feature gate is enabledvarkor-0/+15
2018-08-15syntax: Enforce attribute grammar in the parserVadim Petrochenkov-27/+53
2018-08-14Adddressed #51602Pramod Bisht-1/+7
2018-08-14Auto merge of #53085 - ljedrz:cleanup_syntax_structures, r=ljedrzbors-268/+131
Move SmallVector and ThinVec out of libsyntax - move `libsyntax::util::SmallVector` tests to `librustc_data_structures::small_vec` - remove `libsyntax::util::SmallVector` - move `libsyntax::util::thin_vec` to `librustc_data_structures::thin_vec` Other than moving these data structures where they belong it allows modules using `SmallVector<T>` (`SmallVec<[T; 1]>`) to specify their own length (e.g. 8 or 32) independently from `libsyntax`.
2018-08-14rustc_resolve: fix special-case for one-segment import paths.Eduard-Mihai Burtescu-1/+1
2018-08-14syntax: gensym the injected std/core extern crates in the Rust 2018 edition.Eduard-Mihai Burtescu-7/+30
2018-08-13Address review of RcVecDavid Tolnay-10/+5
2018-08-14syntax: add `uniform_paths` feature-gate.Eduard-Mihai Burtescu-0/+3
2018-08-13Move SmallVec and ThinVec out of libsyntaxljedrz-268/+131
2018-08-13Auto merge of #53270 - petrochenkov:macuse-regr, r=alexcrichtonbors-21/+25
Fix a few regressions from enabling macro modularization The first commit restores the old behavior for some minor unstable stuff (`rustc_*` and `derive_*` attributes) and adds a new feature gate for arbitrary tokens in non-macro attributes. The second commit fixes https://github.com/rust-lang/rust/issues/53205 The third commit fixes https://github.com/rust-lang/rust/issues/53144. Same technique is used as for other things blocking expansion progress - if something causes indeterminacy too often, then prohibit it. In this case referring to crate-local macro-expanded `#[macro_export]` macros via module-relative paths is prohibited, see comments in code for more details. cc https://github.com/rust-lang/rust/pull/50911
2018-08-13A few cleanups and minor improvements for the lexerljedrz-74/+134
2018-08-12TokenStream::extendDavid Tolnay-16/+270
2018-08-13Auto merge of #53051 - varkor:trait-method-pattern-arguments-error, ↵bors-15/+54
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-12Rollup merge of #53230 - memoryruins:nll_bootstrap_4, r=nikomatsakisGuillaume Gomez-0/+1
[nll] enable feature(nll) on various crates for bootstrap: part 4 #53172 r? @nikomatsakis
2018-08-12Rollup merge of #53019 - ljedrz:bad_collects, r=estebankGuillaume Gomez-1/+5
Don't collect() when size_hint is useless This adjusts PRs #52738 and #52697 by falling back to calculating capacity and extending or pushing in a loop where `collect()` can't be trusted to calculate the right capacity. It is a performance win.
2018-08-11Clean up and add extra testsvarkor-12/+3
2018-08-11Add E0642 to parser errorvarkor-3/+6
2018-08-11Emit an error during parsingvarkor-42/+62
2018-08-11Improve diagnosticsvarkor-1/+1
2018-08-11Fix handling of trait methods with bodies and improve efficiencyvarkor-19/+30
2018-08-11Emit error for pattern arguments in trait methodsvarkor-20/+34
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-11Feature gate arbitrary tokens in non-macro attributes with a separate gateVadim Petrochenkov-21/+25
Feature gate `rustc_` and `derive_` with their own gates again instead of `custom_attribute`
2018-08-10Rollup merge of #53183 - estebank:println-comma, r=oli-obkkennytm-15/+37
Suggest comma when missing in macro call When missing a comma in a macro call, suggest it, regardless of position. When a macro call doesn't match any of the patterns, check if the call's token stream could be missing a comma between two idents, and if so, create a new token stream containing the comma and try to match against the macro patterns. If successful, emit the suggestion. This works on arbitrary macros, with no need of special support from the macro writers. ``` error: no rules expected the token `d` --> $DIR/missing-comma.rs:26:18 | LL | foo!(a, b, c d, e); | -^ | | | help: missing comma here ``` Follow up to #52397.