about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-07-10Remove duplicate attr_to_stringMark Rousskov-5/+1
attribute_to_string exists.
2019-07-10Move literal_to_string to fmt::DisplayMark Rousskov-6/+30
2019-07-10Rollup merge of #62393 - petrochenkov:notto-disu, r=Mark-SimulacrumMazdak Farrokhzad-49/+64
Fix pretty-printing of `$crate` (take 4) Pretty-print `$crate` as `crate` or `crate_name` in unstructured tokens like `a $crate c` in `foo!(a $crate c)`, but only if those tokens are printed as a part of AST pretty-printing, rather than as a standalone token stream. Fixes https://github.com/rust-lang/rust/issues/62325 Previous iterations - https://github.com/rust-lang/rust/pull/56647, https://github.com/rust-lang/rust/pull/57155, https://github.com/rust-lang/rust/pull/57915.
2019-07-09Resolve `$crate` in all hygienic contexts for pretty-pringingVadim Petrochenkov-2/+2
Stop visiting AST to discover those contexts, just iterate through hygiene data instead
2019-07-09Pretty-print `$crate` as `crate`/`::my_crate` in tokensVadim Petrochenkov-47/+62
...but only if those tokens are printed from inside of AST pretty-printing.
2019-07-09normalize use of backticks in compiler messages for libsyntax/feature_gateSamy Kacimi-13/+13
https://github.com/rust-lang/rust/issues/60532
2019-07-07syntax: Add feature gate.David Wood-2/+5
This commit adds a `const_in_array_repeat_expressions` feature gate and only create `Candidate::Repeat` if it is enabled.
2019-07-07Rollup merge of #62213 - QuietMisdreavus:cfg-doctest, r=GuillaumeGomezMazdak Farrokhzad-0/+4
rustdoc: set cfg(doctest) when collecting doctests Note: This PR builds on top of https://github.com/rust-lang/rust/pull/61199; only the last commit is specific to this PR. As discussed in https://github.com/rust-lang/rust/pull/61199, we want the ability to isolate items to only when rustdoc is collecting doctests, but we can't use `cfg(test)` because of libcore's `#![cfg(not(test))]`. This PR proposes a new cfg flag, `cfg(doctest)`, specific to this situation, rather than reusing an existing flag. I've isolated it behind a feature gate so that we can contain the effects to nightly only. (A stable workaround that can be used in lieu of `#[cfg(doctest)]` is `#[cfg(rustdoc)] #[doc(hidden)]`, at least once https://github.com/rust-lang/rust/pull/61351 lands.) Tracking issue: https://github.com/rust-lang/rust/issues/62210
2019-07-07Rollup merge of #62042 - petrochenkov:macstab, r=matthewjasperMazdak Farrokhzad-130/+53
Support stability and deprecation checking for all macros RELNOTES: Deprecation attributes on macros now have effect. Fixes https://github.com/rust-lang/rust/issues/34079 Fixes https://github.com/rust-lang/rust/issues/49912 Unblocks https://github.com/rust-lang/rust/pull/62086 Unblocks https://github.com/rust-lang/rust/pull/61000
2019-07-07syntax: Pre-intern names of all built-in macrosVadim Petrochenkov-4/+4
They always end up interned anyway
2019-07-07syntax: Migrate built-in macros to the regular stability checkingVadim Petrochenkov-60/+23
2019-07-07Support deprecation checking for macrosVadim Petrochenkov-2/+6
2019-07-07syntax: Keep full `Stability` in `SyntaxExtension`Vadim Petrochenkov-18/+8
2019-07-07resolve/expand: Move macro stability checking to an earlier pointVadim Petrochenkov-42/+9
2019-07-07syntax: Remove `NodeId` from `SyntaxExtension`Vadim Petrochenkov-8/+7
2019-07-06rustdoc: set cfg(doctest) when collecting doctestsQuietMisdreavus-0/+4
2019-07-07rustc: Remove `dylib` crate type from most rustc cratesAlex Crichton-1/+1
Now that procedural macros no longer link transitively to libsyntax, this shouldn't be needed any more! This commit is an experiment in removing all dynamic libraries from rustc except for librustc_driver itself. Let's see how far we can get with that!
2019-07-06privacy: Only opaque macros leak private thingsVadim Petrochenkov-18/+48
2019-07-06Fix tidy issuesVadim Petrochenkov-1/+1
2019-07-06`#[rustc_transparent_macro]` -> `#[rustc_macro_transparency = ...]`Vadim Petrochenkov-8/+14
2019-07-06`#[rustc_doc_only_macro]` -> `#[rustc_builtin_macro]`Vadim Petrochenkov-1/+1
2019-07-06Rollup merge of #62329 - matklad:no-peeking, r=petrochenkovMazdak Farrokhzad-157/+94
Remove support for 1-token lookahead from the lexer `StringReader` maintained `peek_token` and `peek_span_src_raw` for look ahead. `peek_token` was used only by rustdoc syntax coloring. After moving peeking logic into highlighter, I was able to remove `peek_token` from the lexer. I tried to use `iter::Peekable`, but that wasn't as pretty as I hoped, due to buffered fatal errors. So I went with hand-rolled peeking. After that I've noticed that the only peeking behavior left was for raw tokens to test tt jointness. I've rewritten it in terms of trivia tokens, and not just spans. After that it became possible to simplify the awkward constructor of the lexer, which could return `Err` if the first peeked token contained error.
2019-07-05Rollup merge of #62133 - petrochenkov:norustc, r=eddybMazdak Farrokhzad-16/+48
Feature gate `rustc` attributes harder Fixes https://github.com/rust-lang/rust/issues/62116
2019-07-05Rollup merge of #61545 - flip1995:internal_lints, r=oli-obkMazdak Farrokhzad-2/+1
Implement another internal lints cc #49509 This adds ~~two~~ one internal lint~~s~~: 1. LINT_PASS_IMPL_WITHOUT_MACRO: Make sure, that the `{declare,impl}_lint_pass` macro is used to implement lint passes. cc #59669 2. ~~USAGE_OF_TYCTXT_AND_SPAN_ARGS: item 2 on the list in #49509~~ ~~With 2. I wasn't sure, if this lint should be applied everywhere. That means a careful review of 0955835 would be great. Also 73fb9b4 allows this lint on some functions. Should I also apply this lint there?~~ TODO (not directly relevant for review): - [ ] https://github.com/rust-lang/rust/pull/59316#discussion_r280186517 (not sure yet, if this works or how to query for `rustc_private`, since it's not in [`Features`](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/feature_gate/struct.Features.html) :thinking: cc @eddyb) - [x] https://github.com/rust-lang/rust/pull/61735#discussion_r292389870 - [x] Check explicitly for the `{declare,impl}_lint_pass!` macros r? @oli-obk
2019-07-05Rollup merge of #62292 - Centril:split-async-closures, r=cramertjMazdak Farrokhzad-39/+53
Move `async || ...` closures into `#![feature(async_closure)]` The `async || expr` syntax is moved out from `#![feature(async_await)]` into its own gate `#![feature(async_closure)]`. New tracking issue: https://github.com/rust-lang/rust/issues/62290 Closes https://github.com/rust-lang/rust/issues/62214. cc https://github.com/rust-lang/rust/issues/62149 r? @varkor
2019-07-05Auto merge of #62099 - Mark-Simulacrum:syntax-print-clean-2, r=eddybbors-1298/+1147
Remove io::Result from syntax::print Since we're now writing directly to the vector, there's no need to thread results through the whole printing infrastructure
2019-07-04Switch master to 1.38Mark Rousskov-11/+0
2019-07-04make unwrap_or_abort non-generic againAleksey Kladov-1/+1
2019-07-04remove unused mk_sp_and_rawAleksey Kladov-10/+3
2019-07-04don't rely on spans when checking tokens for jointnessAleksey Kladov-47/+29
2019-07-04slightly comment lexer APIAleksey Kladov-11/+18
2019-07-04move constructors to topAleksey Kladov-51/+51
2019-07-04cleanup lexer constructorsAleksey Kladov-15/+7
2019-07-04remove peek_span_src_raw from StringReaderAleksey Kladov-68/+45
2019-07-04remove peek_token from StringReaderAleksey Kladov-18/+8
2019-07-04remove StringReader::peekAleksey Kladov-4/+0
The reader itself doesn't need ability to peek tokens, so it's better if clients implement this functionality. This hopefully becomes especially easy once we use iterator interface for lexer, but this is not too easy at the moment, because of buffered errors.
2019-07-04Rollup merge of #62297 - matklad:peek-delimited, r=petrochenkovMazdak Farrokhzad-67/+72
refactor check_for_substitution No behavior change, just flatter and simpler code. r? @petrochenkov
2019-07-04Rollup merge of #62258 - petrochenkov:idclean, r=CentrilMazdak Farrokhzad-170/+89
syntax: Unsupport `foo! bar { ... }` macros in the parser Their support in expansion was removed in https://github.com/rust-lang/rust/pull/61606. Also un-reserve `macro_rules` as a macro name, there's no ambiguity between `macro_rules` definitions and macro calls (it also wasn't reserved correctly). cc https://github.com/rust-lang-nursery/wg-grammar/issues/51
2019-07-04Rollup merge of #62249 - czipperz:use-mem-take-instead-of-replace-default, ↵Mazdak Farrokhzad-6/+7
r=dtolnay,Centril Use mem::take instead of mem::replace with default
2019-07-04Rollup merge of #62039 - jeremystucki:needless_lifetimes, r=eddybMazdak Farrokhzad-5/+5
Remove needless lifetimes (rustc)
2019-07-03Add separate 'async_closure' feature gate.Mazdak Farrokhzad-39/+53
2019-07-03Auto merge of #62335 - Mark-Simulacrum:rollup-0pcaz5a, r=Mark-Simulacrumbors-2/+2
Rollup of 15 pull requests Successful merges: - #62021 (MSVC link output improve) - #62064 (nth_back for chunks_exact) - #62128 (Adjust warning of -C extra-filename with -o.) - #62161 (Add missing links for TryFrom docs) - #62183 (std: Move a process test out of libstd) - #62186 (Add missing type urls in Into trait) - #62196 (Add Vec::leak) - #62199 (import gdb for explicit access to gdb.current_objfile()) - #62229 (Enable intptrcast for explicit casts) - #62250 (Improve box clone doctests to ensure the documentation is valid) - #62255 (Switch tracking issue for `#![feature(slice_patterns)]`) - #62285 (Fix michaelwoerister's mailmap) - #62304 (HashMap is UnwindSafe) - #62319 (Fix mismatching Kleene operators) - #62327 (Fixed document bug, those replaced each other) Failed merges: r? @ghost
2019-07-03Rollup merge of #62255 - Centril:slice-patterns-change-issue, r=varkorMark Rousskov-2/+2
Switch tracking issue for `#![feature(slice_patterns)]` Switches the tracking issue for `#![feature(slice_patterns)]` to a fresh one in https://github.com/rust-lang/rust/issues/62254 due to new RFCs. Closes https://github.com/rust-lang/rust/issues/23121. r? @varkor
2019-07-03Auto merge of #61995 - eddyb:hir-sep-ptr, r=petrochenkovbors-2/+3
rustc: use a separate copy of P for HIR than for AST. Note: this currently includes/is based on top of #61987. Like #61968, but goes one step further and uses a separate `P<...>` for the HIR, with no `Clone`, or the ability to mutate after allocation. There is still `into_inner`/`into_iter`, but they're only exposed for `hir::lowering`, and they would take more work to untangle. r? @petrochenkov cc @rust-lang/compiler
2019-07-03Add missing lifetime specifierJeremy Stucki-1/+1
2019-07-03Remove needless lifetimesJeremy Stucki-5/+5
2019-07-02more nits + typosNiko Matsakis-1/+1
2019-07-02feature-gate member constraints outside of async-awaitNiko Matsakis-0/+3
Minimizes risk.
2019-07-02refactor check_for_substitutionAleksey Kladov-67/+72
No behavior change, just flatter and simpler code
2019-07-01Enable mem_take feature in relevant cratesChris Gregory-0/+1