about summary refs log tree commit diff
path: root/src/libsyntax/ext
AgeCommit message (Collapse)AuthorLines
2018-02-07libsyntax/ext: trailing commas in builtin macrosMichael Lamparski-2/+4
Most notably this changes 'syntax::ext::base::get_single_str_from_tts' to accept a trailing comma, and revises the documentation so that this aspect is not surprising. I made this change under the understanding that this crate is private rustc implementation detail (I hope this is correct!). After reviewing all call sites, I believe the revised semantics are closer to the intended spirit of the function.
2018-01-30stabilize match_beginning_vertJonathan Goodman-1/+0
2018-01-30Rollup merge of #47732 - mark-i-m:markim_comments_0001, r=jseyfriedkennytm-126/+351
Run rustfmt and add doc comments to libsyntax/ext/tt/macro_parser.rs Similar to #47603 cc @theotherphil since you reviewed my other PR :smile: And because they are already assigned on #47603: r? @arielb1
2018-01-30Rollup merge of #47603 - mark-i-m:markim_comments_0000, r=jseyfriedkennytm-39/+173
Run rustfmt and add doc comments to libsyntax/ext/tt/quoted.rs I was already going to try to understand this code to try to implement rust-lang/rfcs#2298. I figured I would put that knowledge into comments and share... This PR contains _no changes_ to the code itself -- just formatting and comments. I'm not sure what the best way to do this is. I plan to make more such PR for other files, but I figured it would have fewer conflicts if I do it file by file...
2018-01-29fix typosMark Mansi-4/+4
2018-01-29Update commentMark Mansi-1/+2
2018-01-26A few more commentsMark Mansi-0/+8
2018-01-26Still more commentsMark Mansi-2/+26
2018-01-26Added/improved commentsMark Mansi-17/+61
2018-01-26Added lots of comments + minor reorganizationMark Mansi-34/+94
2018-01-26Added a bunch of comments to macro_parser.rsMark Mansi-10/+62
2018-01-26Run rustfmt on /libsyntax/ext/tt/macro_parser.rsMark Mansi-78/+114
2018-01-26Do not capture stderr in the compiler. Instead just panic silently for fatal ↵John Kåre Alsaker-9/+10
errors
2018-01-23Adds support for immovable generators. Move checking of invalid borrows ↵John Kåre Alsaker-1/+6
across suspension points to borrowck. Fixes #44197, #45259 and #45093.
2018-01-21Fix typosMark Mansi-3/+3
2018-01-19Add a bunch of doc commentsMark Mansi-3/+72
2018-01-19Run rustfmt and add commentsMark Mansi-38/+103
2018-01-18Rollup merge of #47481 - estebank:unused-args, r=arielb1kennytm-19/+19
Point at unused arguments for format string Avoid overlapping spans by only pointing at the arguments that are not being used in the argument string. Enable libsyntax to have diagnostics with multiple primary spans by accepting `Into<MultiSpan>` instead of `Span`. Partially addresses #41850.
2018-01-15Point at unused arguments for format stringEsteban Küber-19/+19
Avoid overlapping spans by only pointing at the arguments that are not being used in the argument string. Enable libsyntax to have diagnostics with multiple primary spans by accepting `Into<MultiSpan>` instead of `Span`.
2018-01-15Reexport -> re-export in prose and documentation commentsCarol (Nichols || Goulding)-1/+1
2018-01-04rustc: use {U,I}size instead of {U,I}s shorthands.Eduard-Mihai Burtescu-5/+5
2018-01-01Fix docs for future pulldown migrationMalo Jaffré-1/+2
2017-12-28CleanupMatt Peterson-4/+4
2017-12-28Add feature gate macro_lifetime_matcherMatt Peterson-1/+13
2017-12-28Fix build and add a macro lifetime labels testMatt Peterson-2/+1
2017-12-28replace parse_lifetime with expect_lifetimeMichael Hewson-1/+1
made `parser::Parser::expect_lifetime` public, so it can be called from `macro_parser::parse_nt`
2017-12-28Resurrecting #33135Michael Hewson-7/+16
Started rebasing @sgrif's PR #33135 off of current master. (Well, actually merging it into a new branch based off current master.) The following files still need to be fixed or at least reviewed: - `src/libsyntax/ext/tt/macro_parser.rs`: calls `Parser::parse_lifetime`, which doesn't exist anymore - `src/libsyntax/parse/parser.rs`: @sgrif added an error message to `Parser::parse_lifetime`. Code has since been refactored, so I just took it out for now. - `src/libsyntax/ext/tt/transcribe.rs`: This code has been refactored bigtime. Not sure whether @sgrif's changes here are still necessary. Took it out for this commit.
2017-12-28Auto merge of #47013 - topecongiro:issue-46655, r=petrochenkovbors-79/+103
Do not expand a derive invocation when derive is not allowed Closes #46655. The first commit is what actually closes #46655. The second one is just a refactoring I have done while waiting on a test.
2017-12-28Auto merge of #47017 - topecongiro:issue-33469, r=estebankbors-1/+5
Do not panic on interpolated token inside quote macro Closes #33469.
2017-12-26Do not panic on interpolated token inside quote macroSeiichi Uchida-1/+5
2017-12-26Do not expand a derive invocation when derive is not allowedSeiichi Uchida-79/+103
1. Change the return type of `expand_invoc()` and its subroutines to `Option<Expansion>` from `Expansion`. 2. Return `None` when expanding a derive invocation if the item cannot have derive on it (in `expand_derive_invoc()`).
2017-12-24Make column macro output 1 based and document itest31-1/+1
2017-12-22Auto merge of #46732 - estebank:silence-recovered-blocks, r=petrochenkovbors-0/+1
Do not emit type errors on recovered blocks When a parse error occurs on a block, the parser will recover and create a block with the statements collected until that point. Now a flag stating that a recovery has been performed in this block is propagated so that the type checker knows that the type of the block (which will be identified as `()`) shouldn't be checked against the expectation to reduce the amount of irrelevant diagnostic errors shown to the user. Fix #44579.
2017-12-21Auto merge of #46922 - kennytm:rollup, r=kennytmbors-7/+11
Rollup of 14 pull requests - Successful merges: #46636, #46780, #46784, #46809, #46814, #46820, #46839, #46847, #46858, #46878, #46884, #46890, #46898, #46918 - Failed merges:
2017-12-21Do not emit type errors on recovered blocksEsteban Küber-0/+1
When a parse error occurs on a block, the parser will recover and create a block with the statements collected until that point. Now a flag stating that a recovery has been performed in this block is propagated so that the type checker knows that the type of the block (which will be identified as `()`) shouldn't be checked against the expectation to reduce the amount of irrelevant diagnostic errors shown to the user.
2017-12-22Rollup merge of #46858 - QuietMisdreavus:external-doc-error, r=estebankkennytm-7/+11
tweaks and fixes for doc(include) This PR makes a handful of changes around `#[doc(include="file.md")]` (https://github.com/rust-lang/rust/issues/44732): * Turns errors when loading files into full errors. This matches the original RFC text. * Makes the `missing_docs` lint check for `#[doc(include="file.md")]` as well as regular `#[doc="text"]` attributes. * Loads files included by `#[doc(include="file.md")]` into dep-info, mirroring the behavior of `include_str!()` and friends. * Adds or modifies tests to check for all of these.
2017-12-21Add GenericParam, refactor Generics in ast, hir, rustdocJonas Platte-1/+1
The Generics now contain one Vec of an enum for the generic parameters, rather than two separate Vec's for lifetime and type parameters. Additionally, places that previously used Vec<LifetimeDef> now use Vec<GenericParam> instead.
2017-12-19Implement non-mod.rs mod statementsTaylor Cramer-5/+9
2017-12-19add files loaded through doc(include) into dep-infoQuietMisdreavus-0/+4
2017-12-19turn errors with external docs into actual errorsQuietMisdreavus-7/+7
2017-12-17syntax: Rename `P::unwrap` into `P::into_inner`Vadim Petrochenkov-9/+9
2017-12-14Use PathBuf instead of String where applicableOliver Schneider-23/+32
2017-12-09Use hygiene to access the injected crate (`core` or `std`) from builtin macros.Jeffrey Seyfried-12/+10
2017-11-30Implement RFC 2128 (use_nested_groups)Pietro Albini-19/+22
This commit adds support for nested groups inside `use` declarations, such as `use foo::{bar, sub::{baz::Foo, *}};`.
2017-11-26limit packed copy-out to non-generic Copy structsAriel Ben-Yehuda-1/+1
2017-11-21allow loading external files in documentationQuietMisdreavus-1/+89
Partial implementation of https://github.com/rust-lang/rfcs/pull/1990 (needs error reporting work) cc #44732
2017-11-14avoid the pprust infrastructure in macro expansionAriel Ben-Yehuda-3/+24
This changes macro expansion to format the path of a macro directly instead of usng the pprust infrastructure. The pprust infrastructure tries to perform line-breaking in a slow fashion, which is undesired when formatting the path of a macro. This should to speed up expansion by a fair amount (I saw 20% on a profiler on `rustc_mir`, and 50% of the time marked as "expansion" in the profiler/time-passes is actually spent loading dependencies).
2017-10-17Lifting Generics from MethodSig to TraitItem and ImplItem since we want to ↵Sunjay Varma-2/+3
support generics in each variant of TraitItem and ImplItem
2017-10-03Rename FileMap::path and change to an OptionPhilip Craig-3/+3
2017-09-30Don't use remapped path when loading modules and include filesPhilip Craig-5/+3