about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-07-28cleanup: Remove some language features related to built-in macrosVadim Petrochenkov-18/+0
They are now library features.
2019-07-28Rollup merge of #62550 - Centril:rest-patterns, r=petrochenkovMazdak Farrokhzad-385/+318
Implement RFC 2707 + Parser recovery for range patterns Implement https://github.com/rust-lang/rfcs/pull/2707. - Add a new basic syntactic pattern form `ast::PatKind::Rest` (parsed as `..` or `DOTDOT`) and simplify `ast::PatKind::{Slice, Tuple, TupleStruct}` as a result. - Lower `ast::PatKind::Rest` in combination with the aforementioned `PatKind` variants as well as `PatKind::Ident`. The HIR remains unchanged for now (may be advisable to make slight adjustments later). - Refactor `parser.rs` wrt. parsing sequences and lists of things in the process. - Add parser recovery for range patterns of form `X..`, `X..=`, `X...`, `..Y`, `..=Y`, and `...Y`. This should make it easy to actually support these patterns semantically later if we so desire. cc https://github.com/rust-lang/rust/issues/62254 r? @petrochenkov
2019-07-28Address comments in lowering + parsing.Mazdak Farrokhzad-4/+7
2019-07-28Recover on 'X..' / 'X..=' / 'X...' range patterns.Mazdak Farrokhzad-21/+43
2019-07-28Recover on '..X' / '..=X' / '...X' range patterns.Mazdak Farrokhzad-6/+46
2019-07-28Adjust parsing of Slice, Tuple, TupleStruct patterns.Mazdak Farrokhzad-127/+26
2019-07-28Cleanup using the new parse_*_seq methods.Mazdak Farrokhzad-96/+60
2019-07-28Add more parse_*_seq methods for code reuse.Mazdak Farrokhzad-0/+24
2019-07-28Cleanup parse_seq_* methods + record trailing separators.Mazdak Farrokhzad-42/+35
2019-07-28Adjust and document 'Pat::to_ty' accordingly.Mazdak Farrokhzad-4/+11
2019-07-28Adjust pretty printing accordingly.Mazdak Farrokhzad-47/+8
2019-07-28Adjust feature gating of subslice patterns accordingly.Mazdak Farrokhzad-5/+17
2019-07-28Adjust 'ast::PatKind::{TupleStruct,Tuple,Slice}'.Mazdak Farrokhzad-37/+21
2019-07-28Introduce 'ast::Pat::is_rest(&self) -> bool'.Mazdak Farrokhzad-0/+8
2019-07-28Add 'ast::PatKind::Rest'.Mazdak Farrokhzad-2/+18
2019-07-28Rollup merge of #63038 - eupn:outer-attribute-diag, r=estebankMazdak Farrokhzad-16/+45
Make more informative error on outer attribute after inner Fixes #61218. ?r @estebank
2019-07-28Rollup merge of #62771 - petrochenkov:depext, r=eddybMazdak Farrokhzad-785/+984
Break dependencies between `syntax_ext` and other crates Move `source_util` macros into `syntax_ext`. Move other early code generation facilities like standard library injection into `syntax_ext`. The only crate that depends on `syntax_ext` now is `rustc_interface` which is one of the "final" crates that depend on everything. Minor: Cleanup dependencies of `rustc_driver`, many of them are no longer used after introduction of `rustc_interface`. r? @eddyb
2019-07-27Remove run-pass test suitesVadim Petrochenkov-1/+1
2019-07-27Treat doc comments separatelyEvgenii P-8/+20
2019-07-27syntax_ext: `proc_macro_decls` -> `proc_macro_harness`Vadim Petrochenkov-3/+4
Few other minor renamings for consistency. Remove one unused dependency from `rustc_passes`. Fix libsyntax tests. Fix rebase.
2019-07-27Move standard library injection into libsyntax_extVadim Petrochenkov-116/+5
2019-07-27Move test harness generation into libsyntax_extVadim Petrochenkov-425/+0
2019-07-27Move proc macro server into libsyntaxVadim Petrochenkov-77/+968
2019-07-27Break dependencies between `syntax_ext` and some other cratesVadim Petrochenkov-167/+10
Move `source_uitil` macros into `syntax_ext` Cleanup dependencies of `rustc_driver`
2019-07-27Lint attributes on function argumentsCaio-8/+23
2019-07-27Fix typo in Delimited::open_ttJulien Cretin-2/+2
2019-07-27Make more informative error on outer attr after innerEvgenii P-15/+32
2019-07-26Auto merge of #62086 - petrochenkov:builtout, r=eddybbors-1/+6
Define built-in macros through libcore This PR defines built-in macros through libcore using a scheme similar to lang items (attribute `#[rustc_builtin_macro]`). All the macro properties (stability, visibility, etc.) are taken from the source code in libcore, with exception of the expander function transforming input tokens/AST into output tokens/AST, which is still provided by the compiler. The macros are made available to user code through the standard library prelude (`{core,std}::prelude::v1`), so they are still always in scope. As a result **built-in macros now have stable absolute addresses in the library**, like `core::prelude::v1::line!()`, this is an insta-stable change. Right now `prelude::v1` is the only publicly available absolute address for these macros, but eventually they can be moved into more appropriate locations with library team approval (e.g. `Clone` derive -> `core::clone::Clone`). Now when built-in macros have canonical definitions they can be imported or reexported without issues (https://github.com/rust-lang/rust/issues/61687). Other changes: - You can now define a derive macro with a name matching one of the built-in derives (https://github.com/rust-lang/rust/issues/52269). This was an artificial restriction that could be worked around with import renaming anyway. Known regressions: - Empty library crate with a crate-level `#![test]` attribute no longer compiles without `--test`. Previously it didn't compile *with* `--test` or with the bin crate type. Fixes https://github.com/rust-lang/rust/issues/61687 Fixes https://github.com/rust-lang/rust/issues/61804 r? @eddyb
2019-07-26Rollup merge of #62983 - Mark-Simulacrum:remove-needless-rc, r=petrochenkovMazdak Farrokhzad-20/+16
Remove needless indirection through Rc NamedMatch is already cheap to clone due to Lrc's inside.
2019-07-26Rollup merge of #62963 - estebank:homoglyph-recovery, r=petrochenkovMazdak Farrokhzad-35/+52
Allow lexer to recover from some homoglyphs
2019-07-26Rollup merge of #62956 - ia0:fix_62831, r=petrochenkovMazdak Farrokhzad-27/+26
Implement slow-path for FirstSets::first When 2 or more sequences share the same span, we can't use the precomputed map for their first set. So we compute it recursively. Fixes #62831.
2019-07-26Introduce built-in macros through libcoreVadim Petrochenkov-1/+6
2019-07-25Implement slow-path for FirstSets::firstJulien Cretin-27/+26
When 2 or more sequences share the same span, we can't use the precomputed map for their first set. So we compute it recursively. Fixes #62831.
2019-07-25Rollup merge of #62887 - estebank:issue-62881, r=petrochenkovMazdak Farrokhzad-1/+14
Make the parser TokenStream more resilient after mismatched delimiter recovery Fix #62881, fix #62895.
2019-07-25Rollup merge of #62735 - petrochenkov:galloc, r=alexcrichtonMazdak Farrokhzad-89/+175
Turn `#[global_allocator]` into a regular attribute macro It was a 99% macro with exception of some diagnostic details. As a result of the change, `#[global_allocator]` now works in nested modules and even in nameless blocks. Fixes https://github.com/rust-lang/rust/issues/44113 Fixes https://github.com/rust-lang/rust/issues/58072
2019-07-25Rollup merge of #60938 - jonas-schievink:doc-include-paths, r=petrochenkovMazdak Farrokhzad-33/+32
rustdoc: make #[doc(include)] relative to the containing file This matches the behavior of other in-source paths like `#[path]` and the `include_X!` macros. Fixes https://github.com/rust-lang/rust/pull/58373#issuecomment-462349380 Also addresses https://github.com/rust-lang/rust/issues/44732#issuecomment-467660239 cc #44732 This is still missing a stdsimd change (https://github.com/jonas-schievink/stdsimd/commit/42ed30e0b5fb5e2d11765b5d1e1f36234af85984), so CI will currently fail. I'll land that change once I get initial feedback for this PR.
2019-07-25review comments: add FIXME comments and formattingEsteban Küber-8/+21
2019-07-25Remove needless indirection through RcMark Rousskov-20/+16
NamedMatch is already cheap to clone due to Lrc's inside.
2019-07-24Allow lexer to recover from some homoglyphsEsteban Küber-33/+37
2019-07-25Rollup merge of #62901 - petrochenkov:serde, r=CentrilMazdak Farrokhzad-11/+7
cleanup: Remove `extern crate serialize as rustc_serialize`s
2019-07-24Rollup merge of #62917 - estebank:trailing-slash, r=matkladMazdak Farrokhzad-1/+1
Always emit trailing slash error Fix #62913. r? @petrochenkov
2019-07-24Rollup merge of #62890 - ↵Mazdak Farrokhzad-5/+5
fakenine:normalize_use_of_backticks_compiler_messages_p15, r=Centril Normalize use of backticks in compiler messages for libsyntax/* https://github.com/rust-lang/rust/issues/60532
2019-07-24Demote template check error to a lint for `#[test]` and `#[bench]`Vadim Petrochenkov-1/+2
2019-07-24syntax_ext: Reuse built-in attribute template checking for macro attributesVadim Petrochenkov-88/+98
2019-07-24syntax_ext: Turn `#[global_allocator]` into a regular attribute macroVadim Petrochenkov-1/+22
2019-07-24Merge `rustc_allocator` into `libsyntax_ext`Vadim Petrochenkov-0/+54
2019-07-23Always emit trailing slash errorEsteban Küber-1/+1
2019-07-23review commentsEsteban Küber-3/+4
2019-07-23Fix another caseEsteban Küber-3/+12
2019-07-23Normalize use of backticks in compiler messages for libsyntax/*Samy Kacimi-5/+5
https://github.com/rust-lang/rust/issues/60532