about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2018-10-15Rollup merge of #55025 - ehuss:missing-lifetime-err-msg, r=petrochenkovManish Goregaokar-5/+6
Add missing lifetime fragment specifier to error message. A very minor issue, `lifetime` was missing from the error list. I left `literal` in the list, even though it is unstable. It looks like it may stabilize soon anyways.
2018-10-14Support underscore as constant nameDonato Sciarra-1/+17
Issue: 54912
2018-10-12Add missing lifetime fragment specifier to error message.Eric Huss-5/+6
A very minor issue, `lifetime` was missing from the error list. I left `literal` in the list, even though it is unstable. It looks like it may stabilize soon anyways.
2018-10-12Rollup merge of #54967 - holmgr:master, r=estebankkennytm-0/+5
Remove incorrect span for second label inner macro invocation A fix for issue #54841
2018-10-12Auto merge of #53933 - GuillaumeGomez:codeblock-error-display, r=QuietMisdreavusbors-0/+13
Improve error display for codeblocks in rustdoc Part of #53919. r? @QuietMisdreavus
2018-10-11Auto merge of #54850 - mcr431:fix-54707-trait-function-from-macro, ↵bors-0/+17
r=nikomatsakis Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls Previously parsing trait items only handled opening brace token and semicolon, I added a branch to the match statement that will also handle interpolated blocks.
2018-10-10Rollup merge of #54893 - dsciarra:issue-54379, r=pnkfelixManish Goregaokar-0/+3
Fixes #47311. r? @nrc
2018-10-10Rollup merge of #54870 - flip1995:stabilize_tool_lints, r=ManishearthManish Goregaokar-3/+2
Fixes #47311. r? @nrc
2018-10-10Rollup merge of #54862 - Havvy:cfg_attr_multi, r=petrochenkovManish Goregaokar-18/+82
Fixes #47311. r? @nrc
2018-10-10Remove incorrect span for second label inner macro invocationholmgr-0/+5
2018-10-09Update feature-gate listingflip1995-3/+2
2018-10-08parse_trait_item_ now handles interpolated blocks as function body declsMatthew Russo-0/+17
2018-10-07cfg-attr-multi: Change issue number to actual tracking issueHavvy (Ryan Scheel)-1/+1
2018-10-07Auto merge of #54835 - ↵bors-23/+4
oli-obk:mögen_konstante_funktionen_doch_bitte_endlich_stabil_sein, r=Centril Stabilize `min_const_fn` tracking issue: #53555 r? @Centril
2018-10-07Fix internal compiler error on malformed match arm pattern.Donato Sciarra-0/+3
Issue: 54379
2018-10-07cfg_attr_multi: Feature gateHavvy (Ryan Scheel)-1/+38
2018-10-05cfg_attr_multi: Basic implementationHavvy (Ryan Scheel)-17/+44
Does not implement the warning or a feature flag.
2018-10-05Rollup merge of #54833 - abonander:issue-54441, r=petrochenkovPietro Albini-15/+12
make `Parser::parse_foreign_item()` return a foreign item or error Fixes `Parser::parse_foreign_item()` to follow the convention of `parse_trait_item()` and `parse_impl_item()` in that it *must* parse an item or return an error, and then the caller is responsible for detecting the closing delimiter. This prevents it from looping endlessly on an unexpected token in `ext/expand.rs` where it was also leaking memory by continually pushing to `Parser::expected_tokens` via `Parser::check_keyword()`. closes #54441 r? @petrochenkov cc @dtolnay
2018-10-05Rollup merge of #54804 - euclio:inverted-parameters, r=estebankPietro Albini-1/+20
add suggestion for inverted function parameters Fixes #54065.
2018-10-05add suggestion for inverted function parametersAndy Russell-1/+20
Fixes #54065.
2018-10-05Auto merge of #54336 - petrochenkov:preuni, r=alexcrichtonbors-47/+30
resolve: Some refactorings in preparation for uniform paths 2.0 The main result is that in-scope resolution performed during macro expansion / import resolution is now consolidated in a single function (`fn early_resolve_ident_in_lexical_scope`), which can now be used for resolving first import segments as well when uniform paths are enabled. r? @ghost
2018-10-05Stabilize min_const_fn feature gateOliver Scherer-13/+2
2018-10-05Auto merge of #52121 - jebrosen:macros2_feature, r=petrochenkovbors-17/+19
Merge `proc_macro_` expansion feature gates as `proc_macro_hygiene` Merges `proc_macro_mod`, `proc_macro_expr`, `proc_macro_non_items`, and `proc_macro_gen` into a single feature: `proc_macro_hygiene`. These features are not all blocked on implementing macro hygiene *per se*, but rather on interactions with hygiene that have not been entirely resolved.
2018-10-05make `Parser::parse_foreign_item()` return a foreign item or errorAustin Bonander-15/+12
closes #54441
2018-10-05Stabilize `min_const_fn`Oliver Schneider-10/+2
2018-10-05expansion: Remove restriction on use of macro attributes with test/benchVadim Petrochenkov-47/+30
The restrictions were introduced in https://github.com/rust-lang/rust/pull/54277 and no longer necessary now because legacy plugins are now expanded in usual left-to-right order
2018-10-04Rollup merge of #54777 - zackmdavis:async_pretty_ice, r=cramertjPietro Albini-0/+3
abolish ICE when pretty-printing async block @jnetterf reported an ICE when the unused-parentheses lint triggered around an async block (#54752). In order to compose an autofixable suggestion, the lint invokes the pretty-printer on the unnecessarily-parenthesized expression. (One wonders why the lint doesn't just use `SourceMap::span_to_snippet` instead, to preserve the formatting of the original source?—but to answer that, you'd have to ask the author of 5c9f806d.) But then the pretty-printer panics when trying to call `<pprust::State as PrintState>::end` when `State.boxes` is empty. Empirically, the problem would seem to be solved if we start some "boxes" beforehand in the `ast::ExprKind::Async` arm of the big match in `print_expr_outer_attr_style`, exactly like we do in the immediately-preceding match arm for `ast::ExprKind::Block`—it would seem pretty ("pretty") reasonable for the pretty-printing of async blocks to work a lot like the pretty-printing of ordinary non-async blocks, right?? Of course, it would be shamefully cargo-culty to commit code on the basis of this kind of mere reasoning-by-analogy (in contrast to understanding the design of the pretty-printer in such detail that the correctness of the patch is comprehended with all the lucid certainty of mathematical proof, rather than being merely surmised by intuition). But maybe we care more about fixing the bug with high probability today, than with certainty in some indefinite hypothetical future? Maybe the effort is worth [a fifth of a shirt](https://hacktoberfest.digitalocean.com/stats/zackmdavis)?? Humbly resolves #54752. r? @cramertj
2018-10-03Update error id to an unused oneOliver Schneider-2/+2
2018-10-03Only promote calls to `#[rustc_promotable]` const fnsOliver Schneider-1/+23
2018-10-02abolish ICE when pretty-printing async blockZack M. Davis-0/+3
Joshua Netterfield reported an ICE when the unused-parentheses lint triggered around an async block (#54752). In order to compose an autofixable suggestion, the lint invokes the pretty-printer on the unnecessarily-parenthesized expression. (One wonders why the lint doesn't just use `SourceMap::span_to_snippet` instead, to preserve the formatting of the original source?—but for that, you'd have to ask the author of 5c9f806d.) But then the pretty-printer panics when trying to call `<pprust::State as PrintState>::end` when `State.boxes` is empty. Empirically, the problem would seem to be solved if we start some "boxes" beforehand in the `ast::ExprKind::Async` arm of the big match in `print_expr_outer_attr_style`, exactly like we do in the immediately-preceding match arm for `ast::ExprKind::Block`—it would seem pretty ("pretty") reasonable for the pretty-printing of async blocks to work a lot like the pretty-printing of ordinary non-async blocks, right?? Of course, it would be shamefully cargo-culty to commit code on the basis of this kind of mere reasoning-by-analogy (in contrast to understanding the design of the pretty-printer in such detail that the correctness of the patch is comprehended with all the lucid certainty of mathematical proof, rather than being merely surmised by intuition). But maybe we care more about fixing the bug with high probability today, than with certainty in some indefinite hypothetical future? Maybe the effort is worth a fifth of a shirt?? Humbly resolves #54752.
2018-10-02Merge the `proc_macro_` expansion feature gates into a single ↵jeb-17/+19
`proc_macro_hygiene` gate.
2018-10-01Extra proc macro gates are now at #54727Alex Crichton-5/+5
2018-09-29Add a sentence before rustc errorsGuillaume Gomez-1/+3
2018-09-29Improve error display for codeblocks in rustdocGuillaume Gomez-0/+11
2018-09-27Bump to 1.31.0 and bootstrap from 1.30 betaJosh Stone-1/+1
2018-09-27Auto merge of #52319 - tinco:issue_12590, r=pnkfelixbors-12/+40
Track whether module declarations are inline (fixes #12590) To track whether module declarations are inline I added a field `inline: bool` to `ast::Mod`. The main use case is for pretty to know whether it should render the items associated with the module, but perhaps there are use cases for this information to not be forgotten in the AST.
2018-09-27Auto merge of #54581 - petrochenkov:cfgattr, r=alexcrichtonbors-0/+1
Accept trailing comma in `cfg_attr` Fixes https://github.com/rust-lang/rust/issues/54463 (stable-to-beta regression)
2018-09-26Auto merge of #53824 - ljedrz:begone_onevector, r=michaelwoeristerbors-95/+108
Remove OneVector, increase related SmallVec capacities Removes the `OneVector` type alias (equivalent to `SmallVec<[T; 1]>`); it is used in scenarios where the capacity of 1 is often exceeded, which might be nullifying the performance wins (due to spilling to the heap) expected when using `SmallVec` instead of `Vec`. The numbers I used in this PR are very rough estimates - it would probably be a good idea to adjust some/all of them, which is what this proposal is all about. It might be a good idea to additionally create some local type aliases for the `SmallVec`s in the `Folder` trait, as they are repeated in quite a few spots; I'd be happy to apply this sort of adjustments.
2018-09-26Remove OneVectorljedrz-95/+108
2018-09-26Auto merge of #54497 - ralexstokes:stabilize_pattern_parentheses, r=nikomatsakisbors-130/+195
Stabilize pattern_parentheses feature Addresses #51087 . Stabilizes the previously unstable feature `pattern_parentheses` which enables the use of `()` in match patterns.
2018-09-26Accept trailing comma in `cfg_attr`Vadim Petrochenkov-0/+1
2018-09-25Auto merge of #53542 - alexreg:impl-trait-in-bindings, r=cramertjbors-2/+5
`impl trait` in bindings (feature: impl-trait-existential-types) This PR enables `impl Trait` syntax (opaque types) to be used in bindings, e.g. * `let foo: impl Clone = 1;` * `static foo: impl Clone = 2;` * `const foo: impl Clone = 3;` This is part of [RFC 2071](https://github.com/rust-lang/rfcs/blob/master/text/2071-impl-trait-existential-types.md) ([tracking issue](https://github.com/rust-lang/rust/issues/34511)), but exists behind the separate feature gate `impl_trait_in_bindings`. CC @cramertj @oli-obk @eddyb @Centril @varkor
2018-09-25Auto merge of #53693 - scottmcm:marker-trait-attribute, r=nikomatsakisbors-0/+9
Support an explicit annotation for marker traits From the tracking issue for rust-lang/rfcs#1268: > It seems obvious that we should make a `#[marker]` annotation. ~ https://github.com/rust-lang/rust/issues/29864#issuecomment-368959441 This PR allows you to put `#[marker]` on a trait, at which point: - [x] The trait must not have any items ~~All of the trait's items must have defaults~~ - [x] Any impl of the trait must be empty (not override any items) - [x] But impls of the trait are allowed to overlap r? @nikomatsakis
2018-09-25Handle impl trait in MIR type checked for assignments.Matthew Jasper-2/+5
2018-09-23Fixed off-by-one span.David Wood-1/+1
Fixes the off-by-one span issue where closure argument spans were pointing to the token after the argument.
2018-09-23Auto merge of #54325 - michaelwoerister:incr-thinlto-tests, r=alexcrichtonbors-0/+6
incr.comp.: Allow for more fine-grained testing of CGU reuse and use it to test incremental ThinLTO. This adds some tests specifically targeted at incremental ThinLTO, plus the infrastructure for tracking the kind of cache hit/miss we had for a given CGU. @alexcrichton, let me know if you can think of any more tests to add. ThinLTO works rather reliably for small functions, so we should be able to test it in a robust way. I think after this lands it might time for a "Help us test incremental ThinLTO" post on irlo. r? @alexcrichton
2018-09-22stabilize pattern_parentheses featureAlex Stokes-7/+2
2018-09-22fix typo in commentAlex Stokes-123/+193
2018-09-22Auto merge of #54457 - pietroalbini:rollup, r=pietroalbinibors-47/+55
Rollup of 16 pull requests Successful merges: - #53652 (define copy_within on slices) - #54261 (Make `dyn` a keyword in the 2018 edition) - #54280 (remove (more) CAS API from Atomic* types where not natively supported) - #54323 (rustbuild: drop color handling) - #54350 (Support specifying edition in doc test) - #54370 (Improve handling of type bounds in `bit_set.rs`.) - #54371 (add -Zui-testing to rustdoc) - #54374 (Make 'proc_macro::MultiSpan' public.) - #54402 (Use no_default_libraries for all NetBSD flavors) - #54409 (Detect `for _ in in bar {}` typo) - #54412 (add applicability to span_suggestion call) - #54413 (Add UI test for deref recursion limit printing twice) - #54415 (parser: Tweak function parameter parsing to avoid rollback on succesfull path) - #54420 (Compress `Liveness` data some more.) - #54422 (Simplify slice's first(_mut) and last(_mut) with get) - #54446 (Unify christianpoveda's emails) Failed merges: - #54058 (Introduce the partition_dedup/by/by_key methods for slices) r? @ghost
2018-09-22Rollup merge of #54415 - petrochenkov:norollback, r=estebankPietro Albini-36/+26
parser: Tweak function parameter parsing to avoid rollback on succesfull path Since rollback is not perfect and may e.g. leave non-fatal errors after it, we need to make sure compilation fails if it happens. So in particular case of `fn parse_arg_general` we need to parse the "good" `TYPE` first and only then rollback and recover erroneous `PAT: TYPE` if necessary. Found when working on https://github.com/rust-lang/rfcs/pull/2544#issuecomment-423293222. r? @ghost