summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2018-01-12Treat #[path] files as mod.rs filesTaylor Cramer-4/+8
2018-01-10Try to fix a perf regression by updating logMalo Jaffré-1/+1
Upgrade `log` to `0.4` in multiple crates.
2018-01-01Fix docs for future pulldown migrationMalo Jaffré-5/+7
2018-01-01Auto merge of #46895 - ricochet1k:macro-lifetimes, r=jseyfriedbors-21/+69
Allow lifetimes in macros This is a resurrection of PR #41927 which was a resurrection of #33135, which is intended to fix #34303. In short, this allows macros_rules! to use :lifetime as a matcher to match 'lifetimes. Still to do: - [x] Feature gate
2017-12-30in which leading zeroes on tuple-struct accesses are abjuredZack M. Davis-3/+12
Resolves #47073.
2017-12-30refactor lifetime out of is_lifetimeMatt Peterson-19/+20
2017-12-28CleanupMatt Peterson-5/+5
2017-12-28Add feature gate macro_lifetime_matcherMatt Peterson-2/+20
2017-12-28CleanupMatt Peterson-4/+3
2017-12-28Fix testsMatt Peterson-9/+27
2017-12-28Fix build and add a macro lifetime labels testMatt Peterson-2/+1
2017-12-28replace parse_lifetime with expect_lifetimeMichael Hewson-2/+2
made `parser::Parser::expect_lifetime` public, so it can be called from `macro_parser::parse_nt`
2017-12-28Resurrecting #33135Michael Hewson-7/+20
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-82/+106
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-28Prefer to use attr::contains_name() and attr::find_by_name()Seiichi Uchida-3/+3
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-27Auto merge of #46479 - bkchr:termination_trait, r=arielb1bors-0/+3
Implements RFC 1937: `?` in `main` This is the first part of the RFC 1937 that supports new `Termination` trait in the rust `main` function. Thanks @nikomatsakis, @arielb1 and all other people in the gitter channel for all your help! The support for doctest and `#[test]` is still missing, bu as @nikomatsakis said, smaller pull requests are better :)
2017-12-27Auto merge of #46977 - est31:column_fix, r=dtolnaybors-1/+1
Make the output of the column! macro 1 based Fixes #46868. I didn't add any regression tests as the change already had to change tests inside the codebase. r? @dtolnay
2017-12-27Auto merge of #46803 - estebank:non-ascii-def-span, r=petrochenkovbors-1/+3
Use def span for non-ascii ident feature gate error
2017-12-26Do not panic on interpolated token inside quote macroSeiichi Uchida-1/+5
2017-12-26Adds termination_trait feature gateBastian Köcher-0/+3
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-25"incompatible arm" diagnostic span tweakEsteban Küber-0/+6
Use span label instead of span note for single line spans in "incompatible arm" diagnostic.
2017-12-24Auto merge of #46888 - cramertj:nested-impl-trait-error, r=nikomatsakisbors-2/+70
Add a feature gate for nested uses of `impl Trait` This allows us to delay stabilization of nested `impl Trait` until we have a plan to solve the problem posed [here](https://github.com/rust-lang/rust/issues/34511#issuecomment-350715858). r? @nikomatsakis
2017-12-24Make column macro output 1 based and document itest31-1/+1
2017-12-22Auto merge of #46779 - Zoxc:par-merge-without-sync, r=arielb1bors-9/+8
Work towards thread safety in rustc This PR is split out from https://github.com/rust-lang/rust/pull/45912. It contains changes which do not require the `sync` module.
2017-12-22Auto merge of #46732 - estebank:silence-recovered-blocks, r=petrochenkovbors-3/+10
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/+13
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-3/+10
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-21Auto merge of #45930 - jplatte:generics_refactoring, r=eddybbors-161/+184
Generics refactoring (groundwork for const generics) These changes were suggested by @eddyb. After this change, the `Generics` contain one `Vec` of an enum for the generic parameters, rather than two separate `Vec`s for lifetime and type parameters. Type params and const params will need to be in a shared `Vec` to preserve their ordering, and moving lifetimes into the same `Vec` should simplify the code that processes `Generics`.
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-22Rollup merge of #46839 - michaelwoerister:faster-span-hashing-2, r=nikomatsakiskennytm-0/+2
incr.comp.: Precompute small hash for filenames to save some work. For each span we hash the filename of the file it points to. Since filenames can be quite long, especially with absolute paths, this PR pre-computes a hash of the filename and we then only hash the hash. r? @nikomatsakis
2017-12-21Make mk_attr_id thread safeJohn Kåre Alsaker-9/+8
2017-12-21Add a feature gate for nested uses of `impl Trait`Taylor Cramer-2/+70
2017-12-21Add GenericParam, refactor Generics in ast, hir, rustdocJonas Platte-161/+184
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-21Rollup merge of #46827 - petrochenkov:assocrecov2, r=estebankGuillaume Gomez-67/+76
syntax: Follow-up to the incorrect qpath recovery PR cc https://github.com/rust-lang/rust/pull/46788 Add tests checking that "priority" of qpath recovery is higher than priority of unary and binary operators Fix regressed parsing of paths with fn-like generic arguments r? @estebank
2017-12-21Auto merge of #46531 - cramertj:no-mo-modrs, r=nikomatsakisbors-50/+140
Implement non-mod.rs mod statements Fixes https://github.com/rust-lang/rust/issues/45385, cc https://github.com/rust-lang/rust/issues/44660 This will fail tidy right now because it doesn't recognize my UI tests as feature-gate tests. However, I'm not sure if compile-fail will work out either because compile-fail usually requires there to be error patterns in the top-level file, which isn't possible with this feature. What's the recommended way to handle this?
2017-12-20Fix parsing of paths with fn-like generic argumentsVadim Petrochenkov-9/+11
2017-12-20Move impls for qpath recovery trait from `ast.rs`Vadim Petrochenkov-58/+65
2017-12-20Add nll feature and make nll imply nll_dump_causeSantiago Pastorino-0/+9
2017-12-20Rollup merge of #46851 - petrochenkov:tospace, r=estebankkennytm-17/+18
Fix whitespacing issues in pretty-printing of bounds cc https://github.com/rust-lang/rust/pull/46827#discussion_r157603277
2017-12-19Implement non-mod.rs mod statementsTaylor Cramer-50/+140
2017-12-19add files loaded through doc(include) into dep-infoQuietMisdreavus-0/+4
2017-12-20Fix whitespacing issues in pretty-printing of boundsVadim Petrochenkov-17/+18
2017-12-19turn errors with external docs into actual errorsQuietMisdreavus-7/+7
2017-12-19incr.comp.: Precompute small hash for filenames to save some work.Michael Woerister-0/+2
2017-12-19Remove a token after closing delimiter from the span of macro in type positiontopecongiro-1/+1
2017-12-17Use def span for non-ascii ident feature gate errorEsteban Küber-1/+3
2017-12-17syntax: recovery for incorrect associated item paths like `[T; N]::clone`Vadim Petrochenkov-20/+145
2017-12-17syntax: Rename `P::unwrap` into `P::into_inner`Vadim Petrochenkov-15/+15