about summary refs log tree commit diff
path: root/src/libsyntax_ext
AgeCommit message (Collapse)AuthorLines
2019-12-30Rename directories for some crates from `syntax_x` to `rustc_x`Vadim Petrochenkov-8981/+0
`syntax_expand` -> `rustc_expand` `syntax_pos` -> `rustc_span` `syntax_ext` -> `rustc_builtin_macros`
2019-12-29Auto merge of #67112 - Centril:expr-polish, r=estebankbors-9/+11
Refactor expression parsing thoroughly Based on https://github.com/rust-lang/rust/pull/66994 together with which this has refactored basically the entirety of `expr.rs`. r? @estebank
2019-12-29Rollup merge of #67482 - ldm0:master, r=petrochenkovDylan DPC-3/+6
Fix outdated comment Logics in `libsyntax/ext/expand.rs:MacroExpander::expand()` have been moved to `libsyntax_expand/expand.rs:MacroExpander::fully_expand_fragment()` This pull request fixs the dangling file path. #### Old https://github.com/rust-lang/rust/blob/35176867f62f76b9bc27267878f2d74d9c776221/src/libsyntax/ext/expand.rs#L285-L301 #### New https://github.com/rust-lang/rust/blob/9ff30a7810c586819a78188c173a7b74adbb9730/src/libsyntax_expand/expand.rs#L421-L439 https://github.com/rust-lang/rust/blob/9ff30a7810c586819a78188c173a7b74adbb9730/src/libsyntax_expand/base.rs#L224-L234
2019-12-24x.py fmt after previous deignoreMark Rousskov-144/+205
2019-12-23extract parse_not_exprMazdak Farrokhzad-9/+11
2019-12-22Format the worldMark Rousskov-1859/+2003
2019-12-22Fix outdated commentDonough Liu-3/+6
Logics in libsyntax/ext/expand.rs:MacroExpander::expand() have moved to libsyntax_expand/expand.rs:MacroExpander::fully_expand_fragment()
2019-12-21Rollup merge of #67355 - Centril:merge-mut, r=oli-obkMazdak Farrokhzad-14/+14
Merge `ast::Mutability` and `mir::Mutability` r? @oli-obk
2019-12-20introduce 'type AttrVec'Mazdak Farrokhzad-11/+5
2019-12-201. ast::Mutability::{Mutable -> Mut, Immutable -> Not}.Mazdak Farrokhzad-14/+14
2. mir::Mutability -> ast::Mutability.
2019-12-12`AssocImplKind::{Method -> Fn}`.Mazdak Farrokhzad-1/+1
2019-12-12Remove `ast::{Impl,Trait}{Item,ItemKind}`.Mazdak Farrokhzad-7/+7
2019-12-12Unify `{Trait,Impl}ItemKind::TyAlias` structures.Mazdak Farrokhzad-1/+3
2019-12-12Use `Option` in `ImplItemKind::Method`.Mazdak Farrokhzad-1/+1
2019-12-06Rename to `then_some` and `then`varkor-3/+3
2019-12-06Use `to_option` in various placesvarkor-3/+4
2019-12-03Move early lint declarations to librustc_sessionMark Rousskov-2/+2
2019-12-02syntax: Use `ast::MacArgs` for attributesVadim Petrochenkov-2/+2
2019-12-02syntax: Remove redundant span from `ast::Mac`Vadim Petrochenkov-13/+3
Also remove a couple of redundant `visit_mac` asserts
2019-12-02syntax: Introduce a struct `MacArgs` for macro argumentsVadim Petrochenkov-11/+12
2019-11-30builtin_attrs.rs -> rustc_featureMazdak Farrokhzad-1/+1
2019-11-30move AttributeTemplate to builtin_attrsMazdak Farrokhzad-1/+1
2019-11-30introduce crate rustc_feature and move active, accepted, and removed to itMazdak Farrokhzad-1/+2
2019-11-26Rollup merge of #66754 - estebank:rustdoc-capitalization, r=Dylan-DPCTyler Mandry-2/+3
Various tweaks to diagnostic output
2019-11-25Various cleanupsEsteban Küber-1/+1
2019-11-25Tweak duplicate fmt arg errorEsteban Küber-1/+2
2019-11-24rustc_plugin: Remove support for syntactic pluginsVadim Petrochenkov-59/+0
2019-11-17Address review commentsVadim Petrochenkov-3/+2
2019-11-16parse: Use string literal parsing in the `asm` macroVadim Petrochenkov-14/+25
2019-11-16ast: Keep `extern` qualifiers in functions more preciselyVadim Petrochenkov-5/+2
2019-11-15Rollup merge of #66415 - tmandry:force-test-in-process, r=alexcrichtonMazdak Farrokhzad-1/+2
Add --force-run-in-process unstable option to libtest When running tests with `-Zpanic_abort_tests`, it's sometimes desirable to fall back to the old behavior of only running tests in-process. This comes in handy if the system process launcher is unavailable, or the test code somehow expects all tests to be run in the same process. For example, in Fuchsia we have unit tests that actually test the process launcher itself, in which case we can't use the process launcher to run the tests :). r? @alexcrichton cc @cramertj,@petrhosek
2019-11-15Improve error message for tests with panic=abortTyler Mandry-1/+2
2019-11-14Remove unused error_codes.rs filesGuillaume Gomez-120/+0
2019-11-14Update to use new librustc_error_codes libraryGuillaume Gomez-2/+5
2019-11-14Rollup merge of #66349 - euclio:def-site-builtins, r=petrochenkovYuki Okushi-0/+8
expand source_util macros with def-site context cc @petrochenkov See https://internals.rust-lang.org/t/spans-from-built-in-macro-expansions-are-not-from-expansion/11276/2 for context.
2019-11-12expand source_util macros with def-site contextAndy Russell-0/+8
2019-11-11Fix error message about exported symbols from proc-macro cratesLukas Kalbertodt-4/+6
Someone forgot to update the error message after `#[proc_macro]` and `#[proc_macro_attribute]` were stabilized.
2019-11-10Auto merge of #65324 - Centril:organize-syntax, r=petrochenkovbors-11/+12
Split libsyntax apart In this PR the general idea is to separate the AST, parser, and friends by a more data / logic structure (tho not fully realized!) by separating out the parser and macro expansion code from libsyntax. Specifically have now three crates instead of one (libsyntax): - libsyntax: - concrete syntax tree (`syntax::ast`) - definition of tokens and token-streams (`syntax::{token, tokenstream}`) -- used by `syntax::ast` - visitors (`syntax::visit`, `syntax::mut_visit`) - shared definitions between `libsyntax_expand` - feature gating (`syntax::feature_gate`) -- we could possibly move this out to its own crater later. - attribute and meta item utilities, including used-marking (`syntax::attr`) - pretty printer (`syntax::print`) -- this should possibly be moved out later. For now I've reduced down the dependencies to a single essential one which could be broken via `ParseSess`. This entails that e.g. `Debug` impls for `Path` cannot reference the pretty printer. - definition of `ParseSess` (`syntax::sess`) -- this is used by `syntax::{attr, print, feature_gate}` and is a common definition used by the parser and other things like librustc. - the `syntax::source_map` -- this includes definitions used by `syntax::ast` and other things but could ostensibly be moved `syntax_pos` since that is more related to this module. - a smattering of misc utilities not sufficiently important to itemize -- some of these could be moved to where they are used (often a single place) but I wanted to limit the scope of this PR. - librustc_parse: - parser (`rustc_parse::parser`) -- reading a file and such are defined in the crate root tho. - lexer (`rustc_parse::lexer`) - validation of meta grammar (post-expansion) in (`rustc_parse::validate_attr`) - libsyntax_expand -- this defines the infra for macro expansion and conditional compilation but this is not libsyntax_ext; we might want to merge them later but currently libsyntax_expand is depended on by librustc_metadata which libsyntax_ext is not. - conditional compilation (`syntax_expand::config`) -- moved from `syntax::config` to here - the bulk of this crate is made up of the old `syntax::ext` r? @estebank
2019-11-10move syntax::parse -> librustc_parseMazdak Farrokhzad-10/+10
also move MACRO_ARGUMENTS -> librustc_parse
2019-11-09Rollup merge of #66134 - estebank:unknown-formatting-trait, r=nikomatsakisMazdak Farrokhzad-33/+55
Point at formatting descriptor string when it is invalid When a formatting string contains an invalid descriptor, point at it instead of the argument: ``` error: unknown format trait `foo` --> $DIR/ifmt-bad-arg.rs:86:17 | LL | println!("{:foo}", 1); | ^^^ | = note: the only appropriate formatting traits are: - ``, which uses the `Display` trait - `?`, which uses the `Debug` trait - `e`, which uses the `LowerExp` trait - `E`, which uses the `UpperExp` trait - `o`, which uses the `Octal` trait - `p`, which uses the `Pointer` trait - `b`, which uses the `Binary` trait - `x`, which uses the `LowerHex` trait - `X`, which uses the `UpperHex` trait ```
2019-11-09move attr meta grammar to parse::validate_atr + ast_validationMazdak Farrokhzad-2/+3
2019-11-08ast::ItemKind::Fn: use ast::FnSigMazdak Farrokhzad-21/+15
2019-11-08ast::MethodSig -> ast::FnSigMazdak Farrokhzad-1/+1
2019-11-07syntax::parser::token -> syntax::tokenMazdak Farrokhzad-10/+12
2019-11-07syntax: use distinct FloatTy from rustc_target.Mazdak Farrokhzad-2/+1
We also sever syntax's dependency on rustc_target as a result. This should slightly improve pipe-lining. Moreover, some cleanup is done in related code.
2019-11-07parser: don't hardcode ABIs into grammarMazdak Farrokhzad-14/+17
2019-11-06Make doc comments cheaper with `AttrKind`.Nicholas Nethercote-6/+8
`AttrKind` is a new type with two variants, `Normal` and `DocComment`. It's a big performance win (over 10% in some cases) because `DocComment` lets doc comments (which are common) be represented very cheaply. `Attribute` gets some new helper methods to ease the transition: - `has_name()`: check if the attribute name matches a single `Symbol`; for `DocComment` variants it succeeds if the symbol is `sym::doc`. - `is_doc_comment()`: check if it has a `DocComment` kind. - `{get,unwrap}_normal_item()`: extract the item from a `Normal` variant; panic otherwise. Fixes #60935.
2019-11-06Remove unnecessary `Deref` impl for `Attribute`.Nicholas Nethercote-6/+6
This kind of thing just makes the code harder to read.
2019-11-06Rollup merge of #66139 - euclio:pluralize, r=nagisaMazdak Farrokhzad-2/+2
use American spelling for `pluralize!`
2019-11-06Rollup merge of #66086 - RalfJung:smallvec, r=nagisaMazdak Farrokhzad-1/+1
bump smallvec to 1.0 This includes https://github.com/servo/rust-smallvec/pull/162, fixing an unsoundness in smallvec. See https://github.com/servo/rust-smallvec/pull/175 for the 1.0 release announcement. Cc @mbrubeck @emilio